fix split tile size

rework inference events and handling
todo: add Medias table and reflect recognition status there
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-09-05 16:50:09 +03:00
parent 7d68f7faee
commit 9a16099194
14 changed files with 86 additions and 47 deletions
@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.Text;
using Azaion.Common.Database;
using Azaion.Common.DTO;
using MediatR;
using MessagePack;
@@ -49,7 +50,7 @@ public class InferenceClient : IInferenceClient
Arguments = $"-p {_inferenceClientConfig.ZeroMqPort} -lp {_loaderClientConfig.ZeroMqPort} -a {_inferenceClientConfig.ApiUrl}",
CreateNoWindow = true
};
process.Start();
//process.Start();
}
catch (Exception e)
{
@@ -75,7 +76,15 @@ public class InferenceClient : IInferenceClient
switch (remoteCommand.CommandType)
{
case CommandType.InferenceData:
await _mediator.Publish(new InferenceDataEvent(remoteCommand), ct);
var annotationImage = MessagePackSerializer.Deserialize<AnnotationImage>(remoteCommand.Data, cancellationToken: ct);
await _mediator.Publish(new InferenceDataEvent(annotationImage), ct);
break;
case CommandType.InferenceStatus:
var statusEvent = MessagePackSerializer.Deserialize<InferenceStatusEvent>(remoteCommand.Data, cancellationToken: ct);
await _mediator.Publish(statusEvent, ct);
break;
case CommandType.InferenceDone:
await _mediator.Publish(new InferenceDoneEvent(), ct);
break;
case CommandType.AIAvailabilityResult:
var aiAvailabilityStatus = MessagePackSerializer.Deserialize<AIAvailabilityStatusEvent>(remoteCommand.Data, cancellationToken: ct);