fix inference UI and annotation saving

This commit is contained in:
Alex Bezdieniezhnykh
2025-01-30 12:33:24 +02:00
parent 62623b7123
commit e7afa96a0b
6 changed files with 47 additions and 163 deletions
+3 -3
View File
@@ -14,12 +14,12 @@ namespace Azaion.Common.Services;
public interface IInferenceService
{
Task RunInference(string mediaPath, Func<AnnotationImage, CancellationToken, Task> processAnnotation, CancellationToken ct = default);
Task RunInference(string mediaPath, Func<AnnotationImage, Task> processAnnotation);
}
public class PythonInferenceService(ILogger<PythonInferenceService> logger, IOptions<AIRecognitionConfig> aiConfigOptions) : IInferenceService
{
public async Task RunInference(string mediaPath, Func<AnnotationImage, CancellationToken, Task> processAnnotation, CancellationToken ct = default)
public async Task RunInference(string mediaPath, Func<AnnotationImage, Task> processAnnotation)
{
using var dealer = new DealerSocket();
var clientId = Guid.NewGuid();
@@ -42,7 +42,7 @@ public class PythonInferenceService(ILogger<PythonInferenceService> logger, IOpt
continue;
}
await processAnnotation(annotationStream, ct);
await processAnnotation(annotationStream);
}
catch (Exception e)
{