M. Saad Munawar
commited on
Commit
•
1511c08
1
Parent(s):
f2d3e2b
https://huggingface.co/spaces/Saad123/minimal
Browse files
app.py
CHANGED
@@ -12,9 +12,10 @@ def model(image):
|
|
12 |
im_scaled = image/255
|
13 |
im_reshape = np.reshape(im_scaled,[1,224,224,3])
|
14 |
pred = loaded_model.predict(im_reshape)
|
15 |
-
|
|
|
16 |
return "The Image is of a Dog."
|
17 |
-
if (
|
18 |
return "The Image is of a Cat."
|
19 |
|
20 |
image = gr.inputs.Image(shape=(224,224))
|
|
|
12 |
im_scaled = image/255
|
13 |
im_reshape = np.reshape(im_scaled,[1,224,224,3])
|
14 |
pred = loaded_model.predict(im_reshape)
|
15 |
+
pred_label = np.argmax(pred)
|
16 |
+
if (pred_label == 0):
|
17 |
return "The Image is of a Dog."
|
18 |
+
if (pred_label == 1):
|
19 |
return "The Image is of a Cat."
|
20 |
|
21 |
image = gr.inputs.Image(shape=(224,224))
|