Spaces:
Runtime error
Runtime error
Update app.py
Browse files21 unmodified lines2223242526272829303113 unmodified lines454647484950513 unmodified lines5556575859606121 unmodified linesResNet_model = load_model(ResNet_path)Efficient_model = load_model(EfficientNet_path)def classify_selected_model(image, model_name):try:history=[]img = cv2.imread(image)img = cv2.resize(img, (150, 150))img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)13 unmodified linesprobability = round(max(predictions[0]) * 100, 2)result_str = f"Model: {model_name} , Probability: {probability}%\n"history.append(result_str)return class_name, probability, history3 unmodified linesimage_input = gr.Image(type='filepath', label="Input Image")model_dropdown = gr.Dropdown(["ResNet", "EfficientNet", "VGGNet", "InceptionV3"], label="Select Model")result_label = gr.Textbox(value="Exported Result")21 unmodified lines22232425262728293013 unmodified lines444546474849503 unmodified lines545556575859606121 unmodified linesResNet_model = load_model(ResNet_path)Efficient_model = load_model(EfficientNet_path)def classify_selected_model(image, model_name):try:img = cv2.imread(image)img = cv2.resize(img, (150, 150))img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)13 unmodified linesprobability = round(max(predictions[0]) * 100, 2)result_str = f" {model_name} : {probability}% , "history.append(result_str)return class_name, probability, history3 unmodified linesimage_input = gr.Image(type='filepath', label="Input Imagehistory=[]model_dropdown = gr.Dropdown(["ResNet", "EfficientNet", "VGGNet", "InceptionV3"], label="Select Model")result_label = gr.Textbox(value="Exported Result")
app.py+4-4