This commit is contained in:
2024-06-21 09:01:14 +08:00
parent 3f45432198
commit 3f8e2b5e61

View File

@@ -2,6 +2,7 @@ import json
import logging import logging
import math import math
import os import os
import pdb
import sys import sys
import tempfile import tempfile
import time import time
@@ -100,6 +101,7 @@ def information_extraction(ie, phrecs):
for img in split_result: for img in split_result:
with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as temp_file: with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as temp_file:
img["img"].save(temp_file.name) img["img"].save(temp_file.name)
pdb.set_trace()
docs.append({"doc": temp_file.name}) docs.append({"doc": temp_file.name})
doc_phrecs.append({"phrec": phrec, "x_offset": img["x_offset"], "y_offset": img["y_offset"]}) doc_phrecs.append({"phrec": phrec, "x_offset": img["x_offset"], "y_offset": img["y_offset"]})
if not docs: if not docs: