Deepak107 commited on
Commit
0e32c9c
1 Parent(s): 5aacb53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,15 +1,15 @@
1
  from tensorflow import keras
2
  import gradio as gr
3
  model = keras.models.load_model('potatoes2.h5')
4
- class_names = ['Potato___Early_blight', 'Potato___Late_blight', 'Potato___healthy']
5
 
6
  def predict_input_image(img):
7
- img_4d=img.reshape(-1,256,256,3)
8
  prediction=model.predict(img_4d)[0]
9
  return {class_names[i]: float(prediction[i]) for i in range(len(class_names))}
10
 
11
 
12
- image = gr.inputs.Image(shape=(256,256))
13
  label = gr.outputs.Label(num_top_classes=len(class_names))
14
 
15
  gr.Interface(fn=predict_input_image, inputs=image, outputs=label,interpretation='default').launch(debug='True')
 
1
  from tensorflow import keras
2
  import gradio as gr
3
  model = keras.models.load_model('potatoes2.h5')
4
+ class_names = ['Beer Bottles','Plastic Bottles','Soda Bottle','Water Bottle','Wine Bottle']
5
 
6
  def predict_input_image(img):
7
+ img_4d=img.reshape(-1,120,120,3)
8
  prediction=model.predict(img_4d)[0]
9
  return {class_names[i]: float(prediction[i]) for i in range(len(class_names))}
10
 
11
 
12
+ image = gr.inputs.Image(shape=(120,120))
13
  label = gr.outputs.Label(num_top_classes=len(class_names))
14
 
15
  gr.Interface(fn=predict_input_image, inputs=image, outputs=label,interpretation='default').launch(debug='True')