Spaces:
Running
on
Zero
Running
on
Zero
Clean up
Browse files
app.py
CHANGED
|
@@ -21,16 +21,15 @@ def get_device_and_dtype() -> tuple[str, torch.dtype]:
|
|
| 21 |
|
| 22 |
_GLOBAL_DEVICE, _GLOBAL_DTYPE = get_device_and_dtype()
|
| 23 |
_GLOBAL_MODEL_REPO_ID = "facebook/sam3"
|
| 24 |
-
_GLOBAL_TOKEN = os.getenv("HF_TOKEN")
|
| 25 |
|
| 26 |
_GLOBAL_TRACKER_MODEL = Sam3TrackerVideoModel.from_pretrained(
|
| 27 |
_GLOBAL_MODEL_REPO_ID, torch_dtype=_GLOBAL_DTYPE, device_map=_GLOBAL_DEVICE
|
| 28 |
).eval()
|
| 29 |
-
_GLOBAL_TRACKER_PROCESSOR = Sam3TrackerVideoProcessor.from_pretrained(_GLOBAL_MODEL_REPO_ID
|
| 30 |
|
| 31 |
-
_GLOBAL_TEXT_VIDEO_MODEL = Sam3VideoModel.from_pretrained(_GLOBAL_MODEL_REPO_ID
|
| 32 |
_GLOBAL_TEXT_VIDEO_MODEL = _GLOBAL_TEXT_VIDEO_MODEL.to(_GLOBAL_DEVICE, dtype=_GLOBAL_DTYPE).eval()
|
| 33 |
-
_GLOBAL_TEXT_VIDEO_PROCESSOR = Sam3VideoProcessor.from_pretrained(_GLOBAL_MODEL_REPO_ID
|
| 34 |
print("Models loaded successfully!")
|
| 35 |
|
| 36 |
|
|
|
|
| 21 |
|
| 22 |
_GLOBAL_DEVICE, _GLOBAL_DTYPE = get_device_and_dtype()
|
| 23 |
_GLOBAL_MODEL_REPO_ID = "facebook/sam3"
|
|
|
|
| 24 |
|
| 25 |
_GLOBAL_TRACKER_MODEL = Sam3TrackerVideoModel.from_pretrained(
|
| 26 |
_GLOBAL_MODEL_REPO_ID, torch_dtype=_GLOBAL_DTYPE, device_map=_GLOBAL_DEVICE
|
| 27 |
).eval()
|
| 28 |
+
_GLOBAL_TRACKER_PROCESSOR = Sam3TrackerVideoProcessor.from_pretrained(_GLOBAL_MODEL_REPO_ID)
|
| 29 |
|
| 30 |
+
_GLOBAL_TEXT_VIDEO_MODEL = Sam3VideoModel.from_pretrained(_GLOBAL_MODEL_REPO_ID)
|
| 31 |
_GLOBAL_TEXT_VIDEO_MODEL = _GLOBAL_TEXT_VIDEO_MODEL.to(_GLOBAL_DEVICE, dtype=_GLOBAL_DTYPE).eval()
|
| 32 |
+
_GLOBAL_TEXT_VIDEO_PROCESSOR = Sam3VideoProcessor.from_pretrained(_GLOBAL_MODEL_REPO_ID)
|
| 33 |
print("Models loaded successfully!")
|
| 34 |
|
| 35 |
|