Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,37 +1,3 @@
|
|
1 |
-
# examples = [["Examples/img1.png"], ["Examples/img2.png"],["Examples/img3.png"], ["Examples/img4.png"]]
|
2 |
-
|
3 |
-
# import gradio as gr
|
4 |
-
# import tensorflow as tf
|
5 |
-
# import numpy as np
|
6 |
-
# from tensorflow.keras.models import load_model
|
7 |
-
|
8 |
-
# HEIGHT, WIDTH = 224, 224
|
9 |
-
# IMG_SIZE = 224
|
10 |
-
# model = load_model('Models/best_model1.h5')
|
11 |
-
|
12 |
-
# def classify_image(inp):
|
13 |
-
# NUM_CLASSES = 2
|
14 |
-
# labels = ['Cat', 'Dog']
|
15 |
-
# inp = tf.image.resize(inp, [IMG_SIZE, IMG_SIZE])
|
16 |
-
# inp = inp.numpy().reshape((-1, IMG_SIZE, IMG_SIZE, 3))
|
17 |
-
# inp = tf.keras.applications.vgg16.preprocess_input(inp)
|
18 |
-
# prediction = model.predict(inp).flatten()
|
19 |
-
# return {labels[i]: float(prediction[i]) for i in range(NUM_CLASSES)} # Fixed: return floats
|
20 |
-
|
21 |
-
# image = gr.Image(height=HEIGHT, width=WIDTH, label='Input')
|
22 |
-
# label = gr.Label(num_top_classes=2)
|
23 |
-
|
24 |
-
# examples = [["Examples/img1.png"], ["Examples/img2.png"],["Examples/img3.png"], ["Examples/img4.png"]]
|
25 |
-
|
26 |
-
# gr.Interface(
|
27 |
-
# fn=classify_image,
|
28 |
-
# inputs=image,
|
29 |
-
# outputs=label,
|
30 |
-
# title='Smart Pet Classifier',
|
31 |
-
# examples=examples
|
32 |
-
# ).launch(debug=False)
|
33 |
-
|
34 |
-
|
35 |
|
36 |
import gradio as gr
|
37 |
import tensorflow as tf
|
@@ -64,5 +30,5 @@ gr.Interface(
|
|
64 |
inputs=image,
|
65 |
outputs=label,
|
66 |
title='Smart Pet Classifier',
|
67 |
-
|
68 |
).launch(debug=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
import gradio as gr
|
3 |
import tensorflow as tf
|
|
|
30 |
inputs=image,
|
31 |
outputs=label,
|
32 |
title='Smart Pet Classifier',
|
33 |
+
examples=examples
|
34 |
).launch(debug=False)
|