Spaces:
Runtime error
Runtime error
Update app.py
Browse files12345123456789101112131415161718192013 unmodified lines3435362537383940pip install torchpip install gradiopip install transformers
import tensorflow as tfimport numpy as npimport osimport cv2import gradio as gr
# Load the modelsinception_model_path = 'path/to/inception_model.h5'vggnet_model_path = 'path/to/vggnet_model.h5'resnet_model_path = 'path/to/resnet_model.h5'efficientnet_model_path = 'path/to/efficientnet_model.h5'
# Load the modelsinception_model = tf.keras.models.load_model(inception_model_path)vggnet_model = tf.keras.models.load_model(vggnet_model_path)resnet_model = tf.keras.models.load_model(resnet_model_path)efficientnet_model = tf.keras.models.load_model(efficientnet_model_path)
def classify_selected_model(image, model_name): img = cv2.imread(image.name)13 unmodified lines return {"error": "Invalid model selection"}
class_index = np.argmax(predictions) class_name = class_folders[class_index] class_name = class_folders[class_index] # Define class_folders based on your classes probability = predictions[0, class_index]
print(f"Class Index: {class_index}")app.py+18-6