ImageClassificationGPU 2.0.0

dotnet add package ImageClassificationGPU --version 2.0.0
NuGet\Install-Package ImageClassificationGPU -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ImageClassificationGPU" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ImageClassificationGPU --version 2.0.0
#r "nuget: ImageClassificationGPU, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ImageClassificationGPU as a Cake Addin
#addin nuget:?package=ImageClassificationGPU&version=2.0.0

// Install ImageClassificationGPU as a Cake Tool
#tool nuget:?package=ImageClassificationGPU&version=2.0.0

What is this?

This package is a wrapper library of ML.NET to do image classification. You will need ImageClassification.IO packeage along with this package. ImageClassificationGPU package is only for GPU environment. Other than that, it is same as ImageClassification packge.

Usege

Trainer class

Trainer class is a class to train the Model (which will be two zip files) from your image data. Image data you have to prepare in advence is a foldered image data like below. Each folder names will be predicted Label names (Apple/Banana/Orange/...).

  • Fruits
    • Apple
      • apple001.jpg
      • apple002.jpg
      • ...
    • Banana
    • Orange
    • ...

More images you prepare, better result you'll get.

Next, call Trainer.GenerateModel with dataDir you prepared. <pre> // Define hyper-paramters such as Epoch and BatchSize. var hp = new HyperParameter { Epoch = 200, BatchSize = 10, LearningRate = 0.01f, eTrainerArchitecture = eTrainerArchitectures.ResnetV250, TestFraction = 0.3f, ResultsToShow = 20 };

// Train and generate the model.
var results = Trainer.GenerateModel(dataDir, hp);

// Save the results as HTML file.(optional)
results.SaveAsHTML();

</pre>

Classifier class

Classifier class is a class to get a prediction from the image file you give (=imageToClassify). Call Classifier.GetSingleImagePrediction along with the Model you've created at previus section.

<pre> string imageToClassify = @"C:\your\imageToClassify(apple_or_banana_or_orange).png"; var p = Classifier.GetSingleImagePrediction(results.Resultfiles.PipelineZip, results.Resultfiles.ModelZip, imageToClassify); Console.WriteLine($@"Predicted image label is: ""{p.PredictedLabel}"". Score:{p.HighScore}"); </pre>

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 425 12/30/2022
1.5.5.3 520 5/6/2021
1.5.5.2 408 3/14/2021
1.5.5.1 360 3/11/2021
1.5.5 388 3/5/2021
1.5.4.2 385 2/26/2021
1.5.4 385 2/21/2021

You need to meet following requirements.
* CUDA 10.1 update2
* cuDNN 7.6.5

2.0.x comes with ML.NET 2.0.0.0 or later.
Changed .NETCore3.1 to .NET6.0