Skip to content

Commit

Permalink
Ignore missing stubs for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruruthia committed Sep 27, 2024
1 parent 91590ed commit 7e52f60
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cvdm/data/image_dir_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ def __getitem__(self, idx: int) -> Tuple[np.ndarray, np.ndarray]:
img_patch = read_and_patch_image_from_filename(filename, self._im_size)

patch_LR = img_patch.resize(
(self._im_size // 4, self._im_size // 4), Image.LANCZOS
(self._im_size // 4, self._im_size // 4), Image.Resampling.LANCZOS
)
err_HR = patch_LR.resize(
(self._im_size, self._im_size), Image.Resampling.LANCZOS
)
err_HR = patch_LR.resize((self._im_size, self._im_size), Image.LANCZOS)
img_patch_arr = np.array(img_patch)
err_HR_arr = np.array(err_HR)
return (err_HR_arr / 255.0) * 2 - 1, (img_patch_arr / 255.0) * 2 - 1
Expand Down
2 changes: 1 addition & 1 deletion cvdm/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read_and_patch_image_from_filename(filename: str, im_size: int) -> Image.Ima

if img_reg.shape[0] < im_size or img_reg.shape[1] < im_size:
img_patch = Image.fromarray(img_reg)
img_patch = img_patch.resize((im_size, im_size), Image.LANCZOS)
img_patch = img_patch.resize((im_size, im_size), Image.Resampling.LANCZOS)
else:
img_patch = extract_patches_2d(img_reg, (im_size, im_size), max_patches=1)[0]
img_patch = Image.fromarray(img_patch)
Expand Down
9 changes: 9 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@ ignore_missing_imports = True
ignore_missing_imports = True

[mypy-cupy.*]
ignore_missing_imports = True

[mypy-tensorflow.*]
ignore_missing_imports = True

[mypy-tqdm.*]
ignore_missing_imports = True

[mypy-yaml.*]
ignore_missing_imports = True

0 comments on commit 7e52f60

Please sign in to comment.