Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLO Model Trainer

YOLO Model Trainer is a beginner-friendly Windows desktop app for creating YOLO object detection datasets and training small YOLO models locally on CPU.

The app is designed for non-technical users who need a guided way to:

  • Create and reopen annotation projects.
  • Create labels/classes.
  • Add image folders and PDFs.
  • Draw bounding boxes.
  • Use an existing YOLO .pt model to suggest boxes one image at a time.
  • Split a dataset into train, validation, and test sets.
  • Train a YOLO model on CPU.
  • Export a YOLO-ready dataset and trained model.

Requirements

  • Windows 10 or 11
  • Git for Windows
  • Python 3.10+
  • Python 3.11 or 3.12 recommended for best PyTorch and Ultralytics package support
  • CPU training only

Download The App From GitHub

Open Command Prompt.

All commands in this guide are written for Command Prompt, not PowerShell.

Go to the folder where you want to keep the app. This example uses your Desktop:

cd %USERPROFILE%\Desktop

Clone the repository:

git clone https://github.com/RylanBosquez/yolo-model-trainer.git

Go into the project folder:

cd yolo-model-trainer

If your GitHub repository has a different name, use that repository URL and folder name instead.

If Command Prompt says 'git' is not recognized, install Git for Windows, close Command Prompt, then open Command Prompt again:

https://git-scm.com/download/win

Install

In the same Command Prompt window, run:

python -m venv .venv
.venv\Scripts\activate.bat
python -m pip install --upgrade pip
pip install -r requirements.txt

Start The App

Open Command Prompt, go into the project folder, activate the environment, and start the app:

cd %USERPROFILE%\Desktop\yolo-model-trainer
.venv\Scripts\activate.bat
python main.py

The app opens with a Dashboard tab and a separate Training tab.

Create Or Open A Project

Projects are saved as folders. A project contains labels, annotation files, split dataset folders, trained models, exports, and project settings.

To start:

  1. Click Create Project.
  2. Choose an empty folder or create a new folder.
  3. Enter a project name.
  4. Click OK.

To continue later:

  1. Click Open Project.
  2. Select the project folder that contains project.json.

Create Labels

Labels are the object names you want YOLO to detect.

Examples:

  • person
  • truck
  • drawing number
  • revision number

To add a label:

  1. Type the label name in the Labels section.
  2. Click Create Label.

Use Rename Label or Delete Label if you need to change the class list.

Add Images

Click Add Images and choose a folder. The app scans the folder and subfolders for:

  • .jpg
  • .jpeg
  • .png
  • .bmp
  • .webp
  • .pdf

PDF files are converted into image pages.

By default, imported images are referenced from their original location for speed with large folders. Use Copy images into this project if you want a portable project folder.

Annotate Images

Open an image from the image list. The image list shows:

[ ] image has no saved boxes
[x] image has saved boxes

Choose a label, then draw boxes on the image.

Mouse Controls

  • Left click and drag on empty image space: create a bounding box.
  • Left click an existing box: select it.
  • Drag an existing box: move it.
  • Drag a box corner: resize it.
  • Right click and drag: zoom into that area.
  • Middle mouse button drag: pan.
  • Mouse wheel: zoom in or out.

Keyboard Shortcuts

  • Delete: delete the selected box.
  • Ctrl+S: save annotations.
  • Ctrl+Z: undo the last box edit.
  • Left Arrow: previous image.
  • Right Arrow: next image.

Annotations are saved automatically when moving between images while Save automatically when moving between images is enabled.

Auto Detect One Image At A Time

Auto Detect uses an existing YOLO .pt model to suggest boxes.

To use it:

  1. Click Choose YOLO Model.
  2. Pick a .pt file.
  3. Leave Detect when I open an image enabled.
  4. Open an image.

The app runs YOLO only for the image you are viewing. It does not bulk pre-annotate the whole project.

Predicted boxes are editable. Review them, move or resize them if needed, then save by moving to another image or pressing Ctrl+S.

Split The Dataset

Open the Training tab.

The default split is:

  • Train: 80%
  • Validation: 15%
  • Test: 5%

Click Split Dataset before training.

The app creates YOLO folders:

images/train
images/val
images/test
labels/train
labels/val
labels/test

It also regenerates data.yaml.

Train On CPU

Open the Training tab and use the beginner defaults:

  • Base model: yolo11n.pt
  • Epochs: 20
  • Image size: 640
  • Batch size: 4

Click Start Training.

Training runs in the background so the app stays open. Logs appear in the Training tab.

CPU training can be slow. If your computer runs out of memory, lower the batch size or image size.

Trained weights are saved in:

models/
runs/train/weights/

Export

Click Export Dataset to create a YOLO-ready zip file. The export includes dataset files, labels, data.yaml, and trained model files when available.

Exports are saved in the project folder under:

exports/

Error Logs

If the app crashes or shows an unexpected error, check:

logs/app.log
logs/faults.log

app.log captures Python, Qt, and background worker errors.

faults.log captures lower-level Python fault traces if the interpreter crashes.

Training Quality Tips

If training finishes but results are poor, check the validation metrics.

Good first goals:

  • At least 50 to 100 labeled boxes per class.
  • At least 10 to 20 validation boxes per class.
  • Boxes should be tight and consistent.
  • Avoid having almost all images be empty backgrounds.
  • Re-split the dataset after adding more labels.
  • Train for more epochs after the dataset has enough examples.

If validation shows very few instances, add more labels before expecting good results.

Project Folder Layout

Each project uses this structure:

project_name/
  project.json
  classes.txt
  data.yaml
  images/
    all/
    train/
    val/
    test/
  labels/
    all/
    train/
    val/
    test/
  models/
  exports/

Known Limitations

  • Bounding boxes only.
  • CPU training only.
  • Auto Detect runs one image at a time.
  • Training cancellation asks the subprocess to stop, but Ultralytics may finish the current step first.
  • Large local project folders should not be committed to GitHub.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages