Lightweight repository of scripts and utilities for YOLO-based object detection, SAHI slicing, dataset creation, visualization, and Label Studio integration.
requirements.txtnow includestorchandtorchvision. For CUDA-enabled installs, please use the official PyTorch selector to install the correct wheel for your GPU.- A configuration template is available at
scripts/Sahi_detect/config_template.yaml(copy and edit to create your runtimeconfig.yaml).
- Create and activate a Python virtual environment:
python3 -m venv yolo_env
# Linux / macOS
source yolo_env/bin/activate
# Windows (PowerShell)
.\yolo_env\Scripts\Activate.ps1- Install PyTorch (choose proper wheel for your CUDA version). Example for CUDA via PyTorch's index (adjust to your CUDA):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu130- Install remaining dependencies:
pip install -r requirements.txtNote: requirements.txt includes torch/torchvision as convenience, but installing PyTorch through the official selector ensures compatibility with your CUDA runtime.
- Run a simple detection (example):
python yolo_detect_v11.py --input path/to/image.jpg --conf 0.5- Run SAHI detection (example):
python scripts/Sahi_detect/sahi_detection.py --config scripts/Sahi_detect/config_template.yamlUse scripts/Sahi_detect/config_template.yaml as a starting point. Copy it to scripts/Sahi_detect/config.yaml and update the input_dir, output_dir, and model.path values to point to your dataset and model weights.
yolo_detect_v11.py— YOLO v11 inference scriptscripts/train/yolo11_train.py— Training scriptscripts/Sahi_detect/— SAHI detection scripts and configsutils/— utilities for staging images, visualization, dataset creation, Label Studio helpersrequirements.txt— project dependencies
- Verify GPU drivers and CUDA with
nvidia-smiand test PyTorch with:
python -c "import torch; print('GPU Found!' if torch.cuda.is_available() else 'CPU Only')"- If Pillow raises errors, see
scripts/Sahi_detect/INSTALL_PILLOW.md.
Contributions welcome — open an issue or submit a PR.
Last Updated: February 2026