mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:16: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);
|
||||
|
||||
Reference in New Issue
Block a user