dotnet/machinelearning-samples

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

オープン

#776 opened on 2020/02/05

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)PowerShell (2,681 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (4,683 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Hi, I'm use this tensorflow yolov3 source to train my custom object, and result is a frozen model (pb) file. I've followed this sample 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

コントリビューターガイド