Spaces:
Runtime error
Runtime error
some new changes
Browse files12345665 unmodified lines727374757677787980# Trained on 80 epochs at Batch size 256 with Learning Rate of 0.001 under 50 seconds!!from PIL import Image, ImageOpsimport numpy as npimport streamlit as stimport tensorflow as tf65 unmodified linesclass_name = class_names[index]confidence_score = prediction[0][index]# Print prediction and confidence scoreresult = f"Your plant is suffering from: {class_name[2:]}"result_score = f"✅ Accuracy confidence score is: `{confidence_score}/ 100`"st.success(result)st.info(result_score)#print("The image is classified as ", class_name, "with a similarity score of", confidence_score)123456765 unmodified lines737475767778798081828384858687888990919293949596979899100101102103104105106107# Trained on 80 epochs at Batch size 256 with Learning Rate of 0.001 under 50 seconds!!from PIL import Image, ImageOpsimport numpy as npimport pandas as pdimport streamlit as stimport tensorflow as tf65 unmodified linesclass_name = class_names[index]confidence_score = prediction[0][index]# Loading diseases info & management strategiessolution_df = pd.read_csv('pages/Disease_solutions.csv')about = []strategies = []# selecting rows based on conditiontype_df = solution_df.loc[solution_df['Diseases'] == class_name[2:], 'Type'].item()des_df = solution_df.loc[solution_df['Diseases'] == class_name[2:], 'Description'].item()about.append(des_df)sol = solution_df.loc[solution_df['Diseases'] == class_name[2:], 'Management Strategies'].item()strategies.append(sol)# Print prediction and confidence scoreresult = f"Your plant is suffering from: {class_name[2:]}"result_score = f"✅ Accurate prediction score is: `{confidence_score[:5]}/ 100`"st.success(result)st.info(result_score)# Print diseases' other infotab1, tab2 = st.tabs(["👀 Description", "⭐ Solution"])with tab1:res1 = f"### Type of disease: {type_df}"res2 = f"### About this disease:\n\n{about[0]}"st.write(res1)st.wrie(res2)with tab2:res3 = f"### Steps that can help solve this disease:\n\n{strategies[0]}"st.write(res3)
pages/Teachable_Machine_Model.py+29-2