Spaces:
Runtime error
Runtime error
lixiang46 commited on
Commit ·
3ea9ed2
1
Parent(s): 82b1749
test
Browse files16 unmodified lines17181920202122235 unmodified lines293031323233343517 unmodified lines53545556565758596060616263646465666716 unmodified lines encoded_garment_img = cv2.imencode('.jpg', garment_img)[1].tobytes() encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')
url = "http://" + os.environ['tryon_url'] url = "https://" + os.environ['tryon_url'] token = os.environ['token'] cookie = os.environ['Cookie'] headers = {'Content-Type': 'application/json', 'token': token, 'Cookie': cookie}5 unmodified lines
response = requests.post(url, headers=headers, data=json.dumps(data)) print("response code", response.status_code) print("response", response) print("response", response, type(response)) if response.status_code == 200: result = response.json() result = base64.b64decode(result['images'][0])17 unmodified linescss="""#col-left { margin: 0 auto; max-width: 350px; max-width: 400px;}#col-mid { margin: 0 auto; max-width: 350px; max-width: 400px;}#col-right { margin: 0 auto; max-width: 600px; max-width: 580px;}#button { color: blue;app.py+5-5