mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-13 04:25:32 +08:00
refactor(compressors): consolidate pipeline and improve mask handling
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Model loading utilities for DINO, SAM2 and HashCompressor."""
|
||||
|
||||
from compressors import HashCompressor
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
|
||||
import torch
|
||||
@@ -8,6 +8,9 @@ from transformers import AutoImageProcessor, AutoModel, pipeline, MaskGeneration
|
||||
|
||||
from .common import get_device
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from compressors.hash_compressor import HashCompressor
|
||||
|
||||
|
||||
def load_sam_model(
|
||||
model_name: str = "facebook/sam2.1-hiera-large",
|
||||
@@ -44,7 +47,7 @@ def load_hash_compressor(
|
||||
input_dim: int = 1024,
|
||||
hash_bits: int = 512,
|
||||
compressor_path: str | None = None,
|
||||
) -> HashCompressor:
|
||||
) -> "HashCompressor":
|
||||
from compressors.hash_compressor import HashCompressor
|
||||
|
||||
device = get_device()
|
||||
|
||||
Reference in New Issue
Block a user