{"id":24576137,"url":"https://github.com/raj-tyagi/smart-surveillance-system","last_synced_at":"2026-05-18T22:07:31.510Z","repository":{"id":270258480,"uuid":"909782565","full_name":"raj-tyagi/Smart-Surveillance-System","owner":"raj-tyagi","description":"Smart Surveillance System combines YOLOv4 detection and optical flow tracking to monitor objects in video streams, supporting local files and YouTube links with real-time visualization.","archived":false,"fork":false,"pushed_at":"2025-02-02T11:28:25.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T12:27:32.900Z","etag":null,"topics":["computer-vision","deep-learning","machine-learning-automation","object-detection","opencv","optical-flow","python","smart-surveillance","tracking-security-monitoring","video-processing","yolov4"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raj-tyagi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-29T18:57:18.000Z","updated_at":"2025-02-02T11:28:29.000Z","dependencies_parsed_at":"2024-12-29T20:27:54.122Z","dependency_job_id":null,"html_url":"https://github.com/raj-tyagi/Smart-Surveillance-System","commit_stats":null,"previous_names":["raj-tyagi/smart-surveillance-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj-tyagi%2FSmart-Surveillance-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj-tyagi%2FSmart-Surveillance-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj-tyagi%2FSmart-Surveillance-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj-tyagi%2FSmart-Surveillance-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raj-tyagi","download_url":"https://codeload.github.com/raj-tyagi/Smart-Surveillance-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244036260,"owners_count":20387483,"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","machine-learning-automation","object-detection","opencv","optical-flow","python","smart-surveillance","tracking-security-monitoring","video-processing","yolov4"],"created_at":"2025-01-23T22:21:48.551Z","updated_at":"2026-05-18T22:07:31.442Z","avatar_url":"https://github.com/raj-tyagi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Surveillance System  \nA robust video processing application that combines **YOLO object detection** with **Lucas-Kanade optical flow-based tracking** to monitor and analyze video streams for smart surveillance.\n \n---\n\n## Features  \n- **Object Detection**: Utilizes YOLOv4 for real-time detection of objects in video frames.   \n- **Object Tracking**: Tracks detected objects using Lucas-Kanade Optical Flow, ensuring smooth monitoring across frames.  \n- **Input Flexibility**: Supports video files and YouTube URLs for seamless integration.  \n- **Output Video**: Saves processed video with tracked objects as `output_video.avi`.  \n- **Interactive Display**: Visualizes object detection and tracking in each frame during processing.\n\n---\n\n## Getting Started  \n\n### Prerequisites  \nEnsure the following libraries are installed:  \n- `opencv-python`\n- `numpy`\n- `pytube` (for handling YouTube videos)  \n\nInstall dependencies using pip:  \n```bash  \npip install opencv-python numpy pytube  \n```  \n\n### Files Required  \n1. **YOLO Files**:  \n   - `yolov4.weights` (pre-trained weights)  \n   - `yolov4.cfg` (YOLO configuration file)  \n   - `coco.names` (class labels from the COCO dataset)  \n\n---\n\n## Usage  \n\n1. Clone the repository:  \n   ```bash  \n   git clone https://github.com/your-username/smart-surveillance.git  \n   cd smart-surveillance  \n   ```  \n\n2. Run the script:  \n   ```bash  \n   python smart_surveillance.py  \n   ```  \n\n3. Choose input mode:  \n   - **Option 1**: Upload a video from your local device.  \n   - **Option 2**: Provide a YouTube video URL.  \n\n---\n\n## How It Works  \n\n1. **Detection Phase**:  \n   - Detects objects in video frames using YOLOv4.  \n   - Applies Non-Maximum Suppression (NMS) to eliminate redundant detections.  \n\n2. **Tracking Phase**:  \n   - Tracks detected objects across frames using Lucas-Kanade Optical Flow.  \n   - Updates object positions dynamically and removes failed trackers.  \n\n3. **Visualization**:  \n   - Draws bounding boxes, labels, and key points for detected and tracked objects.  \n\n4. **Output**:  \n   - Saves the processed video as `output_video.avi`.  \n\n---\n\n### Example Input and Output Videos\n\n#### Input Video\n[Click to view input video](https://drive.google.com/file/d/17vTtRMgAsXipdB2jxjRcHFYVhIHr5pYa/view?usp=sharing)\n\n#### Output Video\n[Click to view output video](https://drive.google.com/file/d/1fraAjRt2pFT4yWGjf5X55UhJihzfb68Y/view?usp=sharing)\n\n\n## Project Structure  \n\n```plaintext  \n|-- smart_surveillance.py     # Main script  \n|-- yolov4.weights            # YOLOv4 weights  \n|-- yolov4.cfg                # YOLOv4 configuration file  \n|-- coco.names                # COCO class labels  \n```  \n\n---\n\n## Future Enhancements  \n\n- Support for **real-time processing** via live camera feeds.  \n- Integration of advanced object tracking algorithms (e.g., DeepSORT).  \n- Transition to **YOLOv8** for improved detection speed and accuracy.  \n- User-friendly GUI for better interaction.  \n\n---\n\n## License  \nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Acknowledgments  \n\n- [YOLO](https://pjreddie.com/darknet/yolo/) for the object detection framework.  \n- OpenCV for computer vision tools and functions.  \n- [PyTube](https://pytube.io/en/latest/) for handling YouTube video downloads.  \n\nFeel free to contribute by submitting pull requests or issues! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraj-tyagi%2Fsmart-surveillance-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraj-tyagi%2Fsmart-surveillance-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraj-tyagi%2Fsmart-surveillance-system/lists"}