Spaces:
Runtime error
Runtime error
feat: add examples
Browse files
app.py
CHANGED
@@ -40,18 +40,23 @@ def yolo(im, size=1024):
|
|
40 |
]
|
41 |
|
42 |
|
43 |
-
inputs =
|
|
|
|
|
44 |
outputs = [
|
45 |
-
gr.JSON(),
|
46 |
gr.Image(type="pil", label="Output Image"),
|
47 |
gr.Gallery(label="Detected Objects", object_fit="contain")
|
48 |
]
|
49 |
|
50 |
title = "YOLOv5 Kunshujo"
|
51 |
description = "YOLOv5 Kunshujo Gradio demo for object detection. Upload an image or click an example image to use."
|
52 |
-
article = "<p style='text-align: center'>YOLOv5 Kunshujo is an object detection model trained on the <a href=\"https://github.com/utda/kunshujo-layout-dataset\">Kunshujo layout dataset</a
|
53 |
|
54 |
-
examples = [
|
55 |
-
|
|
|
|
|
|
|
56 |
|
57 |
demo.launch()
|
|
|
40 |
]
|
41 |
|
42 |
|
43 |
+
inputs = [
|
44 |
+
gr.Image(type='pil', label="Original Image"),
|
45 |
+
]
|
46 |
outputs = [
|
47 |
+
gr.JSON(label="JSON Output"),
|
48 |
gr.Image(type="pil", label="Output Image"),
|
49 |
gr.Gallery(label="Detected Objects", object_fit="contain")
|
50 |
]
|
51 |
|
52 |
title = "YOLOv5 Kunshujo"
|
53 |
description = "YOLOv5 Kunshujo Gradio demo for object detection. Upload an image or click an example image to use."
|
54 |
+
article = "<p style='text-align: center'>YOLOv5 Kunshujo is an object detection model trained on the <a href=\"https://github.com/utda/kunshujo-layout-dataset\">Kunshujo layout dataset</a>.<br/>Examples: 張交帖.[5] (国立国会図書館 National Diet Library, JAPAN)</p>"
|
55 |
|
56 |
+
examples = [
|
57 |
+
['2586696_R0000008.jpg'],
|
58 |
+
['2586696_R0000009.jpg']
|
59 |
+
]
|
60 |
+
demo = gr.Interface(yolo, inputs, outputs, title=title, description=description, article=article, examples=examples, allow_flagging="never")
|
61 |
|
62 |
demo.launch()
|