Improve ONNX Object Detection Flow#531
Merged
CESARDELATORRE merged 8 commits intodotnet:masterfrom Jul 18, 2019
luisquintanilla:onnx-drawboundingbox
Merged
Improve ONNX Object Detection Flow#531CESARDELATORRE merged 8 commits intodotnet:masterfrom luisquintanilla:onnx-drawboundingbox
CESARDELATORRE merged 8 commits intodotnet:masterfrom
luisquintanilla:onnx-drawboundingbox
Conversation
DrawBoundingBox Private
natke
reviewed
Jun 27, 2019
| Console.WriteLine($"Default parameters: image size=({ImageNetSettings.imageWidth},{ImageNetSettings.imageHeight})"); | ||
|
|
||
| var data = CreateEmptyDataView(); | ||
| var data = _mlContext.Data.LoadFromEnumerable(new List<ImageNetData>()); |
Contributor
There was a problem hiding this comment.
This could use a comment to explain why we create an empty data view
CESARDELATORRE
approved these changes
Jul 18, 2019
Contributor
CESARDELATORRE
left a comment
There was a problem hiding this comment.
Tested and reviewed. Thanks! 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactored sample to improve flow / readability
List of Changes
YoloWinMlParsertoYoloOutputParser.LoadModelmethod toITransformerCreateEmptyDataViewsince it is only used once and replaced it with_mlContext.Data.LoadFromEnumerable(new List<ImageNetData>());inside ofLoadModelmethod.PredictDataUsingModelmethod signature to decouple post-processing steps.Transformmethod instead ofPredictionEngineto score data using the model inPredictDataUsingModelmethod.Scoremethod to reflect changes in other helper methods.GetImagesDatamethod. Moved logic toImageNetDataclass as part ofReadFromFilemethod.DrawBoundingBoxmethod toProgramclassMainmethod ofProgramclass and broke down into steps (1) load data, (2) score data with model (3) post-process data (4) draw bounding boxes