Skip to content

Commit

Permalink
restored original code formula test pdf
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo-Omenetti <[email protected]>
  • Loading branch information
Matteo-Omenetti authored and Matteo-Omenetti committed Mar 10, 2025
1 parent 460e5c5 commit a75beaf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions docling/models/code_formula_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,38 +207,6 @@ def _get_code_language_enum(self, value: Optional[str]) -> CodeLanguageLabel:
except ValueError:
return CodeLanguageLabel.UNKNOWN

# def _pad_image_with_edge_color(self, img: Union[Image.Image, np.ndarray], padding: tuple) -> Image.Image:
# """
# Pads the image with different padding sizes per side, filled with the outermost pixels.

# Parameters:
# ----------
# img : PIL.Image
# The original image.
# padding : tuple
# Padding amounts as (left, top, right, bottom).

# Returns:
# ---------
# PIL.Image: The padded image.
# """
# if isinstance(img, np.ndarray):
# img = Image.fromarray(img)

# left, top, right, bottom = padding

# img_np = np.array(img)

# if img_np.ndim == 2:
# # Grayscale
# pad_width = ((top, bottom), (left, right))
# else:
# # RGB or RGBA
# pad_width = ((top, bottom), (left, right), (0, 0))

# padded_np = np.pad(img_np, pad_width=pad_width, mode='edge')

# return Image.fromarray(padded_np, img.mode)
def _get_most_frequent_edge_color(self, pil_img: Image.Image):
"""
Compute the most frequent color along the outer edges of a PIL image.
Expand Down
Binary file modified tests/data/pdf/code_and_formula.pdf
Binary file not shown.

0 comments on commit a75beaf

Please sign in to comment.