Skip to content

Commit 06bd20d

Browse files
committed
Fix lint.
1 parent ca981bf commit 06bd20d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

segment_anything/modeling/image_encoder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ def __init__(
144144
rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
145145
window_size (int): Window size for window attention blocks. If it equals 0, then
146146
use global attention.
147-
input_size (tuple(int, int) or None): Input resolution for calculating the relative positional
148-
parameter size.
147+
input_size (tuple(int, int) or None): Input resolution for calculating the relative
148+
positional parameter size.
149149
"""
150150
super().__init__()
151151
self.norm1 = norm_layer(dim)
@@ -201,8 +201,8 @@ def __init__(
201201
qkv_bias (bool): If True, add a learnable bias to query, key, value.
202202
rel_pos (bool): If True, add relative positional embeddings to the attention map.
203203
rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
204-
input_size (tuple(int, int) or None): Input resolution for calculating the relative positional
205-
parameter size.
204+
input_size (tuple(int, int) or None): Input resolution for calculating the relative
205+
positional parameter size.
206206
"""
207207
super().__init__()
208208
self.num_heads = num_heads

segment_anything/utils/onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def mask_postprocessing(self, masks: torch.Tensor, orig_im_size: torch.Tensor) -
8282
)
8383

8484
prepadded_size = self.resize_longest_image_size(orig_im_size, self.img_size).to(torch.int64)
85-
masks = masks[..., : prepadded_size[0], : prepadded_size[1]]
85+
masks = masks[..., : prepadded_size[0], : prepadded_size[1]] # type: ignore
8686

8787
orig_im_size = orig_im_size.to(torch.int64)
8888
h, w = orig_im_size[0], orig_im_size[1]

0 commit comments

Comments
 (0)