Skip to content

Prediction engine outputs only one class #6250

@elisaho

Description

@elisaho

System Information (please complete the following information):

  • Windows 10 build 19044.1766
  • ML.NET v1.7.1
  • .NET 6.0

Describe the bug
For a given image input to the prediction engine, the output schema only allows for one output detected class (and a single corresponding score). However, I would like for all detected classes to be returned.
I am working on consuming the tensorflow model for object detection (exported from Custom Vision as GeneralCompactS1) in .Net using ML.NET. I have closely referenced:
https://github.com/dotnet/machinelearning-samples/tree/main/samples/csharp/end-to-end-apps/DeepLearning_ImageClassification_TF/TFImageClassification
I know the model can return multiple detected classes as I have consumed the same tensorflow model with python, tensorflowsharp, and tensorflow.net. I have tried appending column names with ':0' and ':1'(e.g. detected_classes:0) and changing the output tensor types (e.g. for detected_classes, change long to long[]), both to no avail.

Expected behavior
I expect all detected classes and their corresponding scores to be returned.

Screenshots, Code, Sample Projects
image
image
image
image
image
image
Screenshot 2022-07-12 160630

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions