Spaces:
Runtime error
Runtime error
Update app.py
Browse files41 unmodified lines4243444546474849502 unmodified lines5354555657585941 unmodified linesmin_probability = min(all_predictions.values())if min_probability < 70: # Adjust the threshold as neededresult_str = "Can't detect this image. Please try another one."history.append(result_str)return None, None, history[-3:-1]best_model = max(all_predictions, key=all_predictions.get)class_name = class_folders[np.argmax(models[best_model].predict(img)[0])]2 unmodified linesresult_str = f"{best_model}: {class_name} {probability}%"history.append(result_str)return class_name, probability, history[-3:-1]except Exception as e:error_message = f"Error: {str(e)}"41 unmodified lines424344454647484950512 unmodified lines5455565758596041 unmodified linesmin_probability = min(all_predictions.values())if min_probability < 70: # Adjust the threshold as neededhistory=[]result_str = "Can't detect this image. Please try another one."history.append(result_str)return None, None, historybest_model = max(all_predictions, key=all_predictions.get)class_name = class_folders[np.argmax(models[best_model].predict(img)[0])]2 unmodified linesresult_str = f"{best_model}: {class_name} {probability}%"history.append(result_str)return class_name, probability, history[-1],except Exception as e:error_message = f"Error: {str(e)}"
app.py+3-2