nakamura196 commited on
Commit
3ce8e64
·
1 Parent(s): ef2c342

feat: add examples

Browse files
app.py CHANGED
@@ -28,22 +28,41 @@ def yolo(im):
28
  ]
29
 
30
 
31
- inputs = gr.Image(type='pil', label="Original Image")
 
 
32
  outputs = [
33
  gr.JSON(label="Output JSON"),
34
  gr.Image(type='pil', label="Output Image with Boxes"),
35
  ]
36
 
37
  title = "YOLOv5 Face"
38
- description = "YOLOv5 Face Gradio demo for object detection. Upload an image or click an example image to use."
39
- article = "<p style='text-align: center'>YOLOv5 Face is an object detection model trained on the <a href=\"https://doi.org/10.20676/00000353\">顔コレデータセット</a>.</p>"
 
 
 
 
 
 
 
 
40
 
41
  examples = [
 
42
  ['『源氏百人一首』(大阪公立大学中百舌鳥図書館 国文学研究資料館).jpg'],
43
  ['『源氏物語』(国文学研究資料館).jpg'],
44
  ['『百鬼夜行図』(東京大学).jpg']
45
  ]
46
- demo = gr.Interface(yolo, inputs, outputs, title=title, description=description, article=article, examples=examples)
 
 
 
 
 
 
 
 
47
 
48
  demo.css = """
49
  .json-holder {
 
28
  ]
29
 
30
 
31
+ inputs = [
32
+ gr.Image(type='pil', label="Original Image")
33
+ ]
34
  outputs = [
35
  gr.JSON(label="Output JSON"),
36
  gr.Image(type='pil', label="Output Image with Boxes"),
37
  ]
38
 
39
  title = "YOLOv5 Face"
40
+ description = """<p>YOLOv5 Face Gradio demo for object detection. Upload an image or click an example image to use.</p>"""
41
+
42
+ article = """
43
+ <ul>
44
+ <li>『文正草子』(日本古典籍データセット(国文研所蔵)CODH配信)</li>
45
+ <li>『源氏百人一首』(大阪公立大学中百舌鳥図書館 国文学研究資料館)</li>
46
+ <li>『源氏物語』(国文学研究資料館)</li>
47
+ <li>『百鬼夜行図』(東京大学)</li>
48
+ </ul>
49
+ <p style='text-align: center'>YOLOv5 Face is an object detection model trained on the <a href=\"https://doi.org/10.20676/00000353\">顔コレデータセット</a>.</p>"""
50
 
51
  examples = [
52
+ ["『文正草子』(日本古典籍データセット(国文研所蔵)CODH配信).jpg"],
53
  ['『源氏百人一首』(大阪公立大学中百舌鳥図書館 国文学研究資料館).jpg'],
54
  ['『源氏物語』(国文学研究資料館).jpg'],
55
  ['『百鬼夜行図』(東京大学).jpg']
56
  ]
57
+ demo = gr.Interface(
58
+ fn=yolo,
59
+ inputs=inputs,
60
+ outputs=outputs,
61
+ title=title,
62
+ description=description,
63
+ article=article,
64
+ examples=examples
65
+ )
66
 
67
  demo.css = """
68
  .json-holder {
『文正草子』(日本古典籍データセット(国文研所蔵)CODH配信).jpg ADDED

Git LFS Details

  • SHA256: acaf85514c4ea879055f2a088e9154376d99a31cf85c6a60ebaa92f3669d8838
  • Pointer size: 130 Bytes
  • Size of remote file: 89.5 kB