Spaces:
Runtime error
Runtime error
lixiang46
commited on
Commit
•
19b9e9b
1
Parent(s):
f6e997e
update
Browse files
app.py
CHANGED
@@ -27,11 +27,9 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
|
|
27 |
"humanImage": encoded_person_img,
|
28 |
"seed": seed
|
29 |
}
|
30 |
-
# print(url, token, cookie, encoded_garment_imgm, encoded_person_img)
|
31 |
|
32 |
response = requests.post(url, headers=headers, data=json.dumps(data))
|
33 |
print("response code", response.status_code)
|
34 |
-
print("response", response, type(response))
|
35 |
if response.status_code == 200:
|
36 |
result = response.json()['result']
|
37 |
print("result", result)
|
@@ -41,8 +39,6 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
|
|
41 |
result_np = np.frombuffer(result, np.uint8)
|
42 |
result_img = cv2.imdecode(result_np, cv2.IMREAD_UNCHANGED)
|
43 |
|
44 |
-
# result_img = cv2.imdecode(np.frombuffer(base64.b64decode(encoded_person_img), np.uint8), cv2.IMREAD_UNCHANGED)
|
45 |
-
|
46 |
return result_img, seed
|
47 |
|
48 |
MAX_SEED = 999999
|
@@ -66,7 +62,7 @@ css="""
|
|
66 |
}
|
67 |
#col-right {
|
68 |
margin: 0 auto;
|
69 |
-
max-width:
|
70 |
}
|
71 |
#button {
|
72 |
color: blue;
|
|
|
27 |
"humanImage": encoded_person_img,
|
28 |
"seed": seed
|
29 |
}
|
|
|
30 |
|
31 |
response = requests.post(url, headers=headers, data=json.dumps(data))
|
32 |
print("response code", response.status_code)
|
|
|
33 |
if response.status_code == 200:
|
34 |
result = response.json()['result']
|
35 |
print("result", result)
|
|
|
39 |
result_np = np.frombuffer(result, np.uint8)
|
40 |
result_img = cv2.imdecode(result_np, cv2.IMREAD_UNCHANGED)
|
41 |
|
|
|
|
|
42 |
return result_img, seed
|
43 |
|
44 |
MAX_SEED = 999999
|
|
|
62 |
}
|
63 |
#col-right {
|
64 |
margin: 0 auto;
|
65 |
+
max-width: 550px;
|
66 |
}
|
67 |
#button {
|
68 |
color: blue;
|