mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-13 04:25:32 +08:00
refactor(verification): add progress bars and simplify device handling
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user