ClassificationEngine Class

Summary

Classification을 수행할 수 있는 Engine입니다.
graph BT Type-->Base0["InspectionEngine<EngineMetadata, TrainingOptions, ClsInspectionOptions>"] Base0-->Base1["object"] Type-.->Interface0["IInspectionEngine"] click Interface0 "/api/SaigeVision.Core.Inference/IInspectionEngine" Type-.->Interface1["IDisposable"] Type["ClassificationEngine"] class Type type-node

Syntax

public sealed class ClassificationEngine : 
    InspectionEngine<EngineMetadata, TrainingOptions, ClsInspectionOptions>, IInspectionEngine, 
    IDisposable

Examples

다음을 샘플 이미지 한장에 대한 Classification을 수행하는 방법을 설명합니다.

 SaigeVision.Core.SaigeVisionApp.Init();

 IGpuService gpuService = new NvGpuService();
 gpuService.DetectConnectedGPUs();
 PhysicalGpu gpu = gpuService.CurrentDetectedGPUs[0];

 SrImage image = new SrImage(@"..\..\000001.png");
 Uri model = new Uri(@"..\..\model.srCls");

 using(var engine = EngineLoader.LoadFrom(typeof(ClassificationEngine),model))
 {
    engine.AllocateNetwork(gpu);
    ClassificationReport report = engine.Inspect(image);

    ClassInfo prediction = report.Prediction;
    Console.WriteLine($"Inspection time : {report.InspectionTime}");
    Console.WriteLine($"Predicted : {prediction.Name}");
 }

 image.Dispose();

Methods

Name Value Summary
Inspect(SrImage) ClassificationReport
input에 대한 검사를 진행합니다.
Inspect(SrImage[]) ClassificationReport[]
input에 대한 검사를 진행합니다.
InspectAsync(SrImage, CancellationToken) Task<ClassificationReport>
input에 대한 검사를 진행합니다.