{"id":24892771,"url":"https://github.com/lamaabdeldayem/object-tracking","last_synced_at":"2026-04-19T15:01:54.909Z","repository":{"id":267945216,"uuid":"858699594","full_name":"lamaabdeldayem/Object-Tracking","owner":"lamaabdeldayem","description":"Real-time object detection and tracking using YOLOv8 and OpenCV, with support for videos and webcams.","archived":false,"fork":false,"pushed_at":"2025-01-17T13:12:24.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T21:37:03.780Z","etag":null,"topics":["computer-vision","object-detection","object-tracking","opencv","real-time-detection","yolov8"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lamaabdeldayem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-09-17T11:34:34.000Z","updated_at":"2025-01-17T13:12:25.000Z","dependencies_parsed_at":"2025-07-29T20:42:26.093Z","dependency_job_id":"f1b70357-dadd-46dd-9803-95d9a2f4026d","html_url":"https://github.com/lamaabdeldayem/Object-Tracking","commit_stats":null,"previous_names":["lamaabdeldayem/object-tracking"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lamaabdeldayem/Object-Tracking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FObject-Tracking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FObject-Tracking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FObject-Tracking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FObject-Tracking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamaabdeldayem","download_url":"https://codeload.github.com/lamaabdeldayem/Object-Tracking/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FObject-Tracking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32010957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","object-detection","object-tracking","opencv","real-time-detection","yolov8"],"created_at":"2025-02-01T18:16:52.909Z","updated_at":"2026-04-19T15:01:54.890Z","avatar_url":"https://github.com/lamaabdeldayem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOLOv8 Object Detection and Tracking 🚀\n\nThis project demonstrates the use of the **YOLOv8 model** for **real-time object detection and tracking** in videos. It utilizes the **Ultralytics YOLOv8** model and **OpenCV** for video processing.\n\n---\n\n## 📝 Requirements\n\nBefore running the project, ensure that you have the following installed:\n\n- Python 3.7+\n- YOLOv8 (from `ultralytics`)\n- OpenCV\n\n### 📦 Install Dependencies\n\nInstall the necessary dependencies using `pip`:\n\n```bash\npip install ultralytics opencv-python\n```\n\n---\n\n## 🗂️ Project Structure\n\n1. **yolov8n.pt** – Pre-trained YOLOv8 model file.\n2. **test.mp4** – Sample video file for object detection and tracking (optional, can be replaced with your own video).\n3. **main.py** – Python script implementing object detection and tracking using YOLOv8 and OpenCV.\n\n---\n\n## 🚀 How to Run\n\n1. **Clone the repository** or download the project files to your local machine.\n\n2. Ensure you have the **YOLOv8 model weights** (`yolov8n.pt`) downloaded from the **Ultralytics YOLOv8 repository**, or use a different YOLOv8 model variant if needed.\n\n3. **Prepare a video or webcam input**:\n   - Replace the video path in the script with your video file, or use `0` for webcam input.\n\n4. **Run the script**:\n\n   ```bash\n   python main.py\n   ```\n\n   This will start processing the video, displaying the frames with object detection and tracking results. Press `q` to exit the video window.\n\n---\n\n## 🧑‍💻 Code Explanation\n\n### - Model Loading\n\nThe YOLOv8 model is loaded with the following line:\n\n```python\nmodel = YOLO('yolov8n.pt')\n```\n\nThis loads the pre-trained YOLOv8 model for object detection and tracking.\n\n### - Video Capture\n\nA video is loaded using OpenCV's `VideoCapture` function:\n\n```python\ncap = cv2.VideoCapture(video_path)\n```\n\n### - Object Detection \u0026 Tracking\n\nEach frame of the video is processed in a loop where the YOLOv8 model detects and tracks objects:\n\n```python\nresults = model.track(frame, persist=True)\n```\n\n### - Visualization\n\nThe results are visualized using OpenCV's `imshow` function, which displays the frames with bounding boxes and object labels:\n\n```python\ncv2.imshow('frame', frame_)\n```\n\n---\n\n## 🛠️ Key Features\n\n- **Object Detection**: Detects objects in each frame of the video.\n- **Object Tracking**: Tracks detected objects throughout the video.\n- **Real-time Visualization**: Displays the results on the screen with bounding boxes and labels.\n- **Customizable**: Easily replace the video input or use a webcam for real-time detection.\n\n---\n\n## ⚠️ Known Issues\n\n- When using a webcam, ensure that the correct camera is selected in the `cv2.VideoCapture()` function.\n- The performance of the model may vary depending on the hardware.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamaabdeldayem%2Fobject-tracking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamaabdeldayem%2Fobject-tracking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamaabdeldayem%2Fobject-tracking/lists"}