mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
refactor(compressors): migrate pipeline to OWLv2-based detection with text labels
- Replace bbox-prompted segmentation with OWLv2 text-guided object detection - Refactor HashPipeline from nn.Module to plain class with modular stage methods - Add detect_batch, segment_batch, filter_batch for explicit pipeline stages - Rename forward to forward_batch with text_labels API instead of bboxes - Add mask_scoring_config, score_threshold, postprocess_threshold configuration - Update model_loader to expose Dinov2Model type annotation
This commit is contained in:
@@ -6,6 +6,7 @@ import torch
|
||||
from transformers import (
|
||||
AutoImageProcessor,
|
||||
AutoModel,
|
||||
Dinov2Model,
|
||||
Owlv2ForObjectDetection,
|
||||
Owlv2Processor,
|
||||
Sam2Model,
|
||||
@@ -34,7 +35,7 @@ def load_sam_model(
|
||||
|
||||
def load_dino_model(
|
||||
model_name: str = "facebook/dinov2-large",
|
||||
) -> tuple[AutoImageProcessor, AutoModel]:
|
||||
) -> tuple[AutoImageProcessor, Dinov2Model]:
|
||||
device = get_device()
|
||||
|
||||
processor = AutoImageProcessor.from_pretrained(model_name)
|
||||
|
||||
Reference in New Issue
Block a user