How zaki1003/yolo-crowd works
Project type and purpose
• YOLO-CROWD is an open-source, edge-deployable, deep-learning–based crowd counting and face detection tool.
• It extends the one-stage YOLOv5s detector with custom modules (RFE, SEAM), novel losses (NWD, Repulsion) and supports both training and real-time inference on devices (CPU/GPU/TensorRT).
File structure
Top‐level directories & files:
• train.py / detect.py / test.py – entry points for training, inference and quick tests
• models/ – PyTorch model definitions, experiment presets, export utilities, hub YAMLs
• utils/ – preprocessing, dataset loaders, loss/metric functions, AWS scripts, GAE deployment files, WandB logging
• data/ – dataset config YAMLs (COCO, VOC, Argoverse), image folders, download scripts
• weights/ – scripts to fetch pretrained/checkpointed weights
• notebooks (.ipynb) – tutorials for training, converting to TensorRT and running inference
• Dockerfile – containerization for reproducible environment
• requirements.txt – Python dependencies
README insights
• Describes problem domain, model architecture enhancements (RFE, SEAM), performance metrics, and training/inference workflows.
• Specifies external services: Roboflow dataset, Google Drive/TensorRT engine downloads, WandB for experiment tracking, optional GAE deployment.
Main components & their relationships
A. Data Ingestion & Storage
• Raw images/labels (data/images, data/*.yaml)
• Download scripts → automated data acquisition (data/scripts)
B. Training Pipeline
• train.py loads dataset via utils/datasets.py
• Model architecture defined in models/yolo*.py + hubconf.yaml
• Losses from utils/loss.py (NWD, Repulsion) & metrics in utils/metrics.py
• Logging to WandB (utils/wandb_logging)
• Checkpoints written to weights/ & results dir
C. Model Registry & Export
• models/export.py for TorchScript/ONNX/TensorRT conversion
• notebooks (Yolov5_TensortRT_Convert_and_detect.ipynb) demonstrate conversion
D. Inference Pipeline
• Real-time streams: webcam, RTSP, YouTube, files
E. Deployment & Environment
• Dockerfile for containerized inference/training
• Google App Engine scripts (utils/google_app_engine) for cloud hosting
• AWS userdata/mime for EC2 provisioning (utils/aws)
Architectural patterns & design principles
• Modular separation of concerns (models vs utils vs data vs scripts)
• Hub pattern: YAML-driven model configurations
• Pluggable loss/metric modules for rapid experimentation
• Clear train/infer split with shared preprocessing