refactor(verification): add progress bars and simplify device handling

This commit is contained in:
2026-03-26 20:08:05 +08:00
parent 968819e113
commit 1c9752cf9e
2 changed files with 66 additions and 41 deletions

View File

@@ -15,13 +15,12 @@ if TYPE_CHECKING:
def load_sam_model(
model_name: str = "facebook/sam2.1-hiera-large",
) -> MaskGenerationPipeline:
device = str(get_device())
device_id = 0 if device.startswith("cuda") else -1
device = get_device()
return pipeline(
task="mask-generation",
model=model_name,
device=device_id,
device=device,
)