A WinForms example of ML.NET image classification through webcam. You can experience preparing training data, generating models, and classifying images in real time with a webcam.
- Windows 10
- VisualStudio 2019
- .NET Core3.1
- A webcam(usbcam)
- Select [1.Create data-set] tab.
- Select a folder to save images as a data-set.
- Enter a label in the "Label name" textbox for the image to be captured.
- Specify the number of images to be taken and the interval between shots.
- Press [Start] button to start capturing images for training using the Web camera.
- Repeat 3 to 5 for the number of labels you want to classify.
- Select [2.Generate model] tab.
- Make sure that the data-set folder you selected in Step1 is displayed in the text box.
- Press [Genarate] button. After the training is finished, pipeline.zip and model.zip will be created in the data-set folder.
Also, the result will be displayed as an HTML file as shown below.
- Select [3.Consume model] tab.
- Make sure that the paths to pipeline.zip and model.zip are filled in the text boxes respectively.
- Press [InitCam] button to initialize the webcam.
- Press [Start classify] button. You will see which label the object was classified and its score every 3-sec.
A model trained on a real egg-sushi was able to recognize a toy one.:smile: