147 lines
3.2 KiB
Markdown
147 lines
3.2 KiB
Markdown
# Open-Vocabulary Object Detection
|
|
|
|
## 1. Project Overview
|
|
|
|
This project implements an Open-Vocabulary Object Detection application using two pretrained models:
|
|
|
|
- Grounding DINO
|
|
- YOLO-World
|
|
|
|
The application allows users to detect objects in images and videos using custom text prompts without requiring task-specific model training.
|
|
|
|
## 2. Features
|
|
|
|
- Image-based object detection
|
|
- Video-based object detection
|
|
- Custom text prompts
|
|
- Bounding box visualization
|
|
- Confidence score display
|
|
- Object counting by category
|
|
- Comparison between Grounding DINO and YOLO-World
|
|
- CPU, RAM, GPU and VRAM monitoring
|
|
- Annotated image and video outputs
|
|
|
|
## 3. Technologies Used
|
|
|
|
- Python
|
|
- PyTorch
|
|
- Grounding DINO
|
|
- YOLO-World
|
|
- Ultralytics
|
|
- OpenCV
|
|
- Streamlit
|
|
- Transformers
|
|
- NumPy
|
|
- Pandas
|
|
- Pillow
|
|
- Matplotlib
|
|
- psutil
|
|
|
|
## 4. Hardware Requirements
|
|
|
|
The application was developed and tested on a Linux-based system with an NVIDIA GPU.
|
|
|
|
Recommended requirements:
|
|
|
|
- NVIDIA GPU with CUDA support
|
|
- 8 GB or more system RAM
|
|
- Python 3.10 or later
|
|
- Linux operating system
|
|
- Internet connection for initial model downloads
|
|
|
|
Actual performance depends on hardware specifications and model configuration.
|
|
|
|
## 5. Installation
|
|
|
|
Clone or copy the project folder to your system.
|
|
|
|
Open a terminal inside the project directory.
|
|
|
|
Create a virtual environment:
|
|
|
|
```bash
|
|
python3 -m venv venv
|
|
```
|
|
|
|
Activate it:
|
|
|
|
```bash
|
|
source venv/bin/activate
|
|
```
|
|
|
|
Install dependencies:
|
|
|
|
```bash
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
## 6. Running the Application
|
|
|
|
Start the application using:
|
|
|
|
```bash
|
|
streamlit run app.py
|
|
```
|
|
|
|
The application will open in your web browser.
|
|
|
|
## 7. How to Use
|
|
|
|
1. Open the application.
|
|
2. Select image or video input.
|
|
3. Upload the required file.
|
|
4. Select the detection model.
|
|
5. Enter the object names as text prompts.
|
|
6. Set the confidence threshold.
|
|
7. Run detection.
|
|
8. View the annotated output and detection results.
|
|
9. Save the output for further analysis.
|
|
|
|
## 8. Model Comparison
|
|
|
|
The project evaluates Grounding DINO and YOLO-World based on:
|
|
|
|
- Inference time
|
|
- Processing FPS
|
|
- Detection count
|
|
- Category detection performance
|
|
- CPU utilization
|
|
- RAM consumption
|
|
- GPU utilization
|
|
- VRAM consumption
|
|
|
|
Experimental measurements are stored in CSV files.
|
|
|
|
## 9. Project Structure
|
|
|
|
```text
|
|
OpenVocabularyDetection/
|
|
├── app.py
|
|
├── monitor.py
|
|
├── requirements.txt
|
|
├── README.md
|
|
├── benchmark.csv
|
|
├── category_results.csv
|
|
├── video_result.csv
|
|
├── test_images/
|
|
├── category_test_images/
|
|
├── outputs/
|
|
│ ├── grounding_dino/
|
|
│ └── yolo_world/
|
|
└── reports/
|
|
```
|
|
|
|
## 10. Limitations
|
|
|
|
- Detection performance depends on the selected text prompt and confidence threshold.
|
|
- Detection results may vary depending on image quality and lighting conditions.
|
|
- Processing speed depends on available hardware.
|
|
- Formal precision, recall and mAP evaluation requires ground-truth annotations.
|
|
|
|
## 11. Conclusion
|
|
|
|
This project demonstrates the use of pretrained open-vocabulary object detection models for detecting objects in images and videos using natural-language prompts.
|
|
|
|
Grounding DINO and YOLO-World were experimentally compared in terms of detection performance, inference speed and hardware resource consumption.
|