Spaces:
Runtime error
Runtime error
aaa
Browse files37 unmodified lines383940414243444546474849505152535455565758596061626364656667686970717273747576777824 unmodified lines10310410510610710810937 unmodified lineshistory=[]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_nameclass_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 , predictionexcept Exception as e:error_message = f"Error: {str(e)}"return None, None, Nonelink = links_info(class_name)"""def classify_selected_model(image, model_name):try:24 unmodified linesexcept Exception as e:error_message = f"Error: {str(e)}"return None, None, None,None"""info_html = f'''<!DOCTYPE html><html>37 unmodified lines38394041424344454624 unmodified lines7172737475767737 unmodified lineshistory=[]def classify_selected_model(image, model_name):try:24 unmodified linesexcept Exception as e:error_message = f"Error: {str(e)}"return None, None, None,Noneinfo_html = f'''<!DOCTYPE html><html>
app.py+1-33