suddu21 commited on
Commit
33e8474
1 Parent(s): c88f1c0

Deleted extra

Browse files
Files changed (3) hide show
  1. app1.py +0 -0
  2. test.py +0 -0
  3. vgg16.py +0 -26
app1.py DELETED
File without changes
test.py DELETED
File without changes
vgg16.py DELETED
@@ -1,26 +0,0 @@
1
- import gradio as gr
2
- import tensorflow as tf
3
- import numpy as np
4
- from PIL import Image
5
- import tensorflow.keras as keras
6
- from tensorflow.keras.models import load_model
7
-
8
- # load model
9
- model = load_model('model520.h5')
10
-
11
- #prediction classes
12
- classnames = ['paper', 'cardboard', 'plastic', 'metal', 'food', 'battery', 'shoes', 'clothes', 'glass', 'medical']
13
-
14
- #prediction function
15
- def predict_image(img):
16
- img_4d=img.reshape(-1,224, 224,3)
17
- prediction=model.predict(img_4d)[0]
18
- return {classnames[i]: float(prediction[i]) for i in range(len(classnames))}
19
-
20
- #Gradio interface
21
- image = gr.inputs.Image(shape=(224, 224))
22
- label = gr.outputs.Label(num_top_classes=3)
23
- article="<p style='text-align: center; font-weight:bold;'>Model based on the VGG-16 CNN</p>"
24
-
25
- gr.Interface(fn=predict_image, inputs=image, title="Garbage Classifier VGG-16",
26
- description="This is a Garbage Classification Model Trained using VGG-16 architecture. Deployed to Hugging Face using Gradio.", outputs=label, article=article, enable_queue=True, interpretation='default').launch(share="True")