Revert "much stricter ruff linting"

This reverts commit 310dbf1574.
This commit is contained in:
Vladimir Mandic
2026-05-11 08:13:57 +02:00
parent 8296d07ff8
commit c8d6fd5cf8
132 changed files with 363 additions and 292 deletions
@@ -25,8 +25,8 @@ class Sam(nn.Module):
image_encoder: Union[ImageEncoderViT, TinyViT],
prompt_encoder: PromptEncoder,
mask_decoder: MaskDecoder,
pixel_mean: List[float] | None = None,
pixel_std: List[float] | None = None,
pixel_mean: List[float] = None,
pixel_std: List[float] = None,
) -> None:
"""
SAM predicts object masks from an image and input prompts.
@@ -79,7 +79,7 @@ class TwoWayTransformer(nn.Module):
torch.Tensor: the processed image_embedding
"""
# BxCxHxW -> BxHWxC == B x N_image_tokens x C
_bs, _c, _h, _w = image_embedding.shape
bs, c, h, w = image_embedding.shape
image_embedding = image_embedding.flatten(2).permute(0, 2, 1)
image_pe = image_pe.flatten(2).permute(0, 2, 1)