mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
feat(compressors): add OWLv2 bbox crop to HashPipeline and refactor image utilities
- Add Owlv2ForObjectDetection and Owlv2Processor imports to model_loader - Refactor load_dino_model to return tuple of processor and model - Rewrite generate_proposals_batch to group images by bbox count for efficient batching - Add _normalize_single_bbox_list helper for bbox normalization - Update verification.py to use new pipeline architecture with detect/segment/filter/crop steps
This commit is contained in:
@@ -6,6 +6,7 @@ import torch
|
||||
from transformers import (
|
||||
AutoImageProcessor,
|
||||
AutoModel,
|
||||
BitImageProcessor,
|
||||
Dinov2Model,
|
||||
Owlv2ForObjectDetection,
|
||||
Owlv2Processor,
|
||||
@@ -35,7 +36,7 @@ def load_sam_model(
|
||||
|
||||
def load_dino_model(
|
||||
model_name: str = "facebook/dinov2-large",
|
||||
) -> tuple[AutoImageProcessor, Dinov2Model]:
|
||||
) -> tuple[BitImageProcessor, Dinov2Model]:
|
||||
device = get_device()
|
||||
|
||||
processor = AutoImageProcessor.from_pretrained(model_name)
|
||||
|
||||
Reference in New Issue
Block a user