{"id":25504646,"url":"https://github.com/hediske/real-time-radar","last_synced_at":"2026-05-16T17:34:48.134Z","repository":{"id":277612777,"uuid":"932903558","full_name":"hediske/Real-Time-Radar","owner":"hediske","description":"Real Time Radar with car Tracking and Speed Estimation + support for live video streaming and video download","archived":false,"fork":false,"pushed_at":"2025-05-25T20:55:52.000Z","size":14472,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-15T06:10:56.883Z","etag":null,"topics":["bytetrack","cv2","homography-matrix","real-time","streamlit","supervision","yolov8","ytb-dl"],"latest_commit_sha":null,"homepage":"https://radar-app.streamlit.app/","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/hediske.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-14T18:27:41.000Z","updated_at":"2025-05-25T20:55:55.000Z","dependencies_parsed_at":"2025-02-14T23:24:51.292Z","dependency_job_id":"30f37c18-4ecc-4a84-8911-e771301655b5","html_url":"https://github.com/hediske/Real-Time-Radar","commit_stats":null,"previous_names":["hediske/real-time-radar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hediske/Real-Time-Radar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hediske%2FReal-Time-Radar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hediske%2FReal-Time-Radar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hediske%2FReal-Time-Radar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hediske%2FReal-Time-Radar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hediske","download_url":"https://codeload.github.com/hediske/Real-Time-Radar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hediske%2FReal-Time-Radar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bytetrack","cv2","homography-matrix","real-time","streamlit","supervision","yolov8","ytb-dl"],"created_at":"2025-02-19T05:55:54.908Z","updated_at":"2026-05-16T17:34:48.098Z","avatar_url":"https://github.com/hediske.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Live Video Streaming \u0026 Processing\n\n## Overview\n\nThis project enables real-time streaming, processing, and annotation of live video feeds from YouTube. The system extracts video metadata, captures frames, and applies object detection and tracking, with optional speed estimation.\n\n## Features\n\n- **Live Video Streaming:** Uses yt-dlp and OpenCV to fetch and process video streams even from live youtube streams.\n- **Frame Processing:** Captures frames in real-time, detects objects, and applies annotations.\n- **Object Tracking \u0026 Speed Estimation:** Utilizes ByteTrack for multi-object tracking and estimates speed using homography transformations.\n- **Queue-Based Frame Management:** Ensures smooth processing with thread-safe queue handling.\n- **Preview and Source Points Selection:** Guides the user to choose the space where the detection will take place.\n- **Robust Failure Handling:** Implements retry mechanisms for stream stability.\n- **Web Interface:** Provides a real-time dashboard for video visualization and monitoring.\n- **Command-Line Interface (CLI):** Enables control of the streaming and processing pipeline through terminal commands.\n\n## Installation\n\n### Prerequisites\n\nEnsure you have the following installed:\n\n- Python 3.8+\n- yt-dlp for YouTube video extraction\n- OpenCV for image processing\n- supervision for annotation and tracking\n- numpy for numerical operations\n- Streamlit for web interface (optional)\n\n### Install Dependencies\n\n```bash\npip install -r \"requirements.txt\"\n```\n## Demo\n### Video Selection and Processor creation\n![image](static/demo1.gif)\n\n### Preparing Source Poitns And Target For Homography Transformations.\n![image](static/demo2.gif)\n\n### Video Process And Speed Estimation\n![image](static/demo3.gif)\n\n### Download Video Once Process is Complete\n![image](static/demo4.gif)\n\n\n## Explanation\n- The **left image** represents a real-world road scene with a camera capturing at an angle.\n- The **center matrix** applies a transformation using OpenCV.\n- The **right image** shows the **top-down view**, which is useful for radar-based vehicle tracking.\n![Maths](static/maths.png)\n\n\n\n## Usage\n\n### Extract Video Stream Information\n\n```python\nfrom live_capturing import get_stream_infos\n\ninfo = get_stream_infos(\"https://www.youtube.com/watch?v=example\")\nprint(info)\n```\n\n### Start Live Capture\n\n```python\nfrom live_capturing import LiveCapture\n\nstream = LiveCapture(\"https://www.youtube.com/watch?v=example\").start()\n```\n\n### Process Video with Object Detection\n\n```python\nfrom process_video import process_video\n\nprocess_video(\n    type=\"live\",\n    input=\"https://www.youtube.com/watch?v=example\",\n    model=\"yolov8n-640\",\n    iou=0.3,\n    confidence=0.3,\n    display=True\n)\n```\n\n## Web Interface\n\nThe system includes a web-based dashboard for monitoring and controlling live streams. It allows the user to create a VideoProcessor and choose video source , the target and the source infos and then process the file .\n\n### Features\n- **Dynamically change the processor parameters**\n- **Dynamically select the source points by clicking on the image**\n- **Process a video and download it once finished**\n\n\nTo start the web interface, run:\n\n```bash\nstreamlit run app.py\n```\n\nThen access the dashboard at `http://localhost:8501`.\n\n## Line Commands\n\nYou can use the Commands to manage streams and process the videos. \n\n### Available Commands:\n\n- **Video Previewing:**\nIt provides a command-line interface for video frame processing. The\n    available modes are 'preview' and 'test_source'. \n    - The 'preview' mode displays a\n    single frame from the given video source (local or live). \n    - The 'test_source'\n    mode displays a frame with the source points drawn as circles and a connecting\n    polygon.\n    ```\n    python preview.py preview --url ./data/vehicles.mp4\n    python preview.py test_source --url ./data/vehicles.mp4 --source 229 115 351 115 920 370 -150 370\n    ```\n\n- **Video Processing:**\n    Process a video (local or live) using the specified parameters.\n    Args:\n    - type (str, mandatory): Type of video, either 'local' or 'live'.\n    - input (str, mandatory): Path to the video file (for local) or YouTube URL (for live).\n    - output (str, optional): Path to save the output video. Defaults to None.\n    - source (list, optional): Source polygon coordinates. Defaults to None.\n    - target (list, optional): Target polygon coordinates. Defaults to None.\n    - model (str, optional): Model type for inference. Defaults to \"yolov8x-640\".\n    - iou (float, optional): IoU threshold for detection. Defaults to 0.3.\n    - confidence (float, optional): Confidence threshold for detection. Defaults to 0.3.\n    - display (bool, optional): Whether to display the video during processing. Defaults to False.\n\n    ```\n    #Local Video Example\n      python main.py local  './data/vehicles.mp4' --output './data/result.mp4'  --iou 0.7 --confidence=0.3 --source 229 115 351 115 920 370 -150 370 --target 0 0 24 0 24 249 0 249 --display\n    #Real Time Live Video\n      python main.py live  'https://www.youtube.com/watch?v=5_XSYlAfJZM)' --output './data/result.mp4' --display\n    ```\n\n## Architecture\n\n- **Stream Extraction:** Uses yt-dlp to fetch live video URLs.\n- **Frame Capture:** Uses cv2.VideoCapture to extract frames from the stream.\n- **Processing Pipeline:**\n  - Object detection via YOLOv8.\n  - Non-Maximum Suppression (NMS) for overlapping detections.\n  - Object tracking using ByteTrack.\n  - Speed estimation using homography transformation.\n- **Queue-Based Streaming:** Frames are added to a queue for sequential processing.\n\n## Configuration\n\nYou can configure key parameters in `video_processor.py`:\n\n```python\nconfidence = 0.3  # Minimum confidence threshold for object detection\niou_threshold = 0.3  # Intersection over Union threshold for merging detections\nmodel_path = \"yolov8n-640\"  # Model Type for the detections\n```\n\n## Error Handling\n\n- If a stream fails, the system retries up to `max_failures` times.\n- If buffering is full, old frames are dropped to maintain real-time processing.\n\n## Future Enhancements\n\n- **Multi-Stream Processing:** Support for multiple live streams simultaneously.\n- **Edge Deployment:** Optimize for deployment on edge devices.\n- **Enhanced Web Interface:** Additional real-time statistics and user controls.\n\n## License\n\nMIT License\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhediske%2Freal-time-radar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhediske%2Freal-time-radar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhediske%2Freal-time-radar/lists"}