I recently joined the Advent of Code 2021. During the first 25 days of December, the challenges made me (re)discover many possibilities with C#, some that are long available but maybe not that well known.
I share my code and list of concepts that might inspire you to discover a feature you were not aware of yet!
I had the honor to be a guest at the dotnetFlix channel, hosted by Sander Molenkamp and Edwin van Wijk. I share more on the techniques, frameworks and libraries I have used and I finish with a demonstration of the finished application.
As there was so much to share, it did not fit in a single episode, so we recorded three parts!
A couple of my recent articles were about machine learning and image classification in C#. These posts were the results of a pet project on which I was working. I will be speaking about this project at a couple of events in the coming weeks.
Recently I wrote an article about getting all prediction scores from your ML.NET model. So, when we want to do this for an ONNX model we have loaded with ML.NET, that should work the same, right?
Not really. Depending on the version of ML.NET, the data types of the downloaded Azure Custom Vision ONNX model are very hard to map on the .NET data types we use.
In this article I will show how we can get the labels and scores from an ONNX model prediction in C#.
YAML is a data serialization standard that is intended to be human friendly. For example, it reduces the use of delimiters quite drastically compared to other formats like JSON.
Some YAML file authors might push the boundary for readability even further by having a property where the value can be a sequence with zero or more values, or just a scalar if there is only a single value. Reducing the number of delimiters someone has to read or write even further.
How can this work with C#, a strongly typed language?
When you have created a machine learning model, you will retrain that model when new data is available. But when I recently added a couple of images to the training set of my own ML.net model, I was faced with the following exception:
System.InvalidOperationException: 'The asynchronous operation has not completed.'
The application did work for weeks, so what has changed? And more importantly, how to fix this situation?
The Custom Vision service is one of the Azure Cognitive Services that is provided by Microsoft. With custom vision, you can train a model with your own image data. The portal provides a Prediction API for the trained model to classify an image you supply.
There can be reasons why you might not want to use the online REST endpoint and you could prefer an offline model.
To work with machine learning in .NET, we can use ML.NET. There are several tutorials how to use this framework. But none of them combine the use of the Bitmap class with a downloaded ONNX model from the custom vision portal.
In this article I will walk through the steps to set up an application to classify bitmaps using a custom vision model with ML.NET.
Recently, I was using a YAML file for storing some data for a pet project. To work with this YAML in a .NET application, I use the excellent YamlDotNet library by Antoine Aubry.
One of my properties was a URL. Deserializing went fine, but when serializing back to a YAML file, things were not going as intended.
In this short article, I will explain how I did fix this.