修正字段名
This commit is contained in:
@@ -141,7 +141,7 @@ def information_extraction(ie, phrecs):
|
|||||||
rotated_img = rotate_image(img["img"], angle)
|
rotated_img = rotate_image(img["img"], angle)
|
||||||
cv2.imwrite(temp_file.name, rotated_img)
|
cv2.imwrite(temp_file.name, rotated_img)
|
||||||
docs.append({"doc": temp_file.name})
|
docs.append({"doc": temp_file.name})
|
||||||
doc_phrecs.append({"phrec": phrec, "rotation": angle, "x_offset": img["x_offset"], "y_offset": img["y_offset"]})
|
doc_phrecs.append({"phrec": phrec, "rotation_angle": angle, "x_offset": img["x_offset"], "y_offset": img["y_offset"]})
|
||||||
if not docs:
|
if not docs:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ def information_extraction(ie, phrecs):
|
|||||||
result_json = result_json[:5000]
|
result_json = result_json[:5000]
|
||||||
session = MysqlSession()
|
session = MysqlSession()
|
||||||
zx_ocr = ZxOcr(pk_phhd=phrec.pk_phhd, pk_phrec=phrec.pk_phrec, id=id, cfjaddress=phrec.cfjaddress,
|
zx_ocr = ZxOcr(pk_phhd=phrec.pk_phhd, pk_phrec=phrec.pk_phrec, id=id, cfjaddress=phrec.cfjaddress,
|
||||||
content=result_json, rotation=doc_phrec["rotation"], x_offset=doc_phrec["x_offset"],
|
content=result_json, rotation_angle=doc_phrec["rotation_angle"], x_offset=doc_phrec["x_offset"],
|
||||||
y_offset=doc_phrec["y_offset"], create_time=now, update_time=now)
|
y_offset=doc_phrec["y_offset"], create_time=now, update_time=now)
|
||||||
session.add(zx_ocr)
|
session.add(zx_ocr)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user