Spaces:
Runtime error
Runtime error
Jessica Walkenhorst
commited on
Commit
•
67620b6
1
Parent(s):
5eaaa37
Add article to app
Browse files
app.py
CHANGED
@@ -11,17 +11,20 @@ def classify_image(image):
|
|
11 |
_, _, probs = learn.predict(image)
|
12 |
return dict(zip(categories, map(float, probs)))
|
13 |
|
14 |
-
title = 'Mirror, mirror on the wall am I a duckling or a cygnet after all?'
|
15 |
-
description = """Hans Christian Andersen's tale of the ugly duckling tells us about the sad youth of a cygnet
|
16 |
|
17 |
examples = ['duckling.jpg', 'cygnet.jpg', 'sunflower.jpg', 'whiteclouds.jpg', 'yellowclouds.jpg']
|
18 |
|
|
|
|
|
19 |
app = gr.Interface(fn=classify_image,
|
20 |
inputs=gr.components.Image(),
|
21 |
outputs=gr.components.Label(),
|
22 |
examples=examples,
|
23 |
title=title,
|
24 |
description=description,
|
|
|
25 |
allow_flagging='never')
|
26 |
|
27 |
app.launch()
|
|
|
11 |
_, _, probs = learn.predict(image)
|
12 |
return dict(zip(categories, map(float, probs)))
|
13 |
|
14 |
+
title = 'Mirror, mirror on the wall, am I a duckling or a cygnet after all?'
|
15 |
+
description = """Hans Christian Andersen's tale of the ugly duckling tells us about the sad youth of a cygnet which is accidentally brought up in a family of ducks and is ostrized on the account of it being different. But what if the cygnet had a magic mirror to tell it that it was in fact a young swan after all? Machine learning to the rescue!"""
|
16 |
|
17 |
examples = ['duckling.jpg', 'cygnet.jpg', 'sunflower.jpg', 'whiteclouds.jpg', 'yellowclouds.jpg']
|
18 |
|
19 |
+
article = 'This model was build using a resnet-18 architecture, pretrained on ImageNet and finetuned using 100 images of ducklings and cygnets each.'
|
20 |
+
|
21 |
app = gr.Interface(fn=classify_image,
|
22 |
inputs=gr.components.Image(),
|
23 |
outputs=gr.components.Label(),
|
24 |
examples=examples,
|
25 |
title=title,
|
26 |
description=description,
|
27 |
+
article=article,
|
28 |
allow_flagging='never')
|
29 |
|
30 |
app.launch()
|