mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-26 20:14:47 +00:00
Merge 990ecac0bc
into 98e2fcff63
This commit is contained in:
commit
9f39e7052c
@ -320,6 +320,8 @@ class TesseractOcrCliModel(BaseOcrModel):
|
|||||||
|
|
||||||
|
|
||||||
def _parse_orientation(df_osd: pd.DataFrame) -> int:
|
def _parse_orientation(df_osd: pd.DataFrame) -> int:
|
||||||
orientations = df_osd.loc[df_osd["key"] == "Orientation in degrees"].value.tolist()
|
# For strictly optimal performance with invariant dataframe format:
|
||||||
orientation = parse_tesseract_orientation(orientations[0].strip())
|
mask = df_osd["key"].to_numpy() == "Orientation in degrees"
|
||||||
|
orientation_val = df_osd["value"].to_numpy()[mask][0]
|
||||||
|
orientation = parse_tesseract_orientation(orientation_val.strip())
|
||||||
return orientation
|
return orientation
|
||||||
|
Loading…
Reference in New Issue
Block a user