{"id":15625864,"url":"https://github.com/rizwanmunawar/yolov7-object-tracking","last_synced_at":"2025-05-15T07:04:53.588Z","repository":{"id":57684097,"uuid":"527216979","full_name":"RizwanMunawar/yolov7-object-tracking","owner":"RizwanMunawar","description":"YOLOv7 Object Tracking Using PyTorch, OpenCV and Sort Tracking","archived":false,"fork":false,"pushed_at":"2025-03-22T09:53:47.000Z","size":203,"stargazers_count":599,"open_issues_count":9,"forks_count":175,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-14T11:11:21.545Z","etag":null,"topics":["computer-vision","deep-learning","object-detection","opencv-python","tracking-algorithm","yolov7"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RizwanMunawar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"muhammadrizwanm","thanks_dev":null,"custom":null}},"created_at":"2022-08-21T13:38:05.000Z","updated_at":"2025-04-10T11:47:14.000Z","dependencies_parsed_at":"2024-01-14T12:18:14.693Z","dependency_job_id":"ad86293f-73a2-4268-ab73-69638c964174","html_url":"https://github.com/RizwanMunawar/yolov7-object-tracking","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RizwanMunawar%2Fyolov7-object-tracking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RizwanMunawar%2Fyolov7-object-tracking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RizwanMunawar%2Fyolov7-object-tracking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RizwanMunawar%2Fyolov7-object-tracking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RizwanMunawar","download_url":"https://codeload.github.com/RizwanMunawar/yolov7-object-tracking/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292039,"owners_count":22046426,"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":["computer-vision","deep-learning","object-detection","opencv-python","tracking-algorithm","yolov7"],"created_at":"2024-10-03T10:07:00.464Z","updated_at":"2025-05-15T07:04:48.576Z","avatar_url":"https://github.com/RizwanMunawar.png","language":"Python","funding_links":["https://buymeacoffee.com/muhammadrizwanm"],"categories":[],"sub_categories":[],"readme":"## YOLOv7 Object Tracking 🚀\n\n\u003ca href=\"https://colab.research.google.com/drive/1xrB76UQ_LaVaBAxfTi8-a9dIcazmxD5b?usp=sharing\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"\u003e\u003c/a\u003e\n\n### How to Run the Code\n\n1. Clone the repository:\n   \n    ```bash\n    git clone https://github.com/RizwanMunawar/yolov7-object-tracking.git\n    ```\n3. Navigate to the cloned folder:\n    ```bash\n    cd yolov7-object-tracking\n    ```\n\n4. Create a virtual environment (Recommended to avoid conflicts):\n\n    For Anaconda:\n    ```bash\n    conda create -n yolov7objtracking python=3.10\n    conda activate yolov7objtracking\n    ```\n\n    For Linux:\n    ```bash\n    python3 -m venv yolov7objtracking\n    source yolov7objtracking/bin/activate\n    ```\n\n    For Windows:\n    ```bash\n    python3 -m venv yolov7objtracking\n    cd yolov7objtracking/Scripts\n    activate\n    ```\n\n5. Update pip and install dependencies:\n    ```bash\n    pip install --upgrade pip\n    pip install -r requirements.txt\n    ```\n\n6. Run the script:\n\n    Select the appropriate command based on your requirements. Pretrained [yolov7](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt) weights will be downloaded automatically if needed.\n\n    - Detection only:\n      ```bash\n      python detect.py --weights yolov7.pt --source \"your video.mp4\"\n      ```\n\n    - Object tracking:\n      ```bash\n      python detect_and_track.py --weights yolov7.pt --source \"your video.mp4\"\n      ```\n\n    - Webcam:\n      ```bash\n      python detect_and_track.py --weights yolov7.pt --source 0\n      ```\n\n    - External Camera:\n      ```bash\n      python detect_and_track.py --weights yolov7.pt --source 1\n      ```\n\n    - IP Camera Stream:\n      ```bash\n      python detect_and_track.py --source \"your IP Camera Stream URL\" --device 0\n      ```\n\n    - Specific class tracking (e.g., person):\n      ```bash\n      python detect_and_track.py --weights yolov7.pt --source \"your video.mp4\" --classes 0\n      ```\n\n    - Colored tracks:\n      ```bash\n      python detect_and_track.py --weights yolov7.pt --source \"your video.mp4\" --colored-trk\n      ```\n\n    - Save track centroids, IDs, and bounding box coordinates:\n      ```bash\n      python detect_and_track.py --weights yolov7.pt --source \"your video.mp4\" --save-txt --save-bbox-dim\n      ```\n\n7. **Output files** will be saved in `working-dir/runs/detect/obj-tracking` with the original filename.\n\n### Results 📊\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eYOLOv7 Detection Only\u003c/td\u003e\n    \u003ctd\u003eYOLOv7 Object Tracking with ID\u003c/td\u003e\n    \u003ctd\u003eYOLOv7 Object Tracking with ID and Label\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/62513924/196107891-bb8124de-99c6-4039-b556-2ade403bd985.png\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/62513924/185798283-0455ce49-4359-4e52-8d69-fd30dd61c5b4.png\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/62513924/191241661-ed5b87eb-5c8c-49bc-8301-531ee86f3b38.png\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### References\n\n- [YOLOv7 GitHub](https://github.com/WongKinYiu/yolov7)\n- [SORT GitHub](https://github.com/abewley/sort)\n\n**Some of my articles/research papers | computer vision awesome resources for learning | How do I appear to the world? 🚀**\n\n[Ultralytics YOLO11: Object Detection and Instance Segmentation🤯](https://muhammadrizwanmunawar.medium.com/ultralytics-yolo11-object-detection-and-instance-segmentation-88ef0239a811) ![Published Date](https://img.shields.io/badge/published_Date-2024--10--27-brightgreen)\n\n[Parking Management using Ultralytics YOLO11](https://muhammadrizwanmunawar.medium.com/parking-management-using-ultralytics-yolo11-fba4c6bc62bc) ![Published Date](https://img.shields.io/badge/published_Date-2024--11--10-brightgreen)\n\n[My 🖐️Computer Vision Hobby Projects that Yielded Earnings](https://muhammadrizwanmunawar.medium.com/my-️computer-vision-hobby-projects-that-yielded-earnings-7923c9b9eead) ![Published Date](https://img.shields.io/badge/published_Date-2023--09--10-brightgreen)\n\n[Best Resources to Learn Computer Vision](https://muhammadrizwanmunawar.medium.com/best-resources-to-learn-computer-vision-311352ed0833) ![Published Date](https://img.shields.io/badge/published_Date-2023--06--30-brightgreen)\n\n[Roadmap for Computer Vision Engineer](https://medium.com/augmented-startups/roadmap-for-computer-vision-engineer-45167b94518c)  ![Published Date](https://img.shields.io/badge/published_Date-2022--08--07-brightgreen)\n\n[How did I spend 2022 in the Computer Vision Field](https://www.linkedin.com/pulse/how-did-i-spend-2022-computer-vision-field-muhammad-rizwan-munawar) ![Published Date](https://img.shields.io/badge/published_Date-2022--12--20-brightgreen)\n\n[Domain Feature Mapping with YOLOv7 for Automated Edge-Based Pallet Racking Inspections](https://www.mdpi.com/1424-8220/22/18/6927) ![Published Date](https://img.shields.io/badge/published_Date-2022--09--13-brightgreen)\n\n[Exudate Regeneration for Automated Exudate Detection in Retinal Fundus Images](https://ieeexplore.ieee.org/document/9885192) ![Published Date](https://img.shields.io/badge/published_Date-2022--09--12-brightgreen)\n\n[Feature Mapping for Rice Leaf Defect Detection Based on a Custom Convolutional Architecture](https://www.mdpi.com/2304-8158/11/23/3914) ![Published Date](https://img.shields.io/badge/published_Date-2022--12--04-brightgreen)\n\n[Yolov5, Yolo-x, Yolo-r, Yolov7 Performance Comparison: A Survey](https://aircconline.com/csit/papers/vol12/csit121602.pdf)  ![Published Date](https://img.shields.io/badge/published_Date-2022--09--24-brightgreen)\n\n[Explainable AI in Drug Sensitivity Prediction on Cancer Cell Lines](https://ieeexplore.ieee.org/document/9922931)  ![Published Date](https://img.shields.io/badge/published_Date-2022--09--23-brightgreen)\n\n[Train YOLOv8 on Custom Data](https://medium.com/augmented-startups/train-yolov8-on-custom-data-6d28cd348262)  ![Published Date](https://img.shields.io/badge/published_Date-2022--09--23-brightgreen)\n\n[Session with Ultralytics Team about Computer Vision Journey](https://www.ultralytics.com/blog/becoming-a-computer-vision-engineer)  ![Published Date](https://img.shields.io/badge/published_Date-2022--11--15-brightgreen)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizwanmunawar%2Fyolov7-object-tracking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frizwanmunawar%2Fyolov7-object-tracking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizwanmunawar%2Fyolov7-object-tracking/lists"}