Update app.py
Browse files
app.py
CHANGED
@@ -49,8 +49,21 @@ async def try_on(
|
|
49 |
|
50 |
# Prepare headers and data for the original API
|
51 |
headers = {
|
52 |
-
"accept": "*/*"
|
|
|
53 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
# Call the ChangeClothesAI API
|
56 |
response = requests.post(CHANGE_CLOTHES_API, headers=headers, data=data)
|
|
|
49 |
|
50 |
# Prepare headers and data for the original API
|
51 |
headers = {
|
52 |
+
"accept": "*/*",
|
53 |
+
"content-type": "multipart/form-data; boundary=----WebKitFormBoundary90rchhPtvEuSQa34"
|
54 |
}
|
55 |
+
|
56 |
+
data = (
|
57 |
+
'------WebKitFormBoundary90rchhPtvEuSQa34\r\n'
|
58 |
+
f'Content-Disposition: form-data; name="humanImg"\r\n\r\n{human_url}\r\n'
|
59 |
+
'------WebKitFormBoundary90rchhPtvEuSQa34\r\n'
|
60 |
+
f'Content-Disposition: form-data; name="garment"\r\n\r\n{garment_url}\r\n'
|
61 |
+
'------WebKitFormBoundary90rchhPtvEuSQa34\r\n'
|
62 |
+
f'Content-Disposition: form-data; name="garmentDesc"\r\n\r\n{garment_desc}\r\n'
|
63 |
+
'------WebKitFormBoundary90rchhPtvEuSQa34\r\n'
|
64 |
+
f'Content-Disposition: form-data; name="category"\r\n\r\n{category}\r\n'
|
65 |
+
'------WebKitFormBoundary90rchhPtvEuSQa34--\r\n'
|
66 |
+
)
|
67 |
|
68 |
# Call the ChangeClothesAI API
|
69 |
response = requests.post(CHANGE_CLOTHES_API, headers=headers, data=data)
|