dotnet/machinelearning-samples

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

开放

#776 创建于 2020年2月5日

 (3 条评论) (0 个反应) (0 位负责人)PowerShell (2,681 个派生)batch import
help wanted

仓库指标

星标
 (4,683 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南