yupikopi commited on
Commit
cc33b7e
1 Parent(s): acd98e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,7 +5,7 @@ import numpy as np
5
 
6
  model = load_model('Pikachu_and_Raichu.h5')
7
 
8
- class_names = ['Pikachu', 'Raichu']
9
 
10
  def predict(img):
11
  img=img.reshape(160,160,3)
@@ -13,10 +13,10 @@ def predict(img):
13
  images_list.append(np.array(img))
14
  x = np.asarray(images_list)"""
15
  prediction = model.predict(img)[0]
16
- return {class_names[i]: float(prediction[i]) for i in range(len(class_names))}
17
 
18
  image = gr.inputs.Image(shape=(160, 160))
19
  label = gr.outputs.Label(num_top_classes=2)
20
 
21
  gr.Interface(fn=predict, inputs=image, title="Garbage Classifier",
22
- description="This is a Garbage Classification Model Trained using Dataset 11 by Sud.Deployed to Hugging Faces using Gradio.",outputs=label,interpretation='default').launch(debug=True,enable_queue=True)
 
5
 
6
  model = load_model('Pikachu_and_Raichu.h5')
7
 
8
+ labels = ['Pikachu', 'Raichu']
9
 
10
  def predict(img):
11
  img=img.reshape(160,160,3)
 
13
  images_list.append(np.array(img))
14
  x = np.asarray(images_list)"""
15
  prediction = model.predict(img)[0]
16
+ return {labels[i]: float(prediction[i]) for i in range(len(labels))}
17
 
18
  image = gr.inputs.Image(shape=(160, 160))
19
  label = gr.outputs.Label(num_top_classes=2)
20
 
21
  gr.Interface(fn=predict, inputs=image, title="Garbage Classifier",
22
+ description="Tradio.",outputs=label,interpretation='default').launch(debug=True,enable_queue=True)