Spaces:
Runtime error
Runtime error
Update app.py
Browse files14 unmodified lines15161718192023 unmodified lines4445464748495051525354558 unmodified lines6465666768697014 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)23 unmodified lineshistory.append(f"Error: {str(e)}")return "Error", None, Nonereturn class_name, probability ,model_namedef export_results(class_name, probability, model_name):result_str = f"Predicted Class: {class_name}\nProbability: {probability}%\nModel: {model_name}"history.append(result_str)result_label.value = result_str8 unmodified linesoutputs=[gr.Label(value="Archaeological Site"),gr.Label(value="Probability"),gr.Label(value="Exported Result will be displayed here")],examples=[["Sites/Ajloun.png"],["Sites/Jeresh.png"],14 unmodified lines151617181920212223 unmodified lines4647484950515253545556578 unmodified lines6667686970717214 unmodified linesResNet_model = load_model(ResNet_path)Efficient_model = load_model(EfficientNet_path)history=[]def classify_selected_model(image, model_name):try:img = cv2.imread(image)23 unmodified lineshistory.append(f"Error: {str(e)}")return "Error", None, Nonereturn class_name, probability ,historydef export_results(class_name, probability, model_name):result_str = f"Predicted Class: {class_name}\nProbability: {probability}%\nModel: {model_name}"history.append(result_str)result_label.value = "\n".join(history)8 unmodified linesoutputs=[gr.Label(value="Archaeological Site"),gr.Label(value="Probability"),gr.Label(value="Exported Result")],examples=[["Sites/Ajloun.png"],["Sites/Jeresh.png"],
app.py+5-3