This Flask server is a crucial component of the Trend-Centric Recommendation App. It handles user requests related to body measurements and color palette generation based on the user's skin color. The server is designed to integrate seamlessly with the machine learning models used in the app.
- Method: POST
- Description: This endpoint receives user body measurements and processes them to provide size recommendations for different apparel.
- Request Body:
{ "bust": "<value>", "upper_hip": "<value>", "hip": "<value>", "waist": "<value>" }
- Response:
{ "upper_body_size": "<recommended size>", "lower_body_size": "<recommended size>" }
- Method: POST
- Description: This endpoint takes the user's skin color and generates a complementary color palette using the Gemini-1.5-Flash model.
- Request Body:
{ "skin_color": "<hex code or RGB value>" }
- Response:
{ "color_palette": [ "<color1>", "<color2>", "<color3>", ] }
- Clone the repository:
git clone [https://github.com/Akangkha/prototype_server]
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Start the server:
flask run
-
Start the server: Ensure the server is running by executing the start command in the terminal.
flask run
-
Send a POST request to
/measurements
:-
Use tools like Postman or curl to send a POST request with the required body measurements.
curl -X POST http://localhost:5000/measurements \ -H "Content-Type: application/json" \ -d '{"bust": 34, "upper_hip": 36, "hip": 38, "waist": 30}'
-
-
Send a POST request to
/generate_palette
:- Use tools like Postman or curl to send a POST request with the user's skin color.