maybe fix
This commit is contained in:
@@ -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}")
|
||||||
|
|||||||
Reference in New Issue
Block a user