From f4a2b84fa4696b9de5ffb944e2b48345e6e380cf Mon Sep 17 00:00:00 2001 From: HJH_Chenhe <3765653+petercham@users.noreply.github.com> Date: Fri, 27 Dec 2024 15:57:40 +0800 Subject: [PATCH] Update transforms.py (#32) Resolved SAM2 inference error reporting issue --- sam2/utils/transforms.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sam2/utils/transforms.py b/sam2/utils/transforms.py index d05cd3e..98404ec 100644 --- a/sam2/utils/transforms.py +++ b/sam2/utils/transforms.py @@ -25,11 +25,9 @@ def __init__( self.mean = [0.485, 0.456, 0.406] self.std = [0.229, 0.224, 0.225] self.to_tensor = ToTensor() - self.transforms = torch.jit.script( - nn.Sequential( + self.transforms = nn.Sequential( Resize((self.resolution, self.resolution)), Normalize(self.mean, self.std), - ) ) def __call__(self, x):