Spaces:
Runtime error
Runtime error
Update app.py
Browse files22 unmodified lines2324252627282930318 unmodified lines404142404344454618 unmodified lines656667686966707172697374757622 unmodified lines processed_img = img / 255.0 return processed_img
# Read the image using cv2.imread img = cv2.imdecode(np.frombuffer(img.read(), np.uint8), -1)
# Keep the input size as (150, 150) since your model expects that size input_size = (150, 150) img_resized = cv2.resize(img, input_size)8 unmodified lines "VGGNet": onnx_vggnet_model, # "InceptionV3": onnx_inception_model # Uncomment or remove based on your needs }[model_choice]
input_name = model.get_inputs()[0].name try: predictions = model.run(None, {input_name: img_preprocessed})18 unmodified lines return result
image_input = gr.Image()model_dropdown = gr.Dropdown(["ResNet", "EfficientNet", "VGGNet", "InceptionV3"], label="Select Model")
# Create a Gradio interface with a dropdown for model selection# Create a Gradio interface with image input and a dropdown for model selectioniface = gr.Interface( fn=classify_image, inputs=[image_input, gr.Dropdown(["ResNet", "EfficientNet", "VGGNet", "InceptionV3"], label="Select Model")], inputs=[image_input, model_dropdown], outputs="json", live=True)app.py+7-3