Skip to content

Commit 308fde9

Browse files
authored
Merge pull request #323 from VikParuchuri/inline-update
Update to new inline math model
2 parents 53c064d + 76ebe08 commit 308fde9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

surya/detection/heatmap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def parallel_get_boxes(preds, orig_sizes, include_maps=False):
160160
return result
161161

162162
def parallel_get_inline_boxes(preds, orig_sizes, text_boxes, include_maps=False):
163-
heatmap, = preds
163+
heatmap, _ = preds
164164
heatmap_size = list(reversed(heatmap.shape))
165165

166166
for text_box in text_boxes:

surya/settings.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def TORCH_DEVICE_MODEL(self) -> str:
5858
COMPILE_DETECTOR: bool = False
5959

6060
# Inline math detection
61-
INLINE_MATH_MODEL_CHECKPOINT: str = "s3://inline_math_detection/2025_02_18"
62-
INLINE_MATH_THRESHOLD: float = 0.8 #Threshold for inline math detection (above this is considered inline-math)
63-
INLINE_MATH_BLANK_THRESHOLD: float = 0.5 # Threshold for blank space (below this is considered blank)
61+
INLINE_MATH_MODEL_CHECKPOINT: str = "s3://inline_math_detection/2025_02_22"
62+
INLINE_MATH_THRESHOLD: float = 0.9 #Threshold for inline math detection (above this is considered inline-math)
63+
INLINE_MATH_BLANK_THRESHOLD: float = 0.35 # Threshold for blank space (below this is considered blank)
6464
INLINE_MATH_BENCH_DATASET_NAME: str = "datalab-to/inline_detection_bench"
6565
INLINE_MATH_TEXT_BLANK_PX: int = 2 # How many pixels to blank out at the botton of each text line
6666
INLINE_MATH_MIN_AREA: int = 100 # Minimum area for inline math detection

0 commit comments

Comments
 (0)