Skip to content

ML.NET object detection Predict() takes 5 seconds to process #5881

Open
@MattiaDurli

Description

@MattiaDurli

System Information (please complete the following information):

  • OS & Version: Windows 10
  • ML.NET Version: ML.NET v1.6
  • .NET Version: NET 5.0

Describe the bug
I've created a ONNX model for Object Detection with Visual Studio and ML Model Builder (using an Azure workspace), using VOTT to define the 4 objects I want to detect.
I'm testing the model as explained in the tutorial, and it works well, detects the 4 objects, result is ok:

    var sampleData = new MLModel1.ModelInput()
    {
        ImageSource = @"C:\Data\sample1.jpg",
    };

    //Load model and predict output
    var result = MLModel1.Predict(sampleData);

Problem is it takes 5 seconds (10 seconds on first run, 5 on the following ones).
Sample.jpg is a 700x400 pixels image, 85kb, the computer is an Intel i7 2.9GHz.

Am I doing something wrong or this is the speed I should expect? Here's the image, the objects to detect are the REF, LOT, the hourglass icon and the factory icon.

OCR_b

To Reproduce
Followed the Object Detection sample on Documentation

Expected behavior
Much faster processing time

Metadata

Metadata

Assignees

No one assigned

    Labels

    ModelBuilderBugs related model builderimageBugs related image datatype tasks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions