Boyun7/vision-language-chat-313831025
๐ค Vision-Language Chat Assistant
๐ Live Demo: https://huggingface.co/spaces/Boyun7/vision-language-chat-313831025
Course: Data Science - Assignment 3 Student ID: 313831025 Model: SmolVLM-Instruct (256M parameters)
๐ Project Overview
A sophisticated web-based conversational AI application that enables natural, multi-turn dialogue about images using SmolVLM-Instruct, an ultra-lightweight Vision-Language model optimized for CPU inference.
โจ Key Features
- ๐ฃ๏ธ Multi-turn Conversation - Engage in natural back-and-forth dialogue about images
- ๐ฏ Context-Aware - Maintains conversation history for coherent responses
- ๐ Detailed Analysis - Deep understanding of image content, objects, and scenes
- โก CPU Optimized - Fast inference with only 256M parameters
- ๐พ Export Capability - Save conversation history for future reference
- ๐ธ Auto-download Examples - Automatically downloads free test images from Unsplash
๐๏ธ Architecture
Technology Stack
Frontend: Gradio 5.49.1 (Interactive Web UI)
Backend: Python 3.10
Model: SmolVLM-Instruct (256M parameters)
Framework: PyTorch + Transformers
Deployment: HuggingFace Spaces (CPU)Model Details
SmolVLM-Instruct by HuggingFace
- Size: 256M parameters (ultra-lightweight!)
- Optimization: Designed for CPU inference
- Speed: Fast response times even on CPU
- Capabilities:
- Image understanding
- Multi-turn conversation
- Object detection and description
- Scene analysis
๐ก Usage Guide
Basic Usage
- Upload an Image
- Click the image upload area
- Select an image from your device
- Or try one of the auto-downloaded example images
- Ask Questions
- Type your question in the text box
- Press Enter or click "Send ๐ค"
- View the AI's response in the chat area
- Continue the Conversation
- Ask follow-up questions
- Reference previous responses
- Explore different aspects of the image
- Manage Your Session
- Clear Chat: Reset the conversation
- Export Chat: Save conversation history
Example Questions
General Understanding:
- "What objects can you see in this image?"
- "Describe the scene in detail."
- "What is happening in this image?"
Specific Details:
- "What colors are dominant in this image?"
- "How many people are in this image?"
- "What's the weather like in this scene?"
๐ Running Locally
If you want to run this locally:
# Clone the repository
git clone https://huggingface.co/spaces/Boyun7/vision-language-chat-313831025
cd vision-language-chat-313831025
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.pyThe app will:
- Download 3 example images (if not present)
- Load SmolVLM-Instruct model (~500MB download first time)
- Launch the web interface at http://localhost:7860
๐ Performance
Model Specs:
- Parameters: 256M (ultra-lightweight)
- Download Size: ~500MB
- Memory Usage: ~2GB RAM
- Inference Speed: 1-3 seconds per query (CPU)
- First Load: ~30 seconds
Hardware Requirements:
- CPU: Any modern CPU (no GPU needed!)
- RAM: 4GB minimum, 8GB recommended
- Storage: 1GB for model cache
๐ Assignment Details
Course: Data Science Assignment: HW3 - Vision Language AI Student ID: 313831025 Submission Date: 2025-11-09
Features Implemented:
- โ Web UI with Gradio
- โ Vision-Language AI (SmolVLM-Instruct)
- โ Multi-turn conversation
- โ Auto-download example images
- โ Context-aware responses
- โ Chat export functionality
- โ CPU optimized for accessibility
๐ Technical Notes
Why SmolVLM-Instruct?
- Ultra-lightweight (256M parameters)
- Optimized for CPU inference
- Fast response times
- Good balance of size and capability
- Perfect for educational demos
- Accessible without GPU
Auto-download Images:
- Images from Unsplash.com (free license)
- Downloads on first run
- Cached for subsequent runs
๐ง Contact
Student ID: 313831025 Project: Vision-Language Chat Assistant Model: SmolVLM-Instruct by HuggingFace
๐ License
- Code: Apache 2.0
- SmolVLM-Instruct: Apache 2.0 (HuggingFace)
- Example Images: Unsplash License
Enjoy exploring images with AI! ๐
