dotnet / machinelearning-samples

Samples for ML.NET, an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
4.46k stars 2.68k forks source link

Update ONNX Object Detection samples to use the full yolov3 model #575

Open CESARDELATORRE opened 5 years ago

CESARDELATORRE commented 5 years ago

Update this sample (https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/end-to-end-apps/DeepLearning_ObjectDetection_Onnx) to yolov3 (not the mini ver.)

Related comment/request from the community in this other issue: https://github.com/dotnet/machinelearning-samples/issues/572

luisquintanilla commented 5 years ago

ML.NET Version: 1.2

Given the following pipeline for the YOLOv3 full ONNX model downloaded from the Model Zoo:

var pipeline = _mlContext.Transforms.LoadImages("input_1:01", dataPath, "ImagePath")
                .Append(_mlContext.Transforms.ResizeImages("input_1:01", 416, 416))
                .Append(_mlContext.Transforms.ExtractPixels("input_1:01"))
                .Append(_mlContext.Transforms.ApplyOnnxModel("concat_2:0", "input_1:01", modelPath));

The exception below is raised:

Google.Protobuf.InvalidProtocolBufferException: 'Protocol message was too large.  May be malicious.  Use CodedInputStream.SetSizeLimit() to increase the size limit.'
CESARDELATORRE commented 5 years ago

@luisquintanilla - Can you create a new issue with this at the ML.NET repo since it looks like it is a problem with the ONNX API? Thanks,

luisquintanilla commented 5 years ago

Issue created in ML.NET repo

dotnet/machinelearning#4085

kylelaverty commented 4 years ago

@CESARDELATORRE It looks like the issue has been resolved in ML.NET. Is this still on your radar to look at? I just finished running through the tutorial and thought it was great but then realized it is on the older Yolo and on the tiny version. I think either update (v3 or full size) would be worth it.

phanxuanduc1996 commented 4 years ago

What is your full Yolov3 output? "grid" or "output" + "classLabel". Can someone show me how to convert .weights -> .onnx with the output as "grid"?