Gabriel commited on
Commit
89c820a
·
verified ·
1 Parent(s): 466f0d3

Update visualizer.py

Browse files
Files changed (1) hide show
  1. visualizer.py +2 -2
visualizer.py CHANGED
@@ -6,7 +6,7 @@ from typing import Optional, Tuple, List
6
  import math
7
 
8
 
9
- def htrflow_visualizer(image_path: str, htr_document_path: str) -> Optional[str]:
10
  """
11
  Visualize HTR results by overlaying text regions and polygons on the original image.
12
 
@@ -15,7 +15,7 @@ def htrflow_visualizer(image_path: str, htr_document_path: str) -> Optional[str]
15
  htr_document_path (str): Path to the HTR XML file (ALTO or PAGE format)
16
 
17
  Returns:
18
- Optional[str]: Path to the generated visualization image, or None if failed
19
  """
20
  try:
21
  if not image_path or not htr_document_path:
 
6
  import math
7
 
8
 
9
+ def htrflow_visualizer(image_path: str, htr_document_path: str, server_name: str = "https://gabriel-htrflow-mcp.hf.space") -> Optional[str]:
10
  """
11
  Visualize HTR results by overlaying text regions and polygons on the original image.
12
 
 
15
  htr_document_path (str): Path to the HTR XML file (ALTO or PAGE format)
16
 
17
  Returns:
18
+ str: File path to the generated visualization imagegenerated visualization image for direct download via gr.File (server_name/gradio_api/file=/tmp/gradio/{temp_folder}/{file_name})
19
  """
20
  try:
21
  if not image_path or not htr_document_path: