Skip to content

Commit

Permalink
fix: incorrect resizing in adabins
Browse files Browse the repository at this point in the history
  • Loading branch information
samedii committed Oct 15, 2022
1 parent 3847c96 commit 9559c65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions perceptor/models/adabins_depth/adabins_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def forward(self, images: Tensor.dims("NCHW")) -> Tensor.dims("NCHW"):
if image_area > MAX_ADABINS_AREA:
scale = np.sqrt(MAX_ADABINS_AREA) / np.sqrt(image_area)
images = transforms.resize(
images, out_shape=(int(w * scale), int(h * scale)), resample="lancsoz3"
images, out_shape=(int(h * scale), int(w * scale)), resample="lanczos3"
)
elif image_area < MIN_ADABINS_AREA:
scale = np.sqrt(MIN_ADABINS_AREA) / np.sqrt(image_area)
images = transforms.resize(
images, out_shape=(int(w * scale), int(h * scale)), resample="bicubic"
images, out_shape=(int(h * scale), int(w * scale)), resample="bicubic"
)

return self.model.predict(images)
Expand Down
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 = "perceptor"
version = "0.6.5"
version = "0.6.6"
description = "Modular image generation library"
authors = ["Richard Löwenström <samedii@gmail.com>", "dribnet"]
readme = "README.md"
Expand Down

0 comments on commit 9559c65

Please sign in to comment.