KajetanNiewczas commited on
Commit ·
2acc30b
1
Parent(s): 7a036c9
Fix some vector graphic extraction bugs
Browse files
src/processing/images_processing.py
CHANGED
|
@@ -282,7 +282,7 @@ def extract_vector(pdf, page, page_num) -> list[dict]:
|
|
| 282 |
- "hash": The MD5 hash of the figure content.
|
| 283 |
"""
|
| 284 |
# pylint: disable=invalid-name
|
| 285 |
-
MAX_DRAWINGS =
|
| 286 |
MIN_SIZE = 0.05
|
| 287 |
MAX_SIZE = 0.30
|
| 288 |
THRESHOLD = 5
|
|
@@ -510,7 +510,6 @@ def find_used_gfx(answer, work_dir: str, metadatas: list) -> None:
|
|
| 510 |
"img": int(match.group("img")),
|
| 511 |
"hash": match.group("hash"),
|
| 512 |
}
|
| 513 |
-
print("matches_img = ", match.group("doc"))
|
| 514 |
req_imgs.append(req_img)
|
| 515 |
|
| 516 |
# Find figures, which are used in the presentation
|
|
@@ -526,7 +525,6 @@ def find_used_gfx(answer, work_dir: str, metadatas: list) -> None:
|
|
| 526 |
"fig": int(match.group("fig")),
|
| 527 |
"hash": match.group("hash"),
|
| 528 |
}
|
| 529 |
-
print("matches_fig = ", match.group("doc"))
|
| 530 |
req_figs.append(req_fig)
|
| 531 |
# span.set_attribute("output.req_figs", json.dumps(req_figs))
|
| 532 |
langfuse_context.update_current_observation(
|
|
|
|
| 282 |
- "hash": The MD5 hash of the figure content.
|
| 283 |
"""
|
| 284 |
# pylint: disable=invalid-name
|
| 285 |
+
MAX_DRAWINGS = 800
|
| 286 |
MIN_SIZE = 0.05
|
| 287 |
MAX_SIZE = 0.30
|
| 288 |
THRESHOLD = 5
|
|
|
|
| 510 |
"img": int(match.group("img")),
|
| 511 |
"hash": match.group("hash"),
|
| 512 |
}
|
|
|
|
| 513 |
req_imgs.append(req_img)
|
| 514 |
|
| 515 |
# Find figures, which are used in the presentation
|
|
|
|
| 525 |
"fig": int(match.group("fig")),
|
| 526 |
"hash": match.group("hash"),
|
| 527 |
}
|
|
|
|
| 528 |
req_figs.append(req_fig)
|
| 529 |
# span.set_attribute("output.req_figs", json.dumps(req_figs))
|
| 530 |
langfuse_context.update_current_observation(
|