Skip to content

JoeShade/openCV-Capture-Label-Train

Repository files navigation

OpenCV Capture, Label, Train

Platform: Windows Python: 3.12 Tests: pytest

Introduction

This repository is a Windows-first desktop toolkit for a small YOLO object-detection workflow. It provides three companion scripts for capture and mandatory labeling, temporary YOLO dataset preparation and training launch, and live inference with telemetry overlays.

Disclaimer

The tools are intended for local desktop use, controlled imaging setups, and experiment-scale model work. Camera support, GPU detection, and runtime stability depend on the installed Windows drivers and Python packages, and the repo is not positioned as a production inspection system.

Set-up

Use Python 3.12 and keep dependencies inside a dedicated .venv312 environment so the GUI tools and native packages stay aligned.

py -3.12 -m venv .venv312
.\.venv312\Scripts\activate
pip install --upgrade pip
pip install --only-binary=:all: "numpy<2.3.0" "opencv-python<4.13" pyqt5 ultralytics torch psutil pynvml

The repo stores shared state on disk in captures/, classes.txt, class_colors.json, and config.json. Keep those files alongside the three top-level scripts when running locally.

Usage

Run the primary capture and labeling app:

.\.venv312\Scripts\python.exe .\main.py --camera 0

Launch the training companion to build a temporary .yolo_training_cache/ dataset and start the Ultralytics CLI:

.\.venv312\Scripts\python.exe .\train_model.py

Launch the inference viewer for live model checks and screenshot capture:

.\.venv312\Scripts\python.exe .\run_inference.py

Contributing

See CONTRIBUTING.md for local workflow, validation expectations, and review readiness.

Supporting docs

About

OpenCV Python tool for capturing images and interactively labelling them into YOLO-formatted object detection datasets.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages