From 322aa3e7e55958b86161239035c773364575a387 Mon Sep 17 00:00:00 2001 From: Niels Date: Tue, 6 Aug 2024 22:57:07 +0200 Subject: [PATCH] Revert code snippet --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 26e8ee5..caf1024 100644 --- a/README.md +++ b/README.md @@ -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()