mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 13:06:31 +00:00
add db WIP 2, 80%
refactor, renames
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Azaion.Annotator;
|
||||
|
||||
public interface IAIDetector
|
||||
{
|
||||
Task<List<Detection>> Detect(Stream imageStream, CancellationToken cancellationToken = default);
|
||||
Task<List<Detection>> Detect(string fName, Stream imageStream, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public class YOLODetector(IOptions<AIRecognitionConfig> recognitionConfig, IResourceLoader resourceLoader) : IAIDetector, IDisposable
|
||||
@@ -25,7 +25,7 @@ public class YOLODetector(IOptions<AIRecognitionConfig> recognitionConfig, IReso
|
||||
private const string YOLO_MODEL = "azaion.onnx";
|
||||
|
||||
|
||||
public async Task<List<Detection>> Detect(Stream imageStream, CancellationToken cancellationToken)
|
||||
public async Task<List<Detection>> Detect(string fName, Stream imageStream, CancellationToken cancellationToken)
|
||||
{
|
||||
if (_predictor == null)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ public class YOLODetector(IOptions<AIRecognitionConfig> recognitionConfig, IReso
|
||||
var detections = result.Select(d =>
|
||||
{
|
||||
var label = new YoloLabel(new CanvasLabel(d.Name.Id, d.Bounds.X, d.Bounds.Y, d.Bounds.Width, d.Bounds.Height), imageSize, imageSize);
|
||||
return new Detection(label, (double?)d.Confidence * 100);
|
||||
return new Detection(fName, label, (double?)d.Confidence * 100);
|
||||
}).ToList();
|
||||
|
||||
return FilterOverlapping(detections);
|
||||
|
||||
Reference in New Issue
Block a user