dotnet / dotnet/machinelearning-samples

Help in output parser to get bounding box when use Tensorflow scoring Yolov3

Open
#776 3 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
PowerShell
Stars
4.7k
Forks
2.7k
Avg merge
2d 22h
Merged PRs (30d)
1

Description

Hi, I'm use this [**tensorflow yolov3 source**](https://github.com/YunYang1994/TensorFlow2.0-Examples/tree/master/4-Object_Detection/YOLOV3) to train my custom object, and result is a [**frozen model (pb) file**](https://drive.google.com/open?id=1hvBq5mMSMP4RLPOdW2AeAznVz4ot9rfL). I've followed [**this sample**](https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/end-to-end-apps/ObjectDetection-Onnx) to scoring this model with some modify in code to fit with model
```
public string ModelInput { get; } = "x";
public string ModelOutput { get; } = "Identity_5";
public string[] Labels { get; } =
{
"vietnam_map", "vietnam_img"
};
private readonly (float x, float y)[] anchors = new (float x, float y)[]
{
(1.25F,1.625F),(2.0F,3.75F),(4.125F,2.875F),(1.875F,3.8125F),(3.875F,2.8125F),(3.6875F,7.4375F),(3.625F,2.8125F),(4.875F,6.1875F),(11.65625F,10.1875F)
};
```
Scoring use ML.NET, this model return a array float size [3549‬] (in ML.NET it flattens dimensional into one dimensional array 1x13x13x3x7 ) (_in TensorFlow it is a tensor float32 with shape **(1, 13, 13, 3, 7)**_)

I'm struggling to parser array float to get bounding box.

**Can anyone help, modify in OnnxOutputParser.cs to run with that score?**

_Width_ `ModelInput = "x"` _and_ `ModelOutput = "Identity_5"` _I've tested in TensorFlow code and it run perfect, you can try_ [**this file**](https://github.com/huanbd/TensorFlow2.0-Examples/blob/master/4-Object_Detection/YOLOV3/image_demo_pb.py)

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.