mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:46:30 +00:00
add altitude + camera spec component and calc tile size by this
also restrict detections to be no bigger than in classes.json
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Azaion.Common.Services.Inference;
|
||||
|
||||
public interface IInferenceService
|
||||
{
|
||||
Task RunInference(List<string> mediaPaths, int tileSize, CancellationToken ct = default);
|
||||
Task RunInference(List<string> mediaPaths, CameraConfig cameraConfig, CancellationToken ct = default);
|
||||
CancellationTokenSource InferenceCancelTokenSource { get; set; }
|
||||
CancellationTokenSource CheckAIAvailabilityTokenSource { get; set; }
|
||||
void StopInference();
|
||||
@@ -44,14 +44,16 @@ public class InferenceService : IInferenceService
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RunInference(List<string> mediaPaths, int tileSize, CancellationToken ct = default)
|
||||
public async Task RunInference(List<string> mediaPaths, CameraConfig cameraConfig, CancellationToken ct = default)
|
||||
{
|
||||
InferenceCancelTokenSource = new CancellationTokenSource();
|
||||
_client.Send(RemoteCommand.Create(CommandType.Login, _azaionApi.Credentials));
|
||||
|
||||
var aiConfig = _aiConfigOptions.Value;
|
||||
aiConfig.Paths = mediaPaths;
|
||||
aiConfig.TileSize = tileSize;
|
||||
aiConfig.Altitude = (double)cameraConfig.Altitude;
|
||||
aiConfig.CameraFocalLength = (double)cameraConfig.CameraFocalLength;
|
||||
aiConfig.CameraSensorWidth = (double)cameraConfig.CameraSensorWidth;
|
||||
_client.Send(RemoteCommand.Create(CommandType.Inference, aiConfig));
|
||||
|
||||
using var combinedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(ct, InferenceCancelTokenSource.Token);
|
||||
|
||||
@@ -7,10 +7,7 @@ using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Azaion.Common.Services.Inference;
|
||||
|
||||
public class InferenceServiceEventHandler(IInferenceService inferenceService,
|
||||
IAnnotationService annotationService,
|
||||
IMediator mediator,
|
||||
ILogger<InferenceServiceEventHandler> logger) :
|
||||
public class InferenceServiceEventHandler(IInferenceService inferenceService, IAnnotationService annotationService, IMediator mediator) :
|
||||
INotificationHandler<InferenceDataEvent>,
|
||||
INotificationHandler<InferenceStatusEvent>,
|
||||
INotificationHandler<InferenceDoneEvent>
|
||||
|
||||
@@ -13,7 +13,7 @@ public class InferenceDataEvent(AnnotationImage annotationImage) : INotification
|
||||
public class InferenceStatusEvent : INotification
|
||||
{
|
||||
[Key("mn")]
|
||||
public string MediaName { get; set; }
|
||||
public string? MediaName { get; set; }
|
||||
|
||||
[Key("dc")]
|
||||
public int DetectionsCount { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user