How kvdayananda/realtime-human-detection works
This repository supports two related workflows: training a two-class image classifier, and running or assessing person detection with a YOLO model. The primary interactive workflow captures webcam frames, tracks people, detects faces, and displays annotated counts. Separate dataset-check and error-review scripts produce reports and visual review artifacts. The tree also contains an animal-image collection, but the sampled code does not connect it to these workflows. Edges reflect only relationships shown in sampled source; unsampled modules and integrations are not inferred.
Main entry points: human detection dataset Labeled images · create_error_contact_sheet.py Error contact sheets · review_errors.py Review errors · train.py Train classifier
Components 19
Classifier training
- Train classifier
src/train.py
Live detection
- Webcam detection
src/detect.py
Dataset assessment
- Dataset check
src/check_dataset.py - Inspect mismatches
src/inspect_errors.py - Error contact sheets
src/create_error_contact_sheet.py - Review errors
src/review_errors.py - Prepare test images
src/prepare_test_images.py - Inspect image files
src/inspect_dataset.py - View image samples
src/view_samples.py
Data and artifacts
- Labeled images
dataset/human detection dataset - Classifier weights
models/human_classifier.safetensors - Classifier config
models/human_classifier_config.json - YOLO model
models/yolo11n.pt - Agreement report
runs/full_dataset_check/preliminary_report.csv - Contact sheets
runs/error_contact_sheet - Review detections
runs/error_review - Prepared images
dataset/person_detection_test/images
Other components
- Operator
- Webcam
Connections 23
- Operator → Webcam detection: starts
src/detect.py - Webcam → Webcam detection: provides frames
src/detect.py - Webcam detection → YOLO model: loads and tracks
src/detect.py - Operator → Train classifier: runs
- Train classifier → Labeled images: loads images
src/train.py - Train classifier → Classifier weights: writes weights
src/train.py - Train classifier → Classifier config: writes config
src/train.py - Dataset check → Labeled images: reads images
src/check_dataset.py - Dataset check → YOLO model: loads model
src/check_dataset.py - Dataset check → Agreement report: writes report
src/check_dataset.py - Inspect mismatches → Agreement report: reads report
src/inspect_errors.py - Error contact sheets → Agreement report: reads report
src/create_error_contact_sheet.py - Error contact sheets → Labeled images: reads images
src/create_error_contact_sheet.py - Error contact sheets → YOLO model: loads model
src/create_error_contact_sheet.py - Error contact sheets → Contact sheets: writes sheets
src/create_error_contact_sheet.py - Review errors → Agreement report: reads report
src/review_errors.py - Review errors → Labeled images: reads images
src/review_errors.py - Review errors → YOLO model: loads model
src/review_errors.py - Review errors → Review detections: saves detections
src/review_errors.py - Prepare test images → Labeled images: copies samples
src/prepare_test_images.py - Prepare test images → Prepared images: writes images
src/prepare_test_images.py - Inspect image files → Labeled images: reads samples
src/inspect_dataset.py - View image samples → Labeled images: reads samples
src/view_samples.py