Skip to content

Commit

Permalink
Add binarization to test_chat_models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
colibrisson committed Sep 7, 2023
1 parent ceb1a34 commit 0857e02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def check_line_direction(baseline_seg: dict) -> dict:
# Load image
img = Image.open(img_path)

# Binarize the image
img = img.convert("L")
img = img.point(lambda x: 0 if x < 128 else 255, "1")

# Segment the image
baseline_seg = blla.segment(img, text_direction="vertical-rl", model=seg_model)

Expand Down

0 comments on commit 0857e02

Please sign in to comment.