Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -23,13 +23,6 @@ from tensorflow.keras.models import load_model
|
|
23 |
# import time
|
24 |
import os
|
25 |
|
26 |
-
os.system("pip install gradio")
|
27 |
-
os.system("pip install opencv-python")
|
28 |
-
os.system("apt-get update && apt-get install -y python3-opencv")
|
29 |
-
|
30 |
-
#os.system("wget https://github.com/Sxela/ArcaneGAN/releases/download/v0.4/ArcaneGANv0.4.jit")
|
31 |
-
|
32 |
-
|
33 |
|
34 |
|
35 |
|
@@ -54,10 +47,10 @@ model=load_model(PATH)
|
|
54 |
labels=['Cat','Dog']
|
55 |
NUM_CLASSES=2
|
56 |
IMG_SIZE=224
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
|
62 |
"""
|
63 |
## RUNNING WEB UI"""
|
@@ -71,7 +64,7 @@ def classify_image(inp):
|
|
71 |
image = gr.inputs.Image(shape=(IMG_SIZE, IMG_SIZE))
|
72 |
label = gr.outputs.Label(num_top_classes=2)
|
73 |
|
74 |
-
gr.Interface(fn=classify_image, inputs=image, outputs=label, title='Cats Vs Dogs',height=600, width=1200).launch()
|
75 |
|
76 |
|
77 |
|
|
|
23 |
# import time
|
24 |
import os
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
|
28 |
|
|
|
47 |
labels=['Cat','Dog']
|
48 |
NUM_CLASSES=2
|
49 |
IMG_SIZE=224
|
50 |
+
ex=[['/content/dogs-cat-examples/cat2.jpg'],
|
51 |
+
['/content/dogs-cat-examples/cat3.jpg'],
|
52 |
+
['/content/dogs-cat-examples/dog2.jpeg'],
|
53 |
+
['/content/dogs-cat-examples/dog.jpeg']]
|
54 |
|
55 |
"""
|
56 |
## RUNNING WEB UI"""
|
|
|
64 |
image = gr.inputs.Image(shape=(IMG_SIZE, IMG_SIZE))
|
65 |
label = gr.outputs.Label(num_top_classes=2)
|
66 |
|
67 |
+
gr.Interface(fn=classify_image, inputs=image, outputs=label, title='Cats Vs Dogs',height=600, width=1200,examples=ex).launch()
|
68 |
|
69 |
|
70 |
|