Skip to content

Creating tensors from opencv data #251

@photex

Description

@photex

Howdy!

When trying to use this crate in combination with the opencv crate there appears to be no fast way to build a Tensor from an opencv matrix.

Currently you have to copy pixel by pixel and it absolutely kills my framerate. Without even running inference, just initializing the tensor this way takes me from ~22ms -> ~60ms of frame preparation time.

Before I trod down any paths you're currently looking into, I wanted to get your thoughts on approaches you'd accept a PR for.

What would make my life easiest would to be able to get a pointer to the tensor data, which I can construct a cv matrix from. I'd then use the cv api to initialize the tensor (normalizing the pixel values).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions