Spaces:
Runtime error
Runtime error
added cv2 yash change
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
import tensorflow as tf
|
4 |
import tensorflow_hub as hub
|
|
|
5 |
|
6 |
path = '20220804-16551659632113-all-images-Adam.h5'
|
7 |
model = tf.keras.models.load_model(path,custom_objects={"KerasLayer":hub.KerasLayer})
|
@@ -47,7 +48,7 @@ labels = ['affenpinscher', 'afghan_hound', 'african_hunting_dog', 'airedale',
|
|
47 |
def predict_breed(image):
|
48 |
|
49 |
##---aks
|
50 |
-
image
|
51 |
##aks end
|
52 |
# reshape the input
|
53 |
image = image.reshape((-1, 224, 224, 3))
|
|
|
2 |
import requests
|
3 |
import tensorflow as tf
|
4 |
import tensorflow_hub as hub
|
5 |
+
import cv2
|
6 |
|
7 |
path = '20220804-16551659632113-all-images-Adam.h5'
|
8 |
model = tf.keras.models.load_model(path,custom_objects={"KerasLayer":hub.KerasLayer})
|
|
|
48 |
def predict_breed(image):
|
49 |
|
50 |
##---aks
|
51 |
+
image = cv2.resize(image, (224, 224))
|
52 |
##aks end
|
53 |
# reshape the input
|
54 |
image = image.reshape((-1, 224, 224, 3))
|