mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-13 04:25:32 +08:00
feat(compressors/proposal): add OWLv2 object detection pipeline and typed results
- switch OWLv2 loader return type to Owlv2ForObjectDetection - add detect_objects and detect_objects_batch with two-stage score filtering - add DetectionResult typed dict and conversion helper for post-processed outputs - export new detection APIs from proposal module
This commit is contained in:
@@ -7,7 +7,6 @@ from transformers import (
|
||||
AutoImageProcessor,
|
||||
AutoModel,
|
||||
Owlv2ForObjectDetection,
|
||||
Owlv2Model,
|
||||
Owlv2Processor,
|
||||
Sam2Model,
|
||||
Sam2Processor,
|
||||
@@ -47,7 +46,7 @@ def load_dino_model(
|
||||
|
||||
def load_owlv2_model(
|
||||
model_name: str = "google/owlv2-base-patch16-ensemble",
|
||||
) -> tuple[Owlv2Processor, Owlv2Model]:
|
||||
) -> tuple[Owlv2Processor, Owlv2ForObjectDetection]:
|
||||
device = get_device()
|
||||
|
||||
processor = Owlv2Processor.from_pretrained(model_name)
|
||||
|
||||
Reference in New Issue
Block a user