Skip to content

Feature Extraction Support for image models #2226

@EFord36

Description

@EFord36

Feature request

I've been trying to use ORTModelForFeatureExtraction for a DinoV2 model, for which onyx export support was added in #2001 . However, when trying to run the model over input as for a transformers AutoModel, I get:

ValueError: Input pixel_values is required by model but not provided.

According to this comment feature extraction isn't supported for image models in general. Looking at ORTModelForFeatureExtraction.forward seems to confirm this. I couldn't find an issue tracking support for this for image models generally, so thought I would open one.

Motivation

I would like to be able to use an ONNX ORT model for feature extraction for DinoV2, but currently can't.

This seems to be general to image models.

Your contribution

I'm happy to work on a PR, but might need advise as to structure/style. E.g. would the maintainers prefer a new class ORTModelForImageFeatureExtraction, or for ORTModelForFeatureExtraction.forward to more dynamically set the model_inputs depending on what args are passed to the forward method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions