root commited on
Commit
df47c13
1 Parent(s): 7ae8f0e

fixed sr bug

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -115,6 +115,8 @@ def request_images(raw_text, class_draw, style_draw, batch_size, sr_option, w, h
115
  url = "http://flagart.baai.ac.cn/api/guohua/"
116
 
117
  d = {"data":[raw_text, int(batch_size), sr_option, w, h, seed]}
 
 
118
  r = requests.post(url, json=d, headers={"Content-Type": "application/json", "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"})
119
  result_text = r.text
120
  content = json.loads(result_text)["data"][0]
@@ -137,6 +139,7 @@ def sr_request_images(img_str, idx, w, h, seed):
137
  image_data = img_str[idx]
138
  # print(image_data)
139
  d = {"data":[image_data, 0, False, w, h, seed]} # batch_size设置为0,sr_opt设置为False, 新加了3个参数w,h,seed,随便放就行,进去不会走这个路
 
140
  url = "http://flagart.baai.ac.cn/api/general/"
141
  r = requests.post(url, json=d, headers={"Content-Type": "application/json", "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"})
142
  result_text = r.text
 
115
  url = "http://flagart.baai.ac.cn/api/guohua/"
116
 
117
  d = {"data":[raw_text, int(batch_size), sr_option, w, h, seed]}
118
+ print('+++++++++right here+++++++')
119
+ print(w,h,seed)
120
  r = requests.post(url, json=d, headers={"Content-Type": "application/json", "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"})
121
  result_text = r.text
122
  content = json.loads(result_text)["data"][0]
 
139
  image_data = img_str[idx]
140
  # print(image_data)
141
  d = {"data":[image_data, 0, False, w, h, seed]} # batch_size设置为0,sr_opt设置为False, 新加了3个参数w,h,seed,随便放就行,进去不会走这个路
142
+ print(w,h,seed)
143
  url = "http://flagart.baai.ac.cn/api/general/"
144
  r = requests.post(url, json=d, headers={"Content-Type": "application/json", "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"})
145
  result_text = r.text