Skip to content

Commit

Permalink
Fix resizing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Oct 24, 2023
1 parent 6065ee8 commit 2d2a10c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lensless/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def resize(img, factor=None, shape=None, interpolation=cv2.INTER_CUBIC):
else:
resized = np.array(
[
cv2.resize(img[i], dsize=new_shape[::-1], interpolation=interpolation)
cv2.resize(img[i], dsize=tuple(new_shape[::-1]), interpolation=interpolation)
for i in range(img.shape[-4])
]
)
Expand Down
6 changes: 3 additions & 3 deletions scripts/measure/collect_dataset_on_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ def collect_dataset(config):
)

if down:
output = resize(output[None, ...], 1 / down, interpolation=cv2.INTER_CUBIC)[
0
]
output = resize(
output[None, ...], factor=1 / down, interpolation=cv2.INTER_CUBIC
)[0]

# print range
print(f"{output_fp}, range: {output.min()} - {output.max()}")
Expand Down

0 comments on commit 2d2a10c

Please sign in to comment.