Raja commited on
Commit
c93e159
1 Parent(s): 9dda49c

Added remedy json

Browse files
Files changed (2) hide show
  1. app.py +9 -1
  2. remedy.json +24 -0
app.py CHANGED
@@ -6,6 +6,7 @@ from PIL import Image
6
  from matplotlib.pyplot import imshow
7
  from transformers import pipeline
8
  from transformers import AutoFeatureExtractor, AutoModelForImageClassification
 
9
 
10
  def load_dataset_from_Hugging_Face():
11
  reloaded_dataset_thermal = load_dataset("gokulraja17/rice-thermal-demo")
@@ -92,4 +93,11 @@ if uploaded_file is not None:
92
  thermal_result=pipe_thermal(input_image)
93
  rgb_result=pipe_rgb(image_rgb)
94
  consolidated_result=get_output_label(consolidate_score(thermal_result,rgb_result))
95
- st.write(consolidated_result)
 
 
 
 
 
 
 
 
6
  from matplotlib.pyplot import imshow
7
  from transformers import pipeline
8
  from transformers import AutoFeatureExtractor, AutoModelForImageClassification
9
+ import json
10
 
11
  def load_dataset_from_Hugging_Face():
12
  reloaded_dataset_thermal = load_dataset("gokulraja17/rice-thermal-demo")
 
93
  thermal_result=pipe_thermal(input_image)
94
  rgb_result=pipe_rgb(image_rgb)
95
  consolidated_result=get_output_label(consolidate_score(thermal_result,rgb_result))
96
+ st.write(consolidated_result)
97
+ if(consolidated_result!="RiceLeafs_Healthy"):
98
+ f = open("remedy.json")
99
+ data = json.load(f)
100
+ for i in data[consolidated_result.split("_")[0]]:
101
+ if(i["disease_name"]==consolidated_result.split("_")[1]):
102
+ for key in i:
103
+ st.write(key," ",i[key])
remedy.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "RiceLeafs":
3
+ [
4
+ {
5
+ "disease_name":"Brownspot",
6
+ "cause":"It is fungal disease spread via seeds.",
7
+ "remedy":"This can be avoided by the use of preventive measures by soaking seeds in Captan or Thiram at 2.0g /kg of seed. Can use antibiotic also to prevent the disease.",
8
+ "link":"https://agritech.tnau.ac.in/expert_system/paddy/cpdisbrownspot.html"
9
+ },
10
+ {
11
+ "disease_name":"Hispa",
12
+ "cause":"Damage is caused by the adults and larvae of the rice hispa, Dicladispa armigera. Adult beetles scrape the upper surface of leaf blades leaving only the lower layer.",
13
+ "remedy":"several chemical formulations containing the following active ingredients could be used to control populations: chlorpyriphos, malathion, cypermethrin, fenthoate.",
14
+ "link":"https://plantix.net/en/library/plant-diseases/600098/rice-hispa"
15
+ },
16
+ {
17
+ "disease_name":"LeafBlast",
18
+ "cause":"This disease is caused by a fungus named Pyricularia grisea, which overwinters in rice seeds and infected rice stubble.",
19
+ "remedy":"Use fungicides at the late boot stage and again when 80 to 90 percent of plants are headed. Growing rice, in fields where flood levels are easily maintained.",
20
+ "link":"https://extension.missouri.edu/publications/mp645"
21
+
22
+ }
23
+ ]
24
+ }