Skip to content

Create an ML.Net sample showing image classification using images already loaded in memory, rather than from disk #5980

Closed
@Webreaper

Description

@Webreaper

I'm trying to put together an ML.Net image classification app. However, the samples I can find all assume that the images being classified are a folder of disk-based image files. This doesn't really help when processing already-in-memory images (for example, streaming video frames, etc).

I've tried adapting the example here to use bytes from a Bitmap pre-loaded from disk, but I don't seem to be getting the setup of the tensor data right, which means that I just get NaN results from the scoring.

It would be really useful if the ML.Net team could put together a sample where the input was a binary image - so for example, in the ScoreTensorFlowModel example above, if the GetTensorData method loaded a couple of JPEGs from disk, and then passed back the TensorData[] structure as an array of binary data from the images.

It seems, while googling, that a lot of people would find such an example extremely helpful - as there's a lot of people trying (and failing) to image-process video streams and other in-memory images using ML.Net and TF.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    imageBugs related image datatype tasksquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions