Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,12 +10,13 @@ def classify_img(img):
|
|
10 |
pred, idx, probs = learn.predict(img)
|
11 |
return dict(zip(categories, map(float,probs)))
|
12 |
|
13 |
-
image = gr.inputs.Image(shape=(
|
14 |
label = gr.outputs.Label()
|
15 |
-
|
|
|
16 |
for img in examples:
|
17 |
img = Image.open(img)
|
18 |
-
img = img.resize((
|
19 |
-
|
20 |
iface = gr.Interface(fn = classify_img, inputs = image, outputs = label, title = 'Galaxy Classifier', examples = examples)
|
21 |
iface.launch()
|
|
|
10 |
pred, idx, probs = learn.predict(img)
|
11 |
return dict(zip(categories, map(float,probs)))
|
12 |
|
13 |
+
image = gr.inputs.Image(shape=(224,224))
|
14 |
label = gr.outputs.Label()
|
15 |
+
e = ['elliptical.jpg', 'irregular.jpg', 'spiral.jpg']
|
16 |
+
examples = []
|
17 |
for img in examples:
|
18 |
img = Image.open(img)
|
19 |
+
img = img.resize((224,224), Image.NEAREST)
|
20 |
+
examples.append(img)
|
21 |
iface = gr.Interface(fn = classify_img, inputs = image, outputs = label, title = 'Galaxy Classifier', examples = examples)
|
22 |
iface.launch()
|