Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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")
|