Spaces:
Runtime error
Runtime error
Raja
commited on
Commit
•
dc86593
1
Parent(s):
ce8b148
Adding both checkbox
Browse files
app.py
CHANGED
@@ -84,16 +84,16 @@ if(thermal_check or rgb_check):
|
|
84 |
thermal_result=pipe_thermal(input_image)
|
85 |
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
|
98 |
if(rgb_check):
|
99 |
|
@@ -112,16 +112,16 @@ if(thermal_check or rgb_check):
|
|
112 |
pipe_rgb = create_pipeline(feature_extractor_rgb,model_rgb)
|
113 |
rgb_result=pipe_rgb(input_image)
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
|
126 |
if(both_check):
|
127 |
st.write("Thermal Image file uploader...")
|
@@ -154,13 +154,14 @@ if(both_check):
|
|
154 |
feature_extractor_rgb,model_rgb = load_model_from_Hugging_Face("rgb")
|
155 |
pipe_rgb = create_pipeline(feature_extractor_rgb,model_rgb)
|
156 |
rgb_result=pipe_rgb(input_image)
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
84 |
thermal_result=pipe_thermal(input_image)
|
85 |
|
86 |
|
87 |
+
consolidated_result=get_output_label(thermal_result)
|
88 |
+
if(consolidated_result!="RiceLeafs_Healthy"):
|
89 |
+
f = open("remedy.json")
|
90 |
+
data = json.load(f)
|
91 |
+
for i in data[consolidated_result.split("_")[0]]:
|
92 |
+
if(i["disease_name"]==consolidated_result.split("_")[1]):
|
93 |
+
for key in i:
|
94 |
+
st.write(key," : ",i[key])
|
95 |
+
else:
|
96 |
+
st.write(consolidated_result.split("_")[0]," is ",consolidated_result.split("_")[1])
|
97 |
|
98 |
if(rgb_check):
|
99 |
|
|
|
112 |
pipe_rgb = create_pipeline(feature_extractor_rgb,model_rgb)
|
113 |
rgb_result=pipe_rgb(input_image)
|
114 |
|
115 |
+
consolidated_result=get_output_label(rgb_result)
|
116 |
+
if(consolidated_result!="RiceLeafs_Healthy"):
|
117 |
+
f = open("remedy.json")
|
118 |
+
data = json.load(f)
|
119 |
+
for i in data[consolidated_result.split("_")[0]]:
|
120 |
+
if(i["disease_name"]==consolidated_result.split("_")[1]):
|
121 |
+
for key in i:
|
122 |
+
st.write(key," : ",i[key])
|
123 |
+
else:
|
124 |
+
st.write(consolidated_result.split("_")[0]," is ",consolidated_result.split("_")[1])
|
125 |
|
126 |
if(both_check):
|
127 |
st.write("Thermal Image file uploader...")
|
|
|
154 |
feature_extractor_rgb,model_rgb = load_model_from_Hugging_Face("rgb")
|
155 |
pipe_rgb = create_pipeline(feature_extractor_rgb,model_rgb)
|
156 |
rgb_result=pipe_rgb(input_image)
|
157 |
+
|
158 |
+
consolidated_result=get_output_label(consolidate_score(thermal_result,rgb_result))
|
159 |
+
if(consolidated_result!="RiceLeafs_Healthy"):
|
160 |
+
f = open("remedy.json")
|
161 |
+
data = json.load(f)
|
162 |
+
for i in data[consolidated_result.split("_")[0]]:
|
163 |
+
if(i["disease_name"]==consolidated_result.split("_")[1]):
|
164 |
+
for key in i:
|
165 |
+
st.write(key," : ",i[key])
|
166 |
+
else:
|
167 |
+
st.write(consolidated_result.split("_")[0]," is ",consolidated_result.split("_")[1])
|