mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:36:30 +00:00
fix split tile size
rework inference events and handling todo: add Medias table and reflect recognition status there
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user