Depth-Anything-V2-Small / processing_depth_anything_v2.py
bigshanedogg's picture
Upload Depth-Anything-V2-Small (transformers port, original code)
397f342 verified
Raw History Blame Contribute Delete
685 Bytes
"""Depth Anything V2 processor: ``DepthAnythingV2ImageProcessor`` (the official image2tensor transform) as its only part."""
from transformers.processing_utils import ProcessorMixin
class DepthAnythingV2Processor(ProcessorMixin):
attributes = ["image_processor"]
def __init__(self, image_processor=None, **kwargs):
super().__init__(image_processor, **kwargs)
def __call__(self, images=None, **kwargs):
return self.image_processor(images, **kwargs)
def post_process_depth_estimation(self, outputs, target_sizes=None):
return self.image_processor.post_process_depth_estimation(outputs, target_sizes)
__all__ = ["DepthAnythingV2Processor"]