Commit
·
756baa3
1
Parent(s):
7ca4132
sam2 -> sam2.1
Browse files
README.md
CHANGED
|
@@ -16,7 +16,7 @@ For image prediction:
|
|
| 16 |
import torch
|
| 17 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
| 18 |
|
| 19 |
-
predictor = SAM2ImagePredictor.from_pretrained("facebook/sam2-hiera-large")
|
| 20 |
|
| 21 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
| 22 |
predictor.set_image(<your_image>)
|
|
@@ -29,7 +29,7 @@ For video prediction:
|
|
| 29 |
import torch
|
| 30 |
from sam2.sam2_video_predictor import SAM2VideoPredictor
|
| 31 |
|
| 32 |
-
predictor = SAM2VideoPredictor.from_pretrained("facebook/sam2-hiera-large")
|
| 33 |
|
| 34 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
| 35 |
state = predictor.init_state(<your_video>)
|
|
|
|
| 16 |
import torch
|
| 17 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
| 18 |
|
| 19 |
+
predictor = SAM2ImagePredictor.from_pretrained("facebook/sam2.1-hiera-large")
|
| 20 |
|
| 21 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
| 22 |
predictor.set_image(<your_image>)
|
|
|
|
| 29 |
import torch
|
| 30 |
from sam2.sam2_video_predictor import SAM2VideoPredictor
|
| 31 |
|
| 32 |
+
predictor = SAM2VideoPredictor.from_pretrained("facebook/sam2.1-hiera-large")
|
| 33 |
|
| 34 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
| 35 |
state = predictor.init_state(<your_video>)
|