Spaces:
Sleeping
sdk: docker
from pathlib import Path
readme = """# YOLO and Qwen2 VL Microplastic Detection
A computer vision web application for detecting microplastic and waste related objects from images, video frames, and browser based inputs. The project combines a custom YOLO model for object detection with a Qwen2 VL vision language model for risk analysis and recommendations.
Project overview
This project uses two AI stages.
- YOLO detection
The YOLO model detects visible objects from the uploaded image or video frame. It returns object class, confidence score, bounding box, total count, and an annotated image.
- VLM analysis
The Qwen2 VL model receives the original image and YOLO detection results. It then generates a risk level, explanation, and practical recommendations for microplastic contamination analysis.
Main features
- Image based detection.
- Video frame based detection.
- YOLO object detection using a custom trained model.
- Qwen2 VL based image reasoning.
- Risk level prediction for environmental contamination.
- Detection count and object list.
- Flask based web interface.
- Docker ready Hugging Face Spaces deployment.
Technology stack
- Python
- Flask
- Ultralytics YOLO
- OpenCV
- PyTorch
- Transformers
- Qwen2 VL
- Docker
- Hugging Face Spaces
Project structure
CV Project Space
README.md
Dockerfile
.dockerignore
CV-Project
app.py
vlm_analyzer.py
requirements.txt
best.pt
templates
index.html
preprocess.py
model.py
merge.py
Inference.py
varification.py