lixiang46 commited on
Commit
3ea9ed2
1 Parent(s): 82b1749
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -17,7 +17,7 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
17
  encoded_garment_img = cv2.imencode('.jpg', garment_img)[1].tobytes()
18
  encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')
19
 
20
- url = "http://" + os.environ['tryon_url']
21
  token = os.environ['token']
22
  cookie = os.environ['Cookie']
23
  headers = {'Content-Type': 'application/json', 'token': token, 'Cookie': cookie}
@@ -29,7 +29,7 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
29
 
30
  response = requests.post(url, headers=headers, data=json.dumps(data))
31
  print("response code", response.status_code)
32
- print("response", response)
33
  if response.status_code == 200:
34
  result = response.json()
35
  result = base64.b64decode(result['images'][0])
@@ -53,15 +53,15 @@ human_list_path = [os.path.join(example_path,"human",human) for human in human_l
53
  css="""
54
  #col-left {
55
  margin: 0 auto;
56
- max-width: 350px;
57
  }
58
  #col-mid {
59
  margin: 0 auto;
60
- max-width: 350px;
61
  }
62
  #col-right {
63
  margin: 0 auto;
64
- max-width: 600px;
65
  }
66
  #button {
67
  color: blue;
 
17
  encoded_garment_img = cv2.imencode('.jpg', garment_img)[1].tobytes()
18
  encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')
19
 
20
+ url = "https://" + os.environ['tryon_url']
21
  token = os.environ['token']
22
  cookie = os.environ['Cookie']
23
  headers = {'Content-Type': 'application/json', 'token': token, 'Cookie': cookie}
 
29
 
30
  response = requests.post(url, headers=headers, data=json.dumps(data))
31
  print("response code", response.status_code)
32
+ print("response", response, type(response))
33
  if response.status_code == 200:
34
  result = response.json()
35
  result = base64.b64decode(result['images'][0])
 
53
  css="""
54
  #col-left {
55
  margin: 0 auto;
56
+ max-width: 400px;
57
  }
58
  #col-mid {
59
  margin: 0 auto;
60
+ max-width: 400px;
61
  }
62
  #col-right {
63
  margin: 0 auto;
64
+ max-width: 580px;
65
  }
66
  #button {
67
  color: blue;