This project demonstrates how to perform object detection on video frames using the google/paligemma-3b-mix-224 model. The script processes an input video, detects objects specified in a prompt, and draws bounding boxes around detected objects in the output video.
-
Clone the repository:
git clone https://github.com/your-username/video-object-detection.git cd video-object-detection -
Create and activate a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate -
Install the required packages:
pip install -r requirements.txt
-
Log in to Hugging Face:
!huggingface-cli login
-
Place your input video file in the project directory and name it
input_video.mp4. You can also change the input video filename in the script if needed. -
Run the script:
python video_object_detection.py
-
The processed video with bounding boxes will be saved as
output_video.avi.
video-object-detection
input_video.mp4 # Input video file
output_video.avi # Output video file (generated)
video_object_detection.py# Main script for object detection
requirements.txt # List of dependencies
README.md # Project README file