Skip to content

Commit bba650f

Browse files
authored
Update AILab_SAM2Segment.py
1 parent 9c382cc commit bba650f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

AILab_SAM2Segment.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
print("Warning: GroundingDINO not available. Text prompts will use fallback method.")
2626

2727
# Disable PyTorch JIT compilation
28-
torch.jit._state._python_cu = None
29-
torch._C._jit_set_profiling_mode(False)
30-
torch._C._jit_set_profiling_executor(False)
28+
# torch.jit._state._python_cu = None
29+
# torch._C._jit_set_profiling_mode(False)
30+
# torch._C._jit_set_profiling_executor(False)
3131

32-
original_jit_script = torch.jit.script
33-
def patched_jit_script(obj):
34-
return obj
35-
torch.jit.script = patched_jit_script
32+
# original_jit_script = torch.jit.script
33+
# def patched_jit_script(obj):
34+
# return obj
35+
# torch.jit.script = patched_jit_script
3636

3737
current_dir = os.path.dirname(__file__)
3838
sam2_path = os.path.join(current_dir, "sam2")
@@ -406,4 +406,5 @@ def segment_v2(self, image, prompt, sam2_model, dino_model, device, threshold=0.
406406

407407
NODE_DISPLAY_NAME_MAPPINGS = {
408408
"SAM2Segment": "SAM2 Segmentation (RMBG)",
409-
}
409+
410+
}

0 commit comments

Comments
 (0)