Spaces:
Runtime error
Runtime error
lixiang46 commited on
Commit ·
3ea9ed2
1
Parent(s): 82b1749
test
Browse files16 unmodified lines171819202122235 unmodified lines2930313233343517 unmodified lines53545556575859606162636465666716 unmodified linesencoded_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']token = os.environ['token']cookie = os.environ['Cookie']headers = {'Content-Type': 'application/json', 'token': token, 'Cookie': cookie}5 unmodified linesresponse = requests.post(url, headers=headers, data=json.dumps(data))print("response code", response.status_code)print("response", 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;}#col-mid {margin: 0 auto;max-width: 350px;}#col-right {margin: 0 auto;max-width: 600px;}#button {color: blue;16 unmodified lines171819202122235 unmodified lines2930313233343517 unmodified lines53545556575859606162636465666716 unmodified linesencoded_garment_img = cv2.imencode('.jpg', garment_img)[1].tobytes()encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')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 linesresponse = requests.post(url, headers=headers, data=json.dumps(data))print("response code", response.status_code)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: 400px;}#col-mid {margin: 0 auto;max-width: 400px;}#col-right {margin: 0 auto;max-width: 580px;}#button {color: blue;
app.py+5-5