yihong1120 / Construction-Hazard-Detection

Enhances construction site safety using YOLO for object detection, identifying hazards like workers without helmets or safety vests, and proximity to machinery or vehicles. HDBSCAN clusters safety cone coordinates to create monitored zones. Post-processing algorithms improve detection accuracy.
https://changdar-server.mooo.com/camera.html?label=Koahsiung&key=test
GNU Affero General Public License v3.0
229 stars 25 forks source link

Feature streaming from youtube videos #12

Closed yihong1120 closed 7 months ago

codeautopilot[bot] commented 7 months ago

PR summary

The Pull Request introduces a feature for streaming from YouTube videos. It includes changes to the Dockerfile, the addition of a docker-compose.yml file, modifications to the run_server.sh script, and updates to the src/stream_capture.py file to improve frame capture from streams.

The Dockerfile has been updated to install system dependencies like gcc and g++, and the exposed port has been changed from 80 to 8000 and 8001 for the Gunicorn servers. The CMD directive has been updated to serve as a placeholder since docker-compose will be used to run the container.

A new docker-compose.yml file has been added to define services for a MySQL database, a model server, a stream web application, and the main application. It sets up the necessary environment variables, ports, volumes, and dependencies between services.

The run_server.sh script has been modified to start the Gunicorn server for the Model API and the Stream Web app, with a sleep interval to ensure proper startup.

In src/stream_capture.py, the capture_frames and capture_youtube_frames methods have been updated to reduce latency by setting the buffer size to 1 and to manage frame rate by skipping frames.

Suggestion