dotnet / dotnet/machinelearning

Is an Object Detection suppose to take 3.5 seconds?

Open
#7,046 0 comments 0 reactions 0 assignees View on GitHub
area-Vision untriaged
Dominant language
C#
Stars
9.4k
Forks
2k
Avg merge
2d 20h
Merged PRs (30d)
11

Description

**System Information (please complete the following information):**
- OS & Version: Windows 10
- ML.NET Version: [v17.17.0](https://github.com/dotnet/machinelearning-modelbuilder/tree/v17.17.0)
- .NET Version: .NET 8

**Describe the bug**
I just managed to setup my first project and things seem to be working quite well, however I noticed that doing a simple object detection takes about 3.5 seconds. I'm not sure if this is normal due to some PredictEngine overhead or something but it seems quite long considering I'm using a 4090 and the images aren't big.

The model was trained using 10 images and I'm only trying to predict 1 object on 1 image.

```
DoorDetection.ModelInput sampleData = new DoorDetection.ModelInput()
{
Image = image,
};

Stopwatch stopwatch = Stopwatch.StartNew();

var predictionResult = DoorDetection.Predict(sampleData);

stopwatch.Stop();
Console.WriteLine(stopwatch.ElapsedMilliseconds);
```

**To Reproduce**
Steps to reproduce the behavior:
1. Clone my project https://github.com/borakeh/ObjectDetection
2. I guess make sure the images are on the desktop in the correct folder
Folder Structure
- Desktop/doors
- Desktop/doors/doorsOut
3. Run the project and check how long it takes.

**Expected behavior**
I would assume it would be a bit faster.

**Screenshots, Code, Sample Projects**
No screenshots.

**Additional context**
No additional context.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.