M. Saad Munawar
commited on
Commit
•
a088002
1
Parent(s):
6cb76bc
https://huggingface.co/spaces/Saad123/minimal
Browse files
app.py
CHANGED
@@ -12,8 +12,6 @@ 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 |
-
Cat_prob = pred*100
|
16 |
-
Dog_prob = (1-pred)*100
|
17 |
pred_label = np.argmax(pred)
|
18 |
if (pred_label == 0):
|
19 |
return "The Image is of a Dog."
|
@@ -21,6 +19,8 @@ def model(image):
|
|
21 |
return "The Image is of a Cat."
|
22 |
|
23 |
image = gr.inputs.Image(shape=(224,224))
|
|
|
|
|
24 |
|
25 |
-
iface = gr.Interface(fn=model, inputs=image, outputs='text')
|
26 |
iface.launch(debug=True)
|
|
|
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."
|
|
|
19 |
return "The Image is of a Cat."
|
20 |
|
21 |
image = gr.inputs.Image(shape=(224,224))
|
22 |
+
background='body{background-image:url("https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX35440124.jpg");}'
|
23 |
+
title = "Cat & Dog Classifier"
|
24 |
|
25 |
+
iface = gr.Interface(fn=model, inputs=image, outputs='text', css=background, title=title)
|
26 |
iface.launch(debug=True)
|