Spaces:
Runtime error
Runtime error
aaa
Browse files37 unmodified lines383940414243444546474149505152535455565758596061626364656667686970714273437544454624 unmodified lines7172731067475767737 unmodified lines
history=[]
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) img = np.expand_dims(img, axis=0)
if model_name == "ResNet": predictions = ResNet_model.predict(img) elif model_name == "EfficientNet": predictions = Efficient_model.predict(img) elif model_name == "VGGNet": predictions = VGGNet_model.predict(img) elif model_name == "InceptionV3": predictions = Inception_model.predict(img)
class_index = np.argmax(predictions[0]) global class_name class_name = class_folders[class_index] probability = round(max(predictions[0]) * 100, 2) result_str = f" {model_name} : {class_name} {probability}% " history.append(result_str) links = links_info(class_name) return class_name ,model_name , prediction except Exception as e: error_message = f"Error: {str(e)}" return None, None, None
link = links_info(class_name)
"""def classify_selected_model(image, model_name): try: 24 unmodified lines except Exception as e: error_message = f"Error: {str(e)}" return None, None, None,None""" info_html = f''' <!DOCTYPE html> <html>app.py+1-33