Simple tool to detect objects and people in videos using AI. Works on Windows and macOS.
- Takes a video file as input
- Detects all objects in the video using YOLO Nano AI model
- Draws green boxes around detected objects with labels and confidence scores
- Optionally detects human poses (skeleton/keypoints)
- Saves the annotated video as output
- Python 3.8 or newer (3.11+ recommended)
- About 500 MB free disk space
- Internet connection (first run only - to download the AI model)
Windows (PowerShell):
python -m pip install --upgrade pip
pip install -r requirements.txtmacOS/Linux (Terminal):
python3 -m pip install --upgrade pip
pip3 install -r requirements.txtWindows (PowerShell):
python yolo_nano_v1.py --input "path/to/video.mp4" --output "path/to/output.mp4"macOS/Linux (Terminal):
python3 yolo_nano_v1.py --input "path/to/video.mp4" --output "path/to/output.mp4"The processed video will be saved at the path you specified in --output.
python yolo_nano_v1.py --input "video.mp4" --output "video_detected.mp4"
python yolo_nano_v1.py --input "/path/to/folder" --output "/path/to/output_folder"
python yolo_nano_v1.py --input "video.mp4" --output "output.mp4" --conf 0.5
python yolo_nano_v1.py --input "video.mp4" --output "output.mp4" --pose
| Option | Default | Description |
|---|---|---|
--input |
Required | Path to video file or folder with video |
--output |
Required | Path to save output video |
--conf |
0.25 | Detection confidence (0.0-1.0). Higher = fewer detections |
--pose |
Off | Enable human pose detection |
Q: "ModuleNotFoundError: No module named 'ultralytics'"
- Run:
pip install -r requirements.txt
Q: "Cannot open video"
- Check file path is correct (use forward slashes
/or double backslashes\\) - Supported formats:
.mp4,.avi,.mov,.mkv
Q: "Failed to open video writer"
- Try using
.aviextension instead:--output "video.avi"
Q: Script is very slow
- This is normal on CPU-only systems (can take 5-30 minutes for 5-minute video)
- First run downloads the model (~6 MB) - this is one-time only
Q: How to enable GPU acceleration?
- Install CUDA-enabled PyTorch from: https://pytorch.org/get-started/locally/
- Run script normally - it will auto-detect and use GPU
yolo_nano_v1.py - Main script
requirements.txt - Python dependencies
README.md - This file
run_windows.bat - Quick run script for Windows
# YOLO Nano Video Detector — Overview
This repository contains a simple, beginner-friendly script to run Ultralytics YOLO (Nano) on a video file and save an annotated output video with bounding boxes and labels.
Keep these files:
- `yolo_nano_v1.py` — main script (object detection; optional pose)
- `requirements.txt` — minimal dependencies
- `README.md` — this brief overview
- `SETUP.txt` — step-by-step setup instructions
- `START_HERE.txt` — quick commands, customization tips, troubleshooting
Quick usage (from the project folder):
Windows PowerShell
```powershell
python yolo_nano_v1.py --input "path/to/video.mp4" --output "path/to/output.mp4"
macOS / Linux
python3 yolo_nano_v1.py --input "path/to/video.mp4" --output "path/to/output.mp4"Options you can use:
--conf: detection confidence threshold (default 0.25)--pose: enable MediaPipe pose overlay (optional, requiresmediapipe)
If you need more help, open START_HERE.txt — it contains exact commands, customization tips, and troubleshooting steps.
That’s it — this README keeps things minimal and directs users to START_HERE.txt and SETUP.txt for details.