This commit is contained in:
2025-07-27 08:34:57 -07:00
parent 9faaf4ed57
commit 4cc14bc0a9
4 changed files with 62 additions and 12 deletions

View File

@@ -83,9 +83,10 @@ class SAM2StreamingProcessor:
# Set to eval mode
self.predictor.eval()
# Enable FP16 if requested
# Note: FP16 conversion can cause type mismatches with compiled models
# Let SAM2 handle precision internally via build_sam2_video_predictor options
if self.fp16 and self.device.type == 'cuda':
self.predictor = self.predictor.half()
print(" FP16 enabled via SAM2 internal settings")
except Exception as e:
raise RuntimeError(f"Failed to initialize SAM2 predictor: {e}")