Skip to content

Commit

Permalink
Merge pull request #116 from VikParuchuri/dev
Browse files Browse the repository at this point in the history
Resize change
  • Loading branch information
VikParuchuri authored May 28, 2024
2 parents 31e36e7 + e37597d commit d167369
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "surya-ocr"
version = "0.4.9"
version = "0.4.10"
description = "OCR, layout, reading order, and line detection in 90+ languages"
authors = ["Vik Paruchuri <[email protected]>"]
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions surya/input/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def split_image(img, processor):
def prepare_image_detection(img, processor):
new_size = (processor.size["width"], processor.size["height"])

img = np.asarray(img, dtype=np.uint8)
img = cv2.resize(img, new_size, interpolation=cv2.INTER_LANCZOS4)
img = img.resize(new_size, Image.Resampling.LANCZOS) # Stretch smaller dimension to fit new size

img = np.asarray(img, dtype=np.uint8)
img = processor(img)["pixel_values"][0]
img = torch.from_numpy(img)
return img
Expand Down

0 comments on commit d167369

Please sign in to comment.