synthval.features_extraction.DinoV2FeatureExtractor =================================================== .. py:class:: synthval.features_extraction.DinoV2FeatureExtractor(model_id) Bases: :py:obj:`FeatureExtractor` Feature extractor using models from the HuggingFace DinoV2 family (https://huggingface.co/collections/facebook/dinov2-6526c98554b3d2576e071ce3). Note: As of December 16, 2024, Dino models utilize the operator `aten::upsample_bicubic2d.out`, which is not currently supported on the MPS backend. To use these models as feature extractors on MPS, users must set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK` to `1`. .. py:method:: batch_feature_extraction(images) Extract features from a batch of images using the HuggingFace DinoV2 model. :param images: List of PIL images to extract features from. :type images: List[PIL.Image.Image] :returns: A NumPy array where each row corresponds to the feature vector of an image. :rtype: numpy.ndarray