From 53007e23b1dc106bacc9d9d45f1a58412d63389b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 10 Feb 2025 12:04:06 -0500 Subject: [PATCH] Fix unit test --- .github/workflows/benchmarks.yml | 2 +- surya/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 31977d6..5f51efc 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -25,7 +25,7 @@ jobs: run: | poetry run python benchmark/detection.py --max_rows 2 poetry run python benchmark/utils/verify_benchmark_scores.py results/benchmark/det_bench/results.json --bench_type detection - - name: Run inline detection benchmarj + - name: Run inline detection benchmark run: | poetry run python benchmark/inline_detection.py --max_rows 5 poetry run python benchmark/utils/verify_benchmark_scores.py results/benchmark/inline_math_bench/results.json --bench_type inline_detection diff --git a/surya/settings.py b/surya/settings.py index 227da55..4b10b39 100644 --- a/surya/settings.py +++ b/surya/settings.py @@ -58,7 +58,7 @@ def TORCH_DEVICE_MODEL(self) -> str: # Inline math detection INLINE_MATH_MODEL_CHECKPOINT: str = "datalab-to/inline_math_det0@75aafc7aa3d494ece6496d28038c91f0d2518a43" INLINE_MATH_THRESHOLD: float = 0.8 #Threshold for inline math detection (above this is considered inline-math) - INLINE_MATH_BLANK_THRESHOLD: float = 0.6 # Threshold for blank space (below this is considered blank) + INLINE_MATH_BLANK_THRESHOLD: float = 0.5 # Threshold for blank space (below this is considered blank) INLINE_MATH_BENCH_DATASET_NAME: str = "datalab-to/inline_detection_bench" INLINE_MATH_TEXT_BLANK_PX: int = 2 # How many pixels to blank out at the botton of each text line INLINE_MATH_MIN_AREA: int = 100 # Minimum area for inline math detection