An open API service indexing awesome lists of open source software.

https://github.com/recursivezero/tz-fabric

fabric AI tools for textile industry
https://github.com/recursivezero/tz-fabric

fabric fabric-ai india python textile threadzip tz-fabric

Last synced: 4 months ago
JSON representation

fabric AI tools for textile industry

Awesome Lists containing this project

README

          

# ๐Ÿงต Fabric Analyzer

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

๐Ÿš€ Features

```text
๐Ÿ–ผ 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

```text
React
Typescript
css

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

๐Ÿ› ๏ธ Tech Stack of Backend

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

๐Ÿ› ๏ธ Tech Stack of Databases

```text
-> MongoDB
```

๐Ÿ“ Folder Structure of Frontend

```text
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

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

๐Ÿ”„ API Flow

```text
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

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

๐Ÿ›‹๏ธ Backend

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

๐Ÿ›‹๏ธ Frontend

```sh

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

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

frontend/.env

```text
VITE_API_URL="http://localhost:8000"
```

๐Ÿ–ผ๏ธ Screenshots

### Homepage

![Homepage](/assets/screenshots/homepage.png)

---

### Analysis Page

![Analysis](/assets/screenshots/analysis-page.png)
![Analysis Feature](/assets/screenshots/analysis-feature.png)

---

### Upload Page

![Upload](/assets/screenshots/upload-page.png)
![UploadFeature](/assets/screenshots/upload-page-feature.png)

---

### List Page

![ListPage](/assets/screenshots/list-page.png)

---

### Search Page

![Search Page](/assets/screenshots/search-page.png)
![Search Crop Feature](/assets/screenshots/search-page-crop.png)
![Search Page Feature](/assets/screenshots/search-page-action.png)

---

### Chat Page

![Chat Page](/assets/screenshots/chat-page.png)
![Chat feature](/assets/screenshots/chat-page-feature.png)

## ๐Ÿ“„ License

This project is licensed under the terms of the [MIT License](https://github.com/recursivezero/tz-fabric/blob/main/LICENSE).