refactor(compressors): consolidate pipeline and improve mask handling

This commit is contained in:
2026-03-26 19:00:13 +08:00
parent 90d5a8f08a
commit 968819e113
11 changed files with 302 additions and 121 deletions

View File

@@ -1,7 +1,7 @@
model:
dino_model: "facebook/dinov2-large"
compression_dim: 512
device: "auto" # auto-detect GPU
device: "cuda:3" # auto-detect GPU
sam_model: "facebook/sam2.1-hiera-large" # SAM model name
sam_min_mask_area: 100 # Minimum mask area threshold
sam_max_masks: 10 # Maximum number of masks to keep

View File

@@ -18,7 +18,12 @@ class ModelConfig(BaseModel):
compression_dim: int = Field(
default=512, gt=0, description="Output feature dimension"
)
device: str = "auto"
device: str = Field(
default="auto",
description=(
"Device to use for model inference (e.g., 'cuda:1,3', 'auto', 'cpu')"
),
)
sam_model: str = Field(
default="facebook/sam2.1-hiera-large",
description="SAM model name from HuggingFace",