Skip to content

Commit

Permalink
mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Mar 2, 2024
1 parent 238d586 commit dd38fdd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/models/test_rcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_untrainable(self) -> None:
def test_biases(self) -> None:
model = RCF(features=24, bias=10, mode="gaussian")
# https://github.com/pytorch/pytorch/issues/116328
assert torch.all(model.biases == 10) # type: ignore[call-overload]
assert torch.all(model.biases == 10)

def test_seed(self) -> None:
weights1 = RCF(seed=1, mode="gaussian").weights
Expand Down
2 changes: 1 addition & 1 deletion torchgeo/datamodules/seco.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(

self.aug = AugmentationSequential(
# https://github.com/arogozhnikov/einops/issues/299
K.Normalize(mean=_min, std=_max - _min), # type: ignore[operator]
K.Normalize(mean=_min, std=_max - _min),
K.Normalize(mean=torch.tensor(0), std=1 / torch.tensor(255)),
K.Normalize(mean=_mean, std=_std),
data_keys=["image"],
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/datasets/vhr10.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def plot(
# Add masks
if show_feats in {"masks", "both"} and "masks" in sample:
mask = masks[i]
contours = find_contours(mask, 0.5)
contours = find_contours(mask, 0.5) # type: ignore[no-untyped-call]
for verts in contours:
verts = np.fliplr(verts)
p = patches.Polygon(
Expand Down Expand Up @@ -524,7 +524,7 @@ def plot(
# Add masks
if show_pred_masks:
mask = prediction_masks[i]
contours = find_contours(mask, 0.5)
contours = find_contours(mask, 0.5) # type: ignore[no-untyped-call]
for verts in contours:
verts = np.fliplr(verts)
p = patches.Polygon(
Expand Down

0 comments on commit dd38fdd

Please sign in to comment.