Class DetectionEngine
Detection을 수행할 수 있는 Engine입니다.
Inheritance
object
DetectionEngine
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SaigeVision.Core.Inference
Assembly: SaigeVision.Core.Inference.dll
Syntax
public sealed class DetectionEngine : InspectionEngine<EngineMetadata, DetTrainingOptions, DetInspectionOptions>, IDisposable
Remarks
SaigeVision이 제공하는 '트레이너'를 통해 훈련된 'Object detection model'을 사용하여 Detection을 수행할 수 있는 Engine을 제공합니다.
해당 Engine은 DetInspectionOptions를 통해 검사에 대한 몇가지 옵션을 지정 할 수 있습니다.
Examples
다음을 샘플 이미지 한장에 대한 Detection을 수행하는 방법을 설명합니다.
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(DetectionEngine),model))
{
engine.AllocateNetwork(gpu);
DetectionReport report = engine.Inspect(image);
DetectionReport report = engine.Inspect(data);
Console.WriteLine($"Number of detected boxes: {report.Prediction.Count}");
foreach (var box in report.Prediction)
{
Console.WriteLine("------------------------");
Console.WriteLine($"Labeled class name: {box.Class.Name}");
Console.WriteLine($"Bounds: {box.Bounds}");
Console.WriteLine($"Score: {box.Score}");
}
}
image.Dispose();
Methods
View SourceInspect(SrImage)
input에 대한 검사를 진행합니다.
Declaration
public DetectionReport Inspect(SrImage input)
Parameters
| Type | Name | Description |
|---|---|---|
| SrImage | input |
Returns
| Type | Description |
|---|---|
| DetectionReport | 검사 결과. |
See Also
View SourceInspectAsync(SrImage, CancellationToken)
input에 대한 검사를 진행합니다.
Declaration
public Task<DetectionReport> InspectAsync(SrImage input, CancellationToken token = default)
Parameters
| Type | Name | Description |
|---|---|---|
| SrImage | input | 검사할 이미지. |
| CancellationToken | token | 검사 취소 토큰. |
Returns
| Type | Description |
|---|---|
| Task<DetectionReport> | 검사 결과. |
See Also
Implements
System.IDisposable