Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ def predict(image):
|
|
| 11 |
# For simplicity, let's assume the model can handle raw image input
|
| 12 |
# If not, you will need to convert the image to a compatible format (base64 or upload to a server)
|
| 13 |
|
| 14 |
-
image_bytes = image.
|
| 15 |
|
| 16 |
# If you need to convert the image to base64 (if model requires it)
|
| 17 |
import base64
|
|
@@ -23,6 +23,7 @@ def predict(image):
|
|
| 23 |
return response.json()
|
| 24 |
|
| 25 |
# Create the Gradio interface with an image input
|
| 26 |
-
iface = gr.Interface(fn=predict, inputs=gr.Image(type="
|
| 27 |
iface.launch()
|
| 28 |
|
|
|
|
|
|
| 11 |
# For simplicity, let's assume the model can handle raw image input
|
| 12 |
# If not, you will need to convert the image to a compatible format (base64 or upload to a server)
|
| 13 |
|
| 14 |
+
image_bytes = image.tobytes() # Convert PIL image to bytes (this might require adjustment)
|
| 15 |
|
| 16 |
# If you need to convert the image to base64 (if model requires it)
|
| 17 |
import base64
|
|
|
|
| 23 |
return response.json()
|
| 24 |
|
| 25 |
# Create the Gradio interface with an image input
|
| 26 |
+
iface = gr.Interface(fn=predict, inputs=gr.Image(type="pil"), outputs="json")
|
| 27 |
iface.launch()
|
| 28 |
|
| 29 |
+
|