Spaces:
Runtime error
Runtime error
Update app.py
Browse files32 unmodified lines333435363738394036373839404142434344454620 unmodified lines6768697070717273727432 unmodified lines
# Run inference based on the selected model model = { "ResNet": onnx_resnet_model, "EfficientNet": onnx_efficientnet_model, "VGGNet": onnx_vggnet_model, # "InceptionV3": onnx_inception_model # Uncomment or remove based on your needs }[model_choice] "ResNet": onnx_resnet_model, "EfficientNet": onnx_efficientnet_model, "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}) predictions = model.run(None, {input_name: img_preprocessed}) class_idx = np.argmax(predictions) class_name = class_names[class_idx]
20 unmodified linesiface = gr.Interface( fn=classify_image, inputs=[image_input, gr.Dropdown(["ResNet", "EfficientNet", "VGGNet", "InceptionV3"], label="Select Model")], outputs=["json"], outputs="json", live=True)
).launch(share=True)iface.launch(share=True)app.py+10-8