chemistrymath commited on
Commit
900ed64
Β·
verified Β·
1 Parent(s): 01b0eeb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +132 -124
README.md CHANGED
@@ -1,124 +1,132 @@
1
- <<<<<<< HEAD
2
- # AI-Powered Body Measurement & Apparel Sizing
3
-
4
- This project is a **FastAPI-based AI system** that predicts **body measurements** and recommends **clothing sizes** using deep learning. It processes **front and side images**, removes backgrounds, and utilizes a trained **Keras model** for accurate predictions.
5
-
6
- ---
7
-
8
- ## πŸ“Œ Features
9
- βœ… AI-powered **body measurement estimation** using images.
10
- βœ… Automatic **background removal** for clean image processing.
11
- βœ… Deep learning-based **predictions** using a trained model.
12
- βœ… **FastAPI integration** for quick and efficient API responses.
13
-
14
- ---
15
-
16
-
17
- ## πŸš€ Installation
18
-
19
- To set up the project, follow these steps:
20
-
21
- ### **1️⃣ Clone the Repository**
22
- ```bash
23
- git clone https://github.com/CloozyBrands/AI-BodyMeasurement.git
24
- ```
25
- ---
26
- ### **2️⃣ Install Dependencies**
27
- ```bash
28
- pip install -r requirements.txt
29
- ```
30
-
31
- ### **3️⃣ Run the FastAPI Server**
32
- ```bash
33
- uvicorn app.main:app --reload
34
- ```
35
- Then open **http://127.0.0.1:8000/docs** to test the API.
36
-
37
- ---
38
-
39
- ## πŸ› οΈ How It Works
40
-
41
- ### **1️⃣ Upload Images**
42
- - The API accepts **two images**:
43
- - **Front view**
44
- - **Side view**
45
-
46
- ### **2️⃣ AI-Based Processing**
47
- - The images are processed using **`single_person_processor.py`**, which:
48
- βœ… Removes the background using `rembg`.
49
- βœ… Converts the images into a **model-compatible format**.
50
- βœ… Predicts **body measurements** like chest, waist, and height.
51
-
52
- ### **3️⃣ Clothing Size Prediction**
53
- - Based on the body measurements, the system suggests a **T-shirt and pants size** using predefined **size charts**.
54
-
55
- ---
56
-
57
- ## πŸ” API Endpoints
58
-
59
- ### **1️⃣ `/predict/` (POST) - Predict Body Measurements**
60
- πŸ“Œ **Example Request:**
61
- ```http
62
- POST /predict/
63
- ```
64
-
65
- πŸ“Œ **Request Parameters:**
66
- | Parameter | Type | Description |
67
- |---------------|--------|-------------|
68
- | `front_image` | File | Front view image (JPEG/PNG) |
69
- | `side_image` | File | Side view image (JPEG/PNG) |
70
- | `input_data` | JSON | User data (height, weight, gender) |
71
-
72
- πŸ“Œ **Example JSON Payload:**
73
- ```json
74
- {
75
- "gender": 0,
76
- "height_cm": 175,
77
- "weight_kg": 70,
78
- "apparel_type": "all"
79
- }
80
- ```
81
-
82
- πŸ“Œ **Example Response:**
83
- ```json
84
- {
85
- "results": {
86
- "body_measurements": {
87
- "chest": 100.5,
88
- "waist": 80.2,
89
- "hip": 97.3
90
- },
91
- "tshirt_size": "L",
92
- "pants_size": 34
93
- }
94
- }
95
- ```
96
-
97
- ---
98
-
99
- ## 🎯 Model & AI Processing
100
-
101
- πŸ“Œ The model used in this project is a **TensorFlow/Keras** model stored as `best_model.keras`.
102
- πŸ“Œ The AI processing is handled inside **`single_person_processor.py`**, which:
103
- - Loads the trained model using `tf.keras.models.load_model`.
104
- - Extracts measurements based on input images.
105
- - Maps the measurements to standard clothing sizes.
106
-
107
- ---
108
-
109
- ## πŸ“œ License
110
-
111
- This project is licensed under the **MIT License** – feel free to modify and use it.
112
-
113
- ---
114
-
115
- ## 🀝 Contributing
116
-
117
- 1. Fork the repository
118
- 2. Create a new branch
119
- 3. Make your changes
120
- 4. Submit a pull request
121
-
122
- We welcome contributions and improvements! πŸš€
123
- ```
124
- >>>>>>> 4e80050 (FastAPI model for size recommendation)
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: FastAPI Model
3
+ sdk: docker
4
+ emoji: πŸš€
5
+ colorFrom: blue
6
+ colorTo: purple
7
+ pinned: false
8
+ ---
9
+ <<<<<<< HEAD
10
+ # AI-Powered Body Measurement & Apparel Sizing
11
+
12
+ This project is a **FastAPI-based AI system** that predicts **body measurements** and recommends **clothing sizes** using deep learning. It processes **front and side images**, removes backgrounds, and utilizes a trained **Keras model** for accurate predictions.
13
+
14
+ ---
15
+
16
+ ## πŸ“Œ Features
17
+ βœ… AI-powered **body measurement estimation** using images.
18
+ βœ… Automatic **background removal** for clean image processing.
19
+ βœ… Deep learning-based **predictions** using a trained model.
20
+ βœ… **FastAPI integration** for quick and efficient API responses.
21
+
22
+ ---
23
+
24
+
25
+ ## πŸš€ Installation
26
+
27
+ To set up the project, follow these steps:
28
+
29
+ ### **1️⃣ Clone the Repository**
30
+ ```bash
31
+ git clone https://github.com/CloozyBrands/AI-BodyMeasurement.git
32
+ ```
33
+ ---
34
+ ### **2️⃣ Install Dependencies**
35
+ ```bash
36
+ pip install -r requirements.txt
37
+ ```
38
+
39
+ ### **3️⃣ Run the FastAPI Server**
40
+ ```bash
41
+ uvicorn app.main:app --reload
42
+ ```
43
+ Then open **http://127.0.0.1:8000/docs** to test the API.
44
+
45
+ ---
46
+
47
+ ## πŸ› οΈ How It Works
48
+
49
+ ### **1️⃣ Upload Images**
50
+ - The API accepts **two images**:
51
+ - **Front view**
52
+ - **Side view**
53
+
54
+ ### **2️⃣ AI-Based Processing**
55
+ - The images are processed using **`single_person_processor.py`**, which:
56
+ βœ… Removes the background using `rembg`.
57
+ βœ… Converts the images into a **model-compatible format**.
58
+ βœ… Predicts **body measurements** like chest, waist, and height.
59
+
60
+ ### **3️⃣ Clothing Size Prediction**
61
+ - Based on the body measurements, the system suggests a **T-shirt and pants size** using predefined **size charts**.
62
+
63
+ ---
64
+
65
+ ## πŸ” API Endpoints
66
+
67
+ ### **1️⃣ `/predict/` (POST) - Predict Body Measurements**
68
+ πŸ“Œ **Example Request:**
69
+ ```http
70
+ POST /predict/
71
+ ```
72
+
73
+ πŸ“Œ **Request Parameters:**
74
+ | Parameter | Type | Description |
75
+ |---------------|--------|-------------|
76
+ | `front_image` | File | Front view image (JPEG/PNG) |
77
+ | `side_image` | File | Side view image (JPEG/PNG) |
78
+ | `input_data` | JSON | User data (height, weight, gender) |
79
+
80
+ πŸ“Œ **Example JSON Payload:**
81
+ ```json
82
+ {
83
+ "gender": 0,
84
+ "height_cm": 175,
85
+ "weight_kg": 70,
86
+ "apparel_type": "all"
87
+ }
88
+ ```
89
+
90
+ πŸ“Œ **Example Response:**
91
+ ```json
92
+ {
93
+ "results": {
94
+ "body_measurements": {
95
+ "chest": 100.5,
96
+ "waist": 80.2,
97
+ "hip": 97.3
98
+ },
99
+ "tshirt_size": "L",
100
+ "pants_size": 34
101
+ }
102
+ }
103
+ ```
104
+
105
+ ---
106
+
107
+ ## 🎯 Model & AI Processing
108
+
109
+ πŸ“Œ The model used in this project is a **TensorFlow/Keras** model stored as `best_model.keras`.
110
+ πŸ“Œ The AI processing is handled inside **`single_person_processor.py`**, which:
111
+ - Loads the trained model using `tf.keras.models.load_model`.
112
+ - Extracts measurements based on input images.
113
+ - Maps the measurements to standard clothing sizes.
114
+
115
+ ---
116
+
117
+ ## πŸ“œ License
118
+
119
+ This project is licensed under the **MIT License** – feel free to modify and use it.
120
+
121
+ ---
122
+
123
+ ## 🀝 Contributing
124
+
125
+ 1. Fork the repository
126
+ 2. Create a new branch
127
+ 3. Make your changes
128
+ 4. Submit a pull request
129
+
130
+ We welcome contributions and improvements! πŸš€
131
+ ```
132
+ >>>>>>> 4e80050 (FastAPI model for size recommendation)