Spaces:
Sleeping
Sleeping
Added Image Example
Browse files
app.py
CHANGED
@@ -7,6 +7,11 @@ class_names = ['Kharbandhi Lhakhang', 'Milarepa Lhakhang', 'Pasakha Lhakhang']
|
|
7 |
img_height, img_width = 256, 256
|
8 |
model = tf.keras.models.load_model('CSR_models.h5')
|
9 |
|
|
|
|
|
|
|
|
|
|
|
10 |
def greet(sample_image):
|
11 |
sample_image_resized = cv2.resize(sample_image, (img_height, img_width))
|
12 |
sample_image_expanded = np.expand_dims(sample_image_resized, axis=0)
|
@@ -14,5 +19,5 @@ def greet(sample_image):
|
|
14 |
image_output_class = class_names[np.argmax(predictions)]
|
15 |
return image_output_class
|
16 |
|
17 |
-
demo = gr.Interface(fn=greet, inputs="image", outputs="text")
|
18 |
demo.launch()
|
|
|
7 |
img_height, img_width = 256, 256
|
8 |
model = tf.keras.models.load_model('CSR_models.h5')
|
9 |
|
10 |
+
examples = [
|
11 |
+
'img/Milarepa.jpg',
|
12 |
+
'img/kharbandhi.jpg',
|
13 |
+
'img/pasakha.jpeg'
|
14 |
+
]
|
15 |
def greet(sample_image):
|
16 |
sample_image_resized = cv2.resize(sample_image, (img_height, img_width))
|
17 |
sample_image_expanded = np.expand_dims(sample_image_resized, axis=0)
|
|
|
19 |
image_output_class = class_names[np.argmax(predictions)]
|
20 |
return image_output_class
|
21 |
|
22 |
+
demo = gr.Interface(fn=greet, inputs="image", outputs="text", examples = examples)
|
23 |
demo.launch()
|