Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Project: Visual Analysis Suite

🤖 Visual Imagery Playground: “An interactive Streamlit application powered by Vision Language Models.”


🚀 This project provides a powerful, interactive web UI for multimodal visual analysis, capable of understanding and interpreting images based on natural language prompts.

🖼️ The Suite features a flexible dual-model backend, allowing users to switch between the powerful llava-hf/llava-1.5-7b-hf and deepseek-ai/deepseek-vl-7b-base models mid-session.

⚙️ Both models are loaded using 4-bit quantization via the bitsandbytes library, making it possible to run large 7-billion parameter models in resource-constrained environments.


🗂️ Project Structure


📁 Visual_Analysis_Suite/
├── app.py                         # Application entry point (runs the Streamlit app)
├── config.py                      # Central configuration for models and page settings
├── requirements.txt               
└── README.md                      
|
├── 📁 core/                        
│   ├── model_loader.py            # Handles dynamic loading and caching of models
│   └── inference.py               # Runs model-specific inference and performance tracking
│
├── 📁 ui/                         
│   ├── sidebar.py                 # Renders the sidebar for controls and settings
│   └── views.py                   # Renders the main interaction tabs and views
│
├── 📁 utils/                      
│   ├── session.py                 # Manages session state import/export
│   ├── helpers.py                 # Contains helper functions 
│   └── prompting.py               # Logic for creating model-specific prompts
│
├── 📁 data/                        
│   └── visual_suite_session.json  # An exported session file
│
└── 📁 assets/                     

⚙️ Features & Parameters


🤖 Model & Generation Parameters

  • Model Selection — Instantly switch between Llava-1.5 and DeepSeek-VL in the sidebar.
  • System Prompt — Customize the base instructions given to the model to alter its persona and response style.
  • Max New Tokens — Control the maximum length of the generated response.
  • Temperature — Adjust the randomness of the output; lower values are more deterministic, higher are more creative.
  • Top-p (Nucleus Sampling) — Controls the diversity of the vocabulary used in the response.
  • Repetition Penalty — Penalizes the model for repeating words or phrases, encouraging more varied output.

🎨 Interaction Modes

  • Conversational Chat — Engage in a dynamic, multi-turn conversation about a single image.
  • Deep Analysis — Use a toolkit of pre-defined prompts for specific tasks like object detection, scene description, or creative writing.
  • Image Comparison — Upload two images side-by-side and ask comparative questions.
  • Session Management — Export and import your entire session, including images and chat history, to a JSON file.

🔬 Performance & Diagnostics

The Engine Room tab provides a look "under the hood" at the last model inference run.

Metric Description Location
Inference Time The total wall-clock time taken for the model to generate a response. Engine Room
Tokens/Second The speed of token generation, a key measure of performance. Engine Room
Full Prompt The exact, formatted prompt string sent to the model for analysis. Engine Room
Raw Model Output The complete, unparsed output from the model before formatting. Engine Room



🚀 Getting Started


📋 1. Prerequisites

Before you begin, ensure you have the following essential tools installed on your system.

  • Python 3.11+: The core programming language.
  • Git: For cloning the repository.
  • pip and venv: Standard Python package and environment managers.
  • (Recommended) An NVIDIA GPU with CUDA installed to leverage 4-bit quantization.

⚙️ 2. Installation & Setup

This step-by-step guide will set up the entire project environment. Open your terminal or command prompt and execute the following commands.

1. Clone the Repository

First, clone this repository to your local machine.

git clone https://github.com/Sairaj213/Visual_Analysis_Suite.git

2. Navigate to the Project Directory

Change into the newly created folder.

cd visual_analysis_suite

3. Create and Activate a Virtual Environment

This isolates the project's dependencies from your system-wide Python installation.

  • On Windows:
    python -m venv venv
    venv\Scripts\activate
  • On macOS / Linux:
    python3 -m venv venv
    source venv/bin/activate 
    (Your terminal prompt should now be prefixed with (venv))

4. Install Required Dependencies

⚠️ Please!!, Install torch and packaging, setuptools, wheel, ninja package before installing requirements.txt.

pip install torch
pip install packaging setuptools wheel ninja

This command reads the requirements.txt file and installs all necessary libraries into your virtual environment.

pip install -r requirements.txt

🛰️ 3. Launch the Application!

With the setup complete, you are now ready to launch the Visual Analysis Suite.

streamlit run app.py

Your default web browser will automatically open a new tab with the application running. The first time you select a model, it will be downloaded and cached, which may take a few minutes.

📷 Sample Images


The README.md looks way better in Visual Studio Code

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages