{"id":20041774,"url":"https://github.com/ajithvcoder/custom_multiobject_multiinstance_tracking","last_synced_at":"2025-05-05T08:32:28.115Z","repository":{"id":39727832,"uuid":"263377807","full_name":"ajithvcoder/Custom_Multiobject_MultiInstance_Tracking","owner":"ajithvcoder","description":"Multi class multi instance tracking . You can also perform custom multi object tracking","archived":false,"fork":false,"pushed_at":"2022-11-21T22:44:43.000Z","size":32767,"stargazers_count":15,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T19:48:06.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajithvcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-12T15:34:18.000Z","updated_at":"2021-11-17T16:21:27.000Z","dependencies_parsed_at":"2022-09-08T09:10:29.990Z","dependency_job_id":null,"html_url":"https://github.com/ajithvcoder/Custom_Multiobject_MultiInstance_Tracking","commit_stats":null,"previous_names":["ajithvcoder/custom_multiobject_multiinstance_tracking"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2FCustom_Multiobject_MultiInstance_Tracking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2FCustom_Multiobject_MultiInstance_Tracking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2FCustom_Multiobject_MultiInstance_Tracking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2FCustom_Multiobject_MultiInstance_Tracking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajithvcoder","download_url":"https://codeload.github.com/ajithvcoder/Custom_Multiobject_MultiInstance_Tracking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252466843,"owners_count":21752448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T10:47:47.061Z","updated_at":"2025-05-05T08:32:23.107Z","avatar_url":"https://github.com/ajithvcoder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Object Tracking using YOLOv3, Deep Sort and Tensorflow\nThis repository implements YOLOv3 and Deep SORT in order to perfrom real-time object tracking. Yolov3 is an algorithm that uses deep convolutional neural networks to perform object detection. We can feed these object detections into Deep SORT (Simple Online and Realtime Tracking with a Deep Association Metric) in order for a real-time object tracker to be created.\n\n![Demo of Object Tracker](data/helpers/demo.gif)\n\n**NOTE:**\n\nFor better accuracy in objects train yolo in the dataset where you will be using . Example if your model is deployed in\nIndia and you want to track persons train on indian dataset so that yolo will be able to understand indian environment.\nFor faster speed and high accuracy train custom yolo only on few objects which you want . \nPretrained model is from coco dataset and it can detect 91 objects\n\nCredits :\n    [AIguy](https://github.com/theAIGuysCode)  and his \n    [YoutubeVideo](https://www.youtube.com/watch?v=Cf1INvUsvkM\u0026t=603s)\n\n\n## Getting started\n\n### Google colab\n```\nYou can train direcly on colab and watch video by transfering the result to google drive \n```\n[colabFileLink](./colab_custom_multiobject_multiInstance_tracking.ipynb)\n\n\n#### Conda (Recommended)\n\n```bash\n# Tensorflow CPU\nconda env create -f conda-cpu.yml\nconda activate tracker-cpu\n\n# Tensorflow GPU\nconda env create -f conda-gpu.yml\nconda activate tracker-gpu\n```\n\n#### Pip\n```bash\n# TensorFlow CPU\npip install -r requirements.txt\n\n# TensorFlow GPU\npip install -r requirements-gpu.txt\n```\n\n### Nvidia Driver (For GPU, if you haven't set it up already)\n```bash\n# Ubuntu 18.04\nsudo add-apt-repository ppa:graphics-drivers/ppa\nsudo apt install nvidia-driver-430\n# Windows/Other\nhttps://www.nvidia.com/Download/index.aspx\n```\n### Downloading official pretrained weights\nFor Linux: Let's download official yolov3 weights pretrained on COCO dataset. \n\n```\n# yolov3\nwget https://pjreddie.com/media/files/yolov3.weights -O weights/yolov3.weights\n\n# yolov3-tiny\nwget https://pjreddie.com/media/files/yolov3-tiny.weights -O weights/yolov3-tiny.weights\n```\nFor Windows:\nYou can download the yolov3 weights by clicking [here](https://pjreddie.com/media/files/yolov3.weights) and yolov3-tiny [here](https://pjreddie.com/media/files/yolov3-tiny.weights) then save them to the weights folder.\n\n### Using Custom trained weights\n\u003cstrong\u003e Learn How To Train Custom YOLOV3 Weights Here: https://www.youtube.com/watch?v=zJDUhGL26iU \u003c/strong\u003e\n\nAdd your custom weights file to weights folder and your custom .names file into data/labels folder.\n  \n### Saving your yolov3 weights as a TensorFlow model.\nLoad the weights using `load_weights.py` script. This will convert the yolov3 weights into TensorFlow .tf model files!\n\n```\n# yolov3\npython load_weights.py\n\n# yolov3-tiny\npython load_weights.py --weights ./weights/yolov3-tiny.weights --output ./weights/yolov3-tiny.tf --tiny\n\n# yolov3-custom (add --tiny flag if your custom weights were trained for tiny model)\npython load_weights.py --weights ./weights/\u003cYOUR CUSTOM WEIGHTS FILE\u003e --output ./weights/yolov3-custom.tf --num_classes \u003c# CLASSES\u003e\n```\n\nAfter executing one of the above lines, you should see proper .tf files in your weights folder. You are now ready to run object tracker.\n\n## Running the Object Tracker\nNow you can run the object tracker for whichever model you have created, pretrained, tiny, or custom.\n```\n# yolov3 on video\npython object_tracker.py --video ./data/video/test.mp4 --output ./data/video/results.avi\n\n#yolov3 on webcam \npython object_tracker.py --video 0 --output ./data/video/results.avi\n\n#yolov3-tiny \npython object_tracker.py --video ./data/video/test.mp4 --output ./data/video/results.avi --weights ./weights/yolov3-tiny.tf --tiny\n\n#yolov3-custom (add --tiny flag if your custom weights were trained for tiny model)\npython object_tracker.py --video ./data/video/test.mp4 --output ./data/video/results.avi --weights ./weights/yolov3-custom.tf --num_classes \u003c# CLASSES\u003e --classes ./data/labels/\u003cYOUR CUSTOM .names FILE\u003e\n```\nThe output flag saves your object tracker results as an avi file for you to watch back. It is not necessary to have the flag if you don't want to save the resulting video.\n\nThere is a test video uploaded in the data/video folder called test.mp4. If you followed all the steps properly with the pretrained coco yolov3.weights model then when your run the object tracker wiht the first command above you should see the following.\n#### Video Example\n![Demo of Object Tracker](data/helpers/demo.gif)\n\n\n\n## Command Line Args Reference\n```\nload_weights.py:\n  --output: path to output\n    (default: './weights/yolov3.tf')\n  --[no]tiny: yolov3 or yolov3-tiny\n    (default: 'false')\n  --weights: path to weights file\n    (default: './weights/yolov3.weights')\n  --num_classes: number of classes in the model\n    (default: '80')\n    (an integer)\n    \nobject_tracker.py:\n  --classes: path to classes file\n    (default: './data/labels/coco.names')\n  --video: path to input video (use 0 for webcam)\n    (default: './data/video/test.mp4')\n  --output: path to output video (remember to set right codec for given format. e.g. XVID for .avi)\n    (default: None)\n  --output_format: codec used in VideoWriter when saving video to file\n    (default: 'XVID)\n  --[no]tiny: yolov3 or yolov3-tiny\n    (default: 'false')\n  --weights: path to weights file\n    (default: './weights/yolov3.tf')\n  --num_classes: number of classes in the model\n    (default: '80')\n    (an integer)\n  --yolo_max_boxes: maximum number of detections at one time\n    (default: '100')\n    (an integer)\n  --yolo_iou_threshold: iou threshold for how close two boxes can be before they are detected as one box\n    (default: 0.5)\n    (a float)\n  --yolo_score_threshold: score threshold for confidence level in detection for detection to count\n    (default: 0.5)\n    (a float)\n```\n\n\n## Acknowledgments\n* [Yolov3 TensorFlow Amazing Implementation](https://github.com/zzh8829/yolov3-tf2)\n* [Deep SORT Repository](https://github.com/nwojke/deep_sort)\n* [Yolo v3 official paper](https://arxiv.org/abs/1804.02767)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajithvcoder%2Fcustom_multiobject_multiinstance_tracking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajithvcoder%2Fcustom_multiobject_multiinstance_tracking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajithvcoder%2Fcustom_multiobject_multiinstance_tracking/lists"}