Florent Gbelidji commited on
Sync DeepSeek OCR HF job code
Browse files- ds_batch_ocr/stages.py +2 -1
ds_batch_ocr/stages.py
CHANGED
|
@@ -4,6 +4,7 @@ import json
|
|
| 4 |
import logging
|
| 5 |
import os
|
| 6 |
from pathlib import Path
|
|
|
|
| 7 |
from typing import Any, Dict, Iterable, List, Optional
|
| 8 |
|
| 9 |
import shutil
|
|
@@ -306,7 +307,7 @@ def run_stage_extract(settings: ExtractSettings) -> None:
|
|
| 306 |
"document_with_boxes_path": ctx["sample_dir"] / "document_with_boxes.png",
|
| 307 |
"document_markdown_text": markdown,
|
| 308 |
"extracted_figures": [figure.image_path for figure in figures],
|
| 309 |
-
"extracted_figures_metadata": [
|
| 310 |
}
|
| 311 |
)
|
| 312 |
|
|
|
|
| 4 |
import logging
|
| 5 |
import os
|
| 6 |
from pathlib import Path
|
| 7 |
+
from dataclasses import asdict
|
| 8 |
from typing import Any, Dict, Iterable, List, Optional
|
| 9 |
|
| 10 |
import shutil
|
|
|
|
| 307 |
"document_with_boxes_path": ctx["sample_dir"] / "document_with_boxes.png",
|
| 308 |
"document_markdown_text": markdown,
|
| 309 |
"extracted_figures": [figure.image_path for figure in figures],
|
| 310 |
+
"extracted_figures_metadata": [asdict(figure) for figure in figures],
|
| 311 |
}
|
| 312 |
)
|
| 313 |
|