Skip to content

Commit

Permalink
fix: correct marker for test-suite
Browse files Browse the repository at this point in the history
  • Loading branch information
SauravMaheshkar committed Jul 31, 2024
1 parent a93dbf1 commit 87b2b7c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
- name: Test with PyTest
run: |
python -m venv .venv && export PATH=".venv/bin:$PATH"
pytest -v -m "all"
pytest -v -m "full"
8 changes: 8 additions & 0 deletions sam2/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
import os
import warnings
from threading import Thread
from typing import Dict

import numpy as np
import torch
from PIL import Image
from tqdm import tqdm

variant_to_config_mapping: Dict[str, str] = {
"tiny": "sam2_hiera_t.yaml",
"small": "sam2_hiera_s.yaml",
"base_plus": "sam2_hiera_b+.yaml",
"large": "sam2_hiera_l.yaml",
}


def get_sdpa_settings():
if torch.cuda.is_available():
Expand Down
5 changes: 4 additions & 1 deletion tests/test_build_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import torch

from sam2.build_sam import build_sam2
from sam2.utils.misc import variant_to_config_mapping


@pytest.mark.full
Expand All @@ -11,7 +12,9 @@
)
def test_build_sam(download_weights, variant: str):
model = build_sam2(
"sam2_hiera_t.yaml", "./artifacts/sam2_hiera_tiny.pt", device="cpu"
variant_to_config_mapping[variant],
f"./artifacts/sam2_hiera_{variant}.pt",
device="cpu",
)

assert isinstance(model, torch.nn.Module)

0 comments on commit 87b2b7c

Please sign in to comment.