maybe fix

This commit is contained in:
2025-07-26 08:47:50 -07:00
parent e195d23584
commit 7852303b40

View File

@@ -67,10 +67,12 @@ class SAM2VideoMatting:
# Enable memory optimizations # Enable memory optimizations
if self.memory_offload: if self.memory_offload:
self.predictor.fill_hole_area = 8 # SAM2 has different memory optimization options
pass # Memory offloading is handled by SAM2 internally
if self.fp16 and self.device == "cuda": if self.fp16 and self.device == "cuda":
self.predictor.model.half() # SAM2 handles FP16 internally, no need to manually convert
pass
except Exception as e: except Exception as e:
raise RuntimeError(f"Failed to load SAM2 model: {e}") raise RuntimeError(f"Failed to load SAM2 model: {e}")