Visual AI for Product Condition Assessment & Human-like Reporting
Upload product images, let BLIP-2 understand the item, generate human-like condition reports with Phi-4, and enjoy the magic of zero-shot image-to-text reasoning. Also⦠there's a secret mini-game.
- Features
- Banner
- Project Structure
- Installation Guide
- Hardware & GPU Setup
- Bonus: Tic-Tac-Toe AI
- Technology Stack
- GitHub Topics
- License
- Contact
- AI Product Recognition β Detects object type: Watch, Shoe, Phone, etc.
- Material Identification β Metal, Leather, Glass, Suede? We got it.
- Visual Condition Tags β Custom per-item labels (like βscratched glassβ or βtorn strapβ).
- Score Calculation β Evaluates product damage level and assigns a 4β10 score.
- Natural Language Report β Uses Phi-4 LLM to describe condition in ~50 human-like words.
- Frontend Upload UI β Drag, drop, analyze.
Item-Inspector AI/
βββ backend/
β βββ app.py # This FastAPI file
β βββ requirements.txt
β βββ python_gpu_test.py # Check if TensorFlow, pytorch & numpy runs on GPU
βββ frontend/
β βββ index.html # Web UI for uploading images
βββ sample_images/
β βββ example_watch.jpg # Example test image
βββ just_for_fun/
β βββ tic_tac_toe.py # Tic-Tac-Toe AI game
βββ README.md
- Python 3.10+ (recommended Python 3.10.11 for GPU usage on windows)
- GitHub Desktop or Git CLI
- Ollama installed & phi4(phi4:14b-q4_K_M) model downloaded
git clone https://github.com/Rooshikesh/Item-Inspector-AI.git
cd Item-Inspector-AI/backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
ollama run phi4:14b-q4_K_M
uvicorn app:app --reload
Go to: http://127.0.0.1:8000/docs
Open frontend/index.html in your browser. Drag and drop product images.
If you're planning to run BLIP-2 on GPU for maximum performance, keep the following in mind:
- NVIDIA GPU with at least 8β12GB VRAM
- Recommended: RTX 3060 or higher
- CUDA-compatible drivers installed
- Check GPU visibility with:
nvidia-smi
- Check GPU visibility with:
- Python: Version 3.10+
- Install PyTorch with CUDA support:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
- Our code already includes:
This ensures your models run on GPU if available.
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") torch_dtype=torch.float16
- Make sure BLIP-2 loads with:
device_map="auto", torch_dtype=torch.float16
- Images are correctly converted to RGB before inference:
img = Image.open(file.file).convert("RGB")
Run the included python_gpu_test.py
file to confirm if TensorFlow, PyTorch, and NumPy are GPU-ready:
cd backend
python python_gpu_test.py
This script will print the detected GPUs, framework versions, and whether each is using the GPU or CPU.
When you need a break from debugging and BLIP-2 hallucinations:
cd just_for_fun
python tic_tac_toe.py
- Supports easy, medium, and hard mode
- Uses Minimax algorithm in Hard mode to destroy your confidence π₯
- BLIP-2 (Salesforce) - Vision Language
- Phi-4 (Ollama) - Language Generation
- FastAPI - Backend Framework
- HTML/JS - Minimal Frontend
- Hugging Face Transformers
- PyTorch
ai, blip2, phi4, fastapi, transformers, computer-vision, image-classification, product-inspection, natural-language-generation, multimodal-ai, semantic-analysis, ecommerce-ai, repairtech, humanlike-ai, condition-scoring, pytorch, webapi, backend, frontend, python
MIT β use it, share it, modify it. Just donβt forget to smile when it works.
Rooshikesh Bhatt rooshikeshbhatt@gmail.com