Hamza011 commited on
Commit
03a6314
1 Parent(s): 6751789

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,11 +1,12 @@
1
- import tensorflow as tf
2
  import gradio as gr
3
  import cv2
4
  import os
 
5
 
6
 
7
  print(os.listdir('./model'))
8
- used_model = tf.keras.models.load_model('./model')
9
  new_classes = ['blight', 'common_rust', 'gray_leaf_spot','healthy']
10
 
11
  def classify_image(img_dt):
@@ -22,4 +23,6 @@ with gr.Blocks() as demo:
22
  **HEALTHY**, has **COMMON RUST**, **BLIGHT** or **GRAY LEAF SPOT**''')
23
  inp = gr.image()
24
  out = gr.Label()
25
- inp.upload(fn= classify_image, inputs = inp, outputs = out, show_progrss = True)
 
 
 
1
+ import tf_keras as keras
2
  import gradio as gr
3
  import cv2
4
  import os
5
+ from dotenv import load_dotenv()
6
 
7
 
8
  print(os.listdir('./model'))
9
+ used_model = keras.models.load_model('./model')
10
  new_classes = ['blight', 'common_rust', 'gray_leaf_spot','healthy']
11
 
12
  def classify_image(img_dt):
 
23
  **HEALTHY**, has **COMMON RUST**, **BLIGHT** or **GRAY LEAF SPOT**''')
24
  inp = gr.image()
25
  out = gr.Label()
26
+ inp.upload(fn= classify_image, inputs = inp, outputs = out, show_progrss = True)
27
+
28
+ demo.launch()