Skip to content

recursivezero/tz-fabric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🧡 Fabric Analyzer

Fabric Analyzer is an AI-powered web application that analyzes fabric 
images to provide insightful textual descriptions.

πŸš€ Features

πŸ–Ό  Upload your own fabric images or use curated sample images
πŸ” Choose between **Short** or **Long** analysis
πŸ€– Powered by Google Gemini Vision API for detailed AI responses
🧠 Response caching for fast navigation (Prev/Next)
βœ… Validates whether uploaded image is a proper fabric image
🧭 Drawer and navigation UI for enhanced experience
πŸ“€ Upload and record of fabric images and related audios
πŸ”Ž Search Similar images through a query
πŸ€– An agentic chatbot for fabric queries and task

πŸ› οΈ Tech Stack of Frontend

React
Typescript
css

Prerequisites to use react
->Node.js(v16 or later)
->npm(comes with the node)

πŸ› οΈ Tech Stack of Backend

Fastapi
google-generative(gemini-api)
Langchain agents
MCP
Groq
Pillow
base64

πŸ› οΈ Tech Stack of Databases

-> MongoDB

πŸ“ Folder Structure of Frontend

frontend/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ 20250312_224758__10_45_28_PM.jpeg
β”‚   β”œβ”€β”€ 20250323_093907__10_24_31_PM.jpeg
β”‚   β”œβ”€β”€ 20250323_094209__10_22_53_PM.jpeg
β”‚   β”œβ”€β”€ Gemini_Generated_Image_9m5wh59m5wh59m5w.png
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ manifest.json
β”‚   β”œβ”€β”€ robots.txt
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ Pages/
β”‚   β”œβ”€β”€ Services/
β”‚   β”œβ”€β”€ utils/                       
β”‚   β”œβ”€β”€ services/                    
β”‚
β”œβ”€β”€ App.css                     
β”œβ”€β”€ App.js
β”œβ”€β”€ App.test.js
β”œβ”€β”€ index.css                    
β”œβ”€β”€ index.js
β”œβ”€β”€ logo.svg
β”œβ”€β”€ reportWebVitals.js
β”œβ”€β”€ setupTests.js
β”‚

πŸ“ Folder Structure of Backend

backend/
β”œβ”€β”€ main.py
β”œβ”€β”€ cli.py
β”œβ”€β”€ LICENSE-PYTHON
β”œβ”€β”€ .env
β”œβ”€β”€ agent/
β”œβ”€β”€ core/
β”œβ”€β”€ routes/
β”œβ”€β”€ services/
β”œβ”€β”€ static/
β”œβ”€β”€ templates/
β”œβ”€β”€ tools/
β”œβ”€β”€ utils/
β”œβ”€β”€ pyproject.toml/
β”œβ”€β”€ README.md/

πŸ”„ API Flow

POST /api/validate-image β€” Validates if uploaded image is a fabric
POST /api/analyze-image β€” Runs Gemini analysis (short or long)
POST /api/regenerate β€” Regenerates response set for same image + mode
POST /api/chat - chatbot
GET  /api/assets/images/{filename} - for getting the images
GET  /api/assets/audios/{filename} - for getting the audios
GET  /api/media/content - for listing the uploaded media
POST /api/search - for searching the similar images
POST /api/submit - for uploading the media
POST /api/uploads/tmp_media - for storing the media in chat 

How to start

Clone the repo

git clone https://github.com/recursivezero/tz-fabric.git
cd tz-fabric

πŸ›‹οΈ Backend

cd backend
curl -sSL https://install.python-poetry.org | python3 -
poetry install - to install all the dependencies
poetry run dev

πŸ›‹οΈ Frontend

cd frontend
npm install  -> to download the node modules
npm install axios -> for backend integration
npm install react-icons // if react-icons is not installed
npm run dev

Sample .env

backend/.env

PORT=8000
GEMINI_API_KEY=""
GRQ_API_KEY=""
MONGODB_URI="mongodb://localhost:27017"

frontend/.env

VITE_API_URL="http://localhost:8000"

πŸ–ΌοΈ Screenshots

Homepage

Homepage


Analysis Page

Analysis Analysis Feature


Upload Page

Upload UploadFeature


List Page

ListPage


Search Page

Search Page Search Crop Feature Search Page Feature


Chat Page

Chat Page Chat feature

πŸ“„ License

This project is licensed under the terms of the MIT License.

About

fabric AI tools for textile industry

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors 3

  •  
  •  
  •