crazyai-kby commited on
Commit
49716b1
·
1 Parent(s): a2e72c5
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -16,15 +16,17 @@ def run(file):
16
 
17
  backend_url = os.getenv('BACKEND_URL')
18
  url = f'{backend_url}/raster-to-vector-base64'
19
- payload = {'image': base64_img}
20
- image_request = requests.post(url, json=payload)
21
-
22
- out_img = image_request.json()['image']
23
- out_json = image_request.json()['graph']
24
-
25
- decode_img = base64.b64decode(out_img.split(',')[1])
26
- decode_img = np.frombuffer(decode_img, dtype=np.uint8)
27
- out_img = cv2.imdecode(decode_img, flags=cv2.IMREAD_COLOR)
 
 
28
 
29
  return out_img, out_json
30
 
 
16
 
17
  backend_url = os.getenv('BACKEND_URL')
18
  url = f'{backend_url}/raster-to-vector-base64'
19
+ out_json = {'json': url}
20
+ out_img = in_image
21
+ # payload = {'image': base64_img}
22
+ # image_request = requests.post(url, json=payload)
23
+ #
24
+ # out_img = image_request.json()['image']
25
+ # out_json = image_request.json()['graph']
26
+ #
27
+ # decode_img = base64.b64decode(out_img.split(',')[1])
28
+ # decode_img = np.frombuffer(decode_img, dtype=np.uint8)
29
+ # out_img = cv2.imdecode(decode_img, flags=cv2.IMREAD_COLOR)
30
 
31
  return out_img, out_json
32