davanstrien HF Staff commited on
Commit
f9f088f
·
1 Parent(s): 8225805

add examples

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py CHANGED
@@ -410,6 +410,33 @@ with gr.Blocks() as demo:
410
  ],
411
  )
412
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  gr.Markdown("---")
414
  gr.Markdown("### Example ALTO XML Snippet (for `String` element extraction):")
415
  gr.Code(
 
410
  ],
411
  )
412
 
413
+ gr.Markdown("---")
414
+ gr.Markdown("### Try an Example")
415
+ gr.Examples(
416
+ examples=[
417
+ ["examples/one/74442232.3.jpg", "examples/one/74442232.34.xml", "RolmOCR"],
418
+ [
419
+ "examples/one/74442232.3.jpg",
420
+ "examples/one/74442232.34.xml",
421
+ "Nanonets-OCR-s",
422
+ ],
423
+ ],
424
+ inputs=[image_input, xml_input, model_selector],
425
+ outputs=[
426
+ output_image_display,
427
+ xml_output_textbox,
428
+ hf_ocr_output_textbox,
429
+ ocr_download_btn,
430
+ xml_download_btn,
431
+ ],
432
+ fn=process_files,
433
+ cache_examples=False,
434
+ )
435
+ gr.Markdown(
436
+ "*Example from ['A Medical History of British India'](https://data.nls.uk/data/digitised-collections/a-medical-history-of-british-india/) "
437
+ "collection, National Library of Scotland*"
438
+ )
439
+
440
  gr.Markdown("---")
441
  gr.Markdown("### Example ALTO XML Snippet (for `String` element extraction):")
442
  gr.Code(