A multi-camera multi-person tracking system using YOLOv8 and DeepOCSORT. Includes additional features such as emotion recognition, gender recognition, and posture classification.
- Create a conda environment
conda create -n mct python=3.8.17 conda activate mct
- Clone this repository and install necessary dependencies
pip install -r requirements.txt
- To use CUDA, install
onnxruntime-gpubased on your CUDA version as shown here: https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html
-
Input videos: To specify video sources, navigate to the
configs.yamlfile and locate thesourcesfield. In this section, you can define multiple video sources that your application will process. (Note: videos will be processed in parallel)Example:
sources: - /path/to/video1.mp4 - /path/to/video2.mp4 - /path/to/video3.mp4
-
Output Location: If you wish to customize the output location for the processed data, find the
output_locationentry within theconfigs.yamlfile.Example:
output_location: /path/to/output/folder
Within the configs.yaml file, you have the flexibility to adjust essential hyperparameters that influence the behavior of your application. Three key hyperparameters, namely tracker_configs, person_seg_configs, and face_det_configs, are defined in this configuration file.
-
Tracker Configuration: The
tracker_configssection allows you to fine-tune parameters associated with the tracking module. Depending on your specific requirements, you can experiment with values such asreid_thresh,assoc_func,iou_thresh, etc. -
Person Segmentation and Face Detection Configuration: The
person_seg_configsandface_det_configssections correspond to modules trained using Ultralytics. Refer to their documentation for detailed parameter information.
You can choose to anonymize the people by setting anonymize to true in configs.yaml. Enabling the this parameter ensures that each detected person is anonymized by applying a black mask.
Once you have completed the setup process and configured your parameters as desired, run the script:
python main.py --configs configs.yaml| Description | Model | Dataset | Note |
|---|---|---|---|
| Emotion Recognition | mini-Xception | FER-2013 | converted to ONNX from original source |
| Gender Recognition | mini-Xception | IMDB | converted to ONNX from original source |
| Object Detection & Segmentation | YOLOv8m-seg | COCO | extra training with more augmentations |
| Face Detection | YOLOv8n | WIDER Face | taken from original source |
| Posture Classification | YOLOv8x-cls | POLAR | custom trained with only 3 classes |
| Person Reidentification | YoutuReid | DukeMTMC | taken from original source |