Skip to content

Commit

Permalink
Revert code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsRogge committed Aug 6, 2024
1 parent 8f15c62 commit 322aa3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ For promptable segmentation and tracking in videos, we provide a video predictor

```python
import torch
from sam2.sam2_video_predictor import SAM2VideoPredictor
from sam2.build_sam import build_sam2_video_predictor

predictor = SAM2VideoPredictor.from_pretrained("facebook/sam2-hiera-large")
checkpoint = "./checkpoints/sam2_hiera_large.pt"
model_cfg = "sam2_hiera_l.yaml"
predictor = build_sam2_video_predictor(model_cfg, checkpoint)

with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
state = predictor.init_state(<your_video>)
Expand Down

0 comments on commit 322aa3e

Please sign in to comment.