This project is developed for Flickd Hackathon, a new-age fashion app that brings AI-powered fashion detection to your fingertips. The system enhances Flickd's capabilities by:
- Automatically detecting fashion items in user-uploaded videos
- Matching detected items with similar products from Flickd's catalog
- Analyzing fashion styles and vibes to provide personalized recommendations
- Enabling seamless product discovery and shopping experiences
Built with cutting-edge AI technologies, this system helps Flickd users discover fashion items they love, find similar products, and get style recommendations - all through the power of computer vision and natural language processing.
- Python 3.8+ β Core programming language
- YOLOv8 (Ultralytics) β State-of-the-art object detection
- OpenAI CLIP β Vision-language model for product matching
- FAISS β Efficient similarity search and indexing
- PyTorch β Deep learning framework
- OpenCV β Image and video processing
- Pandas β Data manipulation and analysis
- NumPy β Numerical computing
- scikit-learn β Machine learning utilities
- FastAPI β API development (for serving models)
- Jupyter Notebook β Experimentation and model training
- Matplotlib/Seaborn β Visualization (for analysis and plots)
- Requests β HTTP requests for image downloads
- jsonschema β Output validation
-
Video Processing
- Intelligent frame extraction
- High-performance video analysis
- Batch processing support
-
Fashion Detection
- YOLOv8-based object detection
- Multi-class fashion item recognition
- Real-time processing capabilities
-
Product Matching
- CLIP embeddings for semantic matching
- FAISS indexing for fast similarity search
- Smart caching system
-
Style Analysis
- Vibe classification
- Color analysis
- Style matching
- Python 3.8 or higher
- CUDA-capable GPU (recommended)
- Git
-
Clone the Repository
git clone https://github.com/adi-devv/Flickd-AI-Hackathon.git cd Flickd-AI-Hackathon -
Set Up Virtual Environment
# Create virtual environment python -m venv venv # Activate virtual environment # On Windows: venv\Scripts\activate # On Unix or MacOS: source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Download YOLOv8 Model
wget https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m.pt
Flickd/
βββ main.py # Main processing script
βββ data/
β βββ cache/
β β βββ cache_metadata.pkl
β β βββ faiss_index.bin
β β βββ product_info.pkl
β β βββ product_id_to_indices.pkl
β βββ product_data.csv
β βββ images.csv
βββ detected_frames/
β βββ detected_frame_*.jpg
βββ cropped_frames/
β βββ crop_frame_*_*.jpg
βββ frames/
β βββ frame_*.jpg
βββ outputs/
β βββ output_*.json
β βββ vibe_*.json
βββ models/
β βββ yolov8m.pt
βββ api/
β βββ app.py
βββ dataset/
β βββ fashion_dataset/
βββ requirements.txt
βββ data.yaml
βββ .gitignore
main.py: Core processing script that handles video analysis, object detection, and product matchingdata/: Contains all data-related files and cachescache/: Stores precomputed embeddings and indices for faster processingproduct_data.csv: Product catalog with details like type, description, and tagsimages.csv: Image URLs and metadata for product matching
detected_frames/: Contains frames with detection bounding boxescropped_frames/: Contains individual cropped fashion items from detected frames- Files are named as
crop_frame_[frame_number]_[item_class].jpg
- Files are named as
outputs/: JSON files containing detection results and style classificationsmodels/: Contains the YOLOv8 model weightsapi/: API implementation for serving the modeldataset/: Training and validation datasetsdata.yaml: Configuration file for model parameters and paths
python main.py \
--video_path path/to/video.mp4 \
--images_csv path/to/images.csv \
--product_data_csv path/to/products.csv \
--caption "Your video caption" \
--video_id "unique_id" \
--output_json_path path/to/output.json- Video File: MP4 format recommended
- Product Catalog: CSV files with required fields
- Optional: Vibe taxonomy for classification
The system generates:
-
Visual Outputs
- Detected frames with bounding boxes
- Annotated video frames
-
JSON Output
{ "detections": [ { "item": "dress", "confidence": 0.95, "matches": [...], "vibe": "casual" } ] }
-
Speed
- Fast frame processing
- Efficient similarity search
- Optimized caching
-
Accuracy
- High-precision detection
- Semantic matching
- Style classification
- Hardware: NVIDIA GTX 1650
- Training Time: 10.5 hours
- Epochs: 5
- Dataset: Colorful Fashion Dataset for Object Detection
- Used for training YOLOv8m model
- Contains diverse fashion items with annotations
Training metrics over epochs showing mAP, precision, recall, and loss
Confusion matrix showing model's classification performance
Precision-Recall curves for different confidence thresholds
Example validation batch showing model predictions
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.