没有识别结果也保存图片
This commit is contained in:
@@ -78,6 +78,10 @@ def check_ie_result(pk_phhd):
|
|||||||
font = ImageFont.truetype("./font/simfang.ttf", size=size)
|
font = ImageFont.truetype("./font/simfang.ttf", size=size)
|
||||||
|
|
||||||
ocr = session.query(ZxOcr.id, ZxOcr.content, ZxOcr.x_offset, ZxOcr.y_offset).filter(ZxOcr.pk_phrec == phrec.pk_phrec).all()
|
ocr = session.query(ZxOcr.id, ZxOcr.content, ZxOcr.x_offset, ZxOcr.y_offset).filter(ZxOcr.pk_phrec == phrec.pk_phrec).all()
|
||||||
|
if not ocr:
|
||||||
|
os.makedirs(f"./check_result/{pk_phhd}/0", exist_ok=True)
|
||||||
|
image.save(f"./check_result/{pk_phhd}/0/{img_name}")
|
||||||
|
|
||||||
for id, group_results in groupby(ocr, key=lambda x: x.id):
|
for id, group_results in groupby(ocr, key=lambda x: x.id):
|
||||||
draw = ImageDraw.Draw(image)
|
draw = ImageDraw.Draw(image)
|
||||||
for ocr_item in group_results:
|
for ocr_item in group_results:
|
||||||
|
|||||||
Reference in New Issue
Block a user