yuragoithf commited on
Commit
9b9f35d
·
1 Parent(s): 2342ece

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -26,12 +26,10 @@ def rb(img):
26
  img.save(img_byte_arr, format='JPEG', subsampling=0, quality=100)
27
  # converts image array to bytesarray
28
  img_byte_arr = img_byte_arr.getvalue()
29
-
30
- # response = requests.post(API_URL, headers=headers, data=bytes(img.tobytes("raw")))
31
  response = requests.post(API_URL, headers=headers, data=img_byte_arr)
32
  return response.json()
33
 
34
 
35
  inputs = gr.inputs.Image(type="pil", label="Upload an image")
36
- demo = gr.Interface(fn=rb, inputs=inputs, outputs=[inputs, "json"])
37
  demo.launch()
 
26
  img.save(img_byte_arr, format='JPEG', subsampling=0, quality=100)
27
  # converts image array to bytesarray
28
  img_byte_arr = img_byte_arr.getvalue()
 
 
29
  response = requests.post(API_URL, headers=headers, data=img_byte_arr)
30
  return response.json()
31
 
32
 
33
  inputs = gr.inputs.Image(type="pil", label="Upload an image")
34
+ demo = gr.Interface(fn=rb, inputs=inputs, outputs="json")
35
  demo.launch()