mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
add generating result image to Results directory
This commit is contained in:
@@ -30,6 +30,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
|
||||
private readonly IAuthProvider _authProvider;
|
||||
private readonly QueueConfig _queueConfig;
|
||||
private Consumer _consumer = null!;
|
||||
private readonly UIConfig _uiConfig;
|
||||
private static readonly Guid SaveTaskId = Guid.NewGuid();
|
||||
|
||||
public AnnotationService(
|
||||
@@ -37,6 +38,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
|
||||
IDbFactory dbFactory,
|
||||
FailsafeAnnotationsProducer producer,
|
||||
IOptions<QueueConfig> queueConfig,
|
||||
IOptions<UIConfig> uiConfig,
|
||||
IGalleryService galleryService,
|
||||
IMediator mediator,
|
||||
IHardwareService hardwareService,
|
||||
@@ -49,6 +51,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
|
||||
_hardwareService = hardwareService;
|
||||
_authProvider = authProvider;
|
||||
_queueConfig = queueConfig.Value;
|
||||
_uiConfig = uiConfig.Value;
|
||||
|
||||
Task.Run(async () => await Init()).Wait();
|
||||
}
|
||||
@@ -184,7 +187,12 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
|
||||
}
|
||||
await YoloLabel.WriteToFile(detections, annotation.LabelPath, token);
|
||||
if (generateThumbnail)
|
||||
{
|
||||
await _galleryService.CreateThumbnail(annotation, token);
|
||||
if (_uiConfig.GenerateAnnotatedImage)
|
||||
await _galleryService.CreateAnnotatedImage(annotation, token);
|
||||
}
|
||||
|
||||
|
||||
if (!fromQueue) //Send to queue only if we're not getting from queue already
|
||||
await _producer.SendToInnerQueue(annotation, token);
|
||||
|
||||
Reference in New Issue
Block a user