Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ feature_extractor = None
|
|
| 20 |
|
| 21 |
# Inference function
|
| 22 |
@spaces.GPU()
|
| 23 |
-
def run_inference(image,
|
| 24 |
# Load image from the Gradio input
|
| 25 |
input_image = Image.fromarray(image.astype('uint8'), 'RGB')
|
| 26 |
|
|
@@ -63,7 +63,7 @@ def run_inference(image, feature_extractor, model, device, valid_ds):
|
|
| 63 |
|
| 64 |
# Create a Gradio interface
|
| 65 |
iface = gr.Interface(
|
| 66 |
-
fn=lambda image: run_inference(image,
|
| 67 |
inputs=gr.inputs.Image(type="numpy"), # Input is an image
|
| 68 |
outputs="text", # Output is text (predicted class)
|
| 69 |
title="Image Classification",
|
|
|
|
| 20 |
|
| 21 |
# Inference function
|
| 22 |
@spaces.GPU()
|
| 23 |
+
def run_inference(image, device, valid_ds):
|
| 24 |
# Load image from the Gradio input
|
| 25 |
input_image = Image.fromarray(image.astype('uint8'), 'RGB')
|
| 26 |
|
|
|
|
| 63 |
|
| 64 |
# Create a Gradio interface
|
| 65 |
iface = gr.Interface(
|
| 66 |
+
fn=lambda image: run_inference(image, device, valid_ds),
|
| 67 |
inputs=gr.inputs.Image(type="numpy"), # Input is an image
|
| 68 |
outputs="text", # Output is text (predicted class)
|
| 69 |
title="Image Classification",
|