sayedM commited on
Commit
522c94c
1 Parent(s): bdf434b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -17,6 +17,10 @@ if not api_key:
17
  # Define a function to call the API and get the results
18
  def get_results(image):
19
  threshold = 0.5
 
 
 
 
20
  # Convert the image to base64 string
21
  with io.BytesIO() as output:
22
  image.save(output, format="JPEG")
 
17
  # Define a function to call the API and get the results
18
  def get_results(image):
19
  threshold = 0.5
20
+
21
+ # Convert the NumPy array to PIL image
22
+ image = Image.fromarray(image)
23
+
24
  # Convert the image to base64 string
25
  with io.BytesIO() as output:
26
  image.save(output, format="JPEG")