CoolFace
Apppublic

Boyun7/vision-language-chat-313831025

sourceHugging Faceapache-2.0updated 11mo agoView on Hugging Face
0likes
App README

๐Ÿค– 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

  1. 1.Upload an Image
  2. 2.Click the image upload area
  3. 3.Select an image from your device
  4. 4.Or try one of the auto-downloaded example images
  1. 1.Ask Questions
  2. 2.Type your question in the text box
  3. 3.Press Enter or click "Send ๐Ÿ“ค"
  4. 4.View the AI's response in the chat area
  1. 1.Continue the Conversation
  2. 2.Ask follow-up questions
  3. 3.Reference previous responses
  4. 4.Explore different aspects of the image
  1. 1.Manage Your Session
  2. 2.Clear Chat: Reset the conversation
  3. 3.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:

bash
# 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.py

The app will:

  1. 1.Download 3 example images (if not present)
  2. 2.Load SmolVLM-Instruct model (~500MB download first time)
  3. 3.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! ๐Ÿš€