mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 06:36:31 +00:00
add list files for autoupdate feature
put new Versioning fix bugs
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionDate>$([System.DateTime]::UtcNow.ToString("yyyy.MM.dd"))</VersionDate>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalSeconds)))</VersionSeconds>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalMinutes)))</VersionSeconds>
|
||||
|
||||
<AssemblyVersion>$(VersionDate).$(VersionSeconds)</AssemblyVersion>
|
||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||
|
||||
@@ -58,7 +58,7 @@ public class InferenceClient : IInferenceClient
|
||||
|
||||
process.OutputDataReceived += (_, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
|
||||
process.ErrorDataReceived += (_, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
|
||||
// process.Start();
|
||||
process.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ public class LoaderClient(LoaderClientConfig config, ILogger logger, Cancellatio
|
||||
return new MemoryStream(result.Data!);
|
||||
}
|
||||
|
||||
private RemoteCommand SendCommand(RemoteCommand command, int retryCount = 15, int retryDelayMs = 400)
|
||||
private RemoteCommand SendCommand(RemoteCommand command, int retryCount = 50, int retryDelayMs = 800)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -82,7 +82,7 @@ public class LoaderClient(LoaderClientConfig config, ILogger logger, Cancellatio
|
||||
return res;
|
||||
}
|
||||
|
||||
throw new Exception($"Sent {command} {retryCount} times. No response from client.");
|
||||
throw new Exception($"Sent {command} {retryCount} times, with wait time {retryDelayMs}ms for each call. No response from client.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionDate>$([System.DateTime]::UtcNow.ToString("yyyy.MM.dd"))</VersionDate>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalSeconds)))</VersionSeconds>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalMinutes)))</VersionSeconds>
|
||||
|
||||
<AssemblyVersion>$(VersionDate).$(VersionSeconds)</AssemblyVersion>
|
||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||
|
||||
@@ -4,7 +4,7 @@ from PyInstaller.utils.hooks import collect_all
|
||||
|
||||
datas = [('venv\\Lib\\site-packages\\cv2', 'cv2')]
|
||||
binaries = []
|
||||
hiddenimports = ['constants', 'file_data', 'remote_command', 'remote_command_handler', 'annotation', 'loader_client', 'ai_config', 'tensorrt_engine', 'onnx_engine', 'inference_engine', 'inference', 'main-inf']
|
||||
hiddenimports = ['constants', 'file_data', 'loader_client', 'remote_command', 'remote_command_handler', 'annotation', 'loader_client', 'ai_config', 'tensorrt_engine', 'onnx_engine', 'inference_engine', 'inference', 'main-inf']
|
||||
hiddenimports += collect_submodules('cv2')
|
||||
tmp_ret = collect_all('psutil')
|
||||
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
||||
|
||||
@@ -51,12 +51,10 @@ robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "ai_config
|
||||
robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "constants.cp312-win_amd64.pyd" "file_data.cp312-win_amd64.pyd"
|
||||
robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "remote_command.cp312-win_amd64.pyd" "remote_command_handler.cp312-win_amd64.pyd"
|
||||
robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "inference.cp312-win_amd64.pyd" "inference_engine.cp312-win_amd64.pyd"
|
||||
robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "tensorrt_engine.cp312-win_amd64.pyd" "onnx_engine.cp312-win_amd64.pyd" "main_inference.cp312-win_amd64.pyd"
|
||||
robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "loader_client.cp312-win_amd64.pyd" "tensorrt_engine.cp312-win_amd64.pyd"
|
||||
robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "onnx_engine.cp312-win_amd64.pyd" "main_inference.cp312-win_amd64.pyd"
|
||||
|
||||
robocopy "dist\azaion-inference\_internal" "..\dist-dlls\_internal" /E
|
||||
robocopy "dist\azaion-inference" "..\dist-azaion" "azaion-inference.exe" /E
|
||||
|
||||
REM copy for local run
|
||||
robocopy "c:\share\" "dist\azaion-inference\_internal /E
|
||||
robocopy "dist\azaion-inference" "..\dist-azaion" "azaion-inference.exe"
|
||||
|
||||
cd /d %CURRENT_DIR%
|
||||
|
||||
@@ -14,3 +14,11 @@ cdef class UploadFileData(FileData):
|
||||
cdef from_msgpack(bytes data)
|
||||
|
||||
cdef bytes serialize(self)
|
||||
|
||||
cdef class FileList:
|
||||
cdef public list[str] files
|
||||
|
||||
@staticmethod
|
||||
cdef from_msgpack(bytes data)
|
||||
|
||||
cdef bytes serialize(self)
|
||||
@@ -37,4 +37,16 @@ cdef class UploadFileData(FileData):
|
||||
"Resource": self.resource,
|
||||
"Folder": self.folder,
|
||||
"Filename": self.filename
|
||||
})
|
||||
})
|
||||
|
||||
cdef class FileList:
|
||||
def __init__(self, list[str] files):
|
||||
self.files = files
|
||||
|
||||
@staticmethod
|
||||
cdef from_msgpack(bytes data):
|
||||
unpacked = unpackb(data, strict_map_key=False)
|
||||
return FileList(unpacked.get("files"))
|
||||
|
||||
cdef bytes serialize(self):
|
||||
return packb({ "files": self.files })
|
||||
|
||||
@@ -28,7 +28,7 @@ cdef class LoaderClient:
|
||||
return LoadResult(f"Unexpected response command type: {response.command_type}")
|
||||
|
||||
cdef upload_big_small_resource(self, bytes content, str filename, str directory):
|
||||
cdef UploadFileData upload_file_data = UploadFileData(content, filename, directory)
|
||||
cdef UploadFileData upload_file_data = UploadFileData(content, folder=directory, filename=filename)
|
||||
cdef RemoteCommand upload_resp = self._send_receive_command(RemoteCommand(CommandType.UPLOAD_BIG_SMALL, data=upload_file_data.serialize()))
|
||||
if upload_resp.command_type == CommandType.OK:
|
||||
return LoadResult(None, None)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
cdef enum CommandType:
|
||||
OK = 3
|
||||
LOGIN = 10
|
||||
LIST_REQUEST = 15
|
||||
LIST_FILES = 18
|
||||
LOAD = 20
|
||||
LOAD_BIG_SMALL = 22
|
||||
UPLOAD_BIG_SMALL = 24
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import msgpack
|
||||
|
||||
cdef class RemoteCommand:
|
||||
def __init__(self, CommandType command_type, bytes data, str message=None):
|
||||
def __init__(self, CommandType command_type, bytes data=None, str message=None):
|
||||
self.command_type = command_type
|
||||
self.data = data
|
||||
self.message = message
|
||||
|
||||
def __str__(self):
|
||||
command_type_names = {
|
||||
3: "OK",
|
||||
3: "OK",
|
||||
10: "LOGIN",
|
||||
15: "LIST_REQUEST",
|
||||
18: "LIST_FILES",
|
||||
20: "LOAD",
|
||||
22: "LOAD_BIG_SMALL",
|
||||
24: "UPLOAD_BIG_SMALL",
|
||||
|
||||
@@ -14,6 +14,8 @@ cdef class ApiClient:
|
||||
cdef set_token(self, str token)
|
||||
cdef get_user(self)
|
||||
|
||||
cdef post(self, url, json)
|
||||
cdef list_files(self, str folder, str search_file)
|
||||
cdef load_bytes(self, str filename, str folder)
|
||||
cdef upload_file(self, str filename, bytes resource, str folder)
|
||||
cdef load_big_file_cdn(self, str folder, str big_part)
|
||||
|
||||
@@ -97,25 +97,38 @@ cdef class ApiClient:
|
||||
except Exception as e:
|
||||
constants.log(f"Upload fail: {e}")
|
||||
|
||||
cdef list_files(self, str folder, str search_file):
|
||||
response = self.post(f'{self.api_url}/resources/list/{folder}', {
|
||||
"search": search_file
|
||||
})
|
||||
constants.log(<str> f'Get files list by {folder}')
|
||||
return response.json()
|
||||
|
||||
cdef load_bytes(self, str filename, str folder):
|
||||
cdef str hardware = HardwareService.get_hardware_info()
|
||||
hw_hash = Security.get_hw_hash(hardware)
|
||||
key = Security.get_api_encryption_key(self.credentials, hw_hash)
|
||||
payload = json.dumps(
|
||||
{
|
||||
"password": self.credentials.password,
|
||||
"hardware": hardware,
|
||||
"fileName": filename
|
||||
}, indent=4)
|
||||
response = self.post(f'{self.api_url}/resources/get/{folder}', payload)
|
||||
|
||||
resp_bytes = response.raw.read()
|
||||
data = Security.decrypt_to(resp_bytes, key)
|
||||
constants.log(<str>f'Downloaded file: {filename}, {len(data)} bytes')
|
||||
return data
|
||||
|
||||
cdef post(self, url, payload):
|
||||
if self.token is None:
|
||||
self.login()
|
||||
url = f"{self.api_url}/resources/get/{folder}"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {self.token}",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
payload = json.dumps(
|
||||
{
|
||||
"password": self.credentials.password,
|
||||
"hardware": hardware,
|
||||
"fileName": filename
|
||||
}, indent=4)
|
||||
response = requests.post(url, data=payload, headers=headers, stream=True)
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED or response.status_code == HTTPStatus.FORBIDDEN:
|
||||
self.login()
|
||||
@@ -132,18 +145,14 @@ cdef class ApiClient:
|
||||
err_code = res['ErrorCode']
|
||||
err_msg = res['Message']
|
||||
raise Exception(f"Error {err_code}: {err_msg}")
|
||||
|
||||
resp_bytes = response.raw.read()
|
||||
data = Security.decrypt_to(resp_bytes, key)
|
||||
constants.log(<str>f'Downloaded file: {filename}, {len(data)} bytes')
|
||||
return data
|
||||
return response
|
||||
|
||||
cdef load_big_file_cdn(self, str folder, str big_part):
|
||||
print(f'downloading file {folder}\\{big_part} from cdn...')
|
||||
if self.cdn_manager.download(folder, big_part):
|
||||
with open(path.join(<str> folder, big_part), 'rb') as binary_file:
|
||||
encrypted_bytes_big = binary_file.read()
|
||||
# return encrypted_bytes_big
|
||||
return encrypted_bytes_big
|
||||
else:
|
||||
raise Exception(f'Cannot download file {folder}\\{big_part} from CDN!')
|
||||
|
||||
|
||||
@@ -49,6 +49,6 @@ robocopy "dist\azaion-loader\_internal" "..\dist-azaion\_internal" "hardware_ser
|
||||
robocopy "dist\azaion-loader\_internal" "..\dist-azaion\_internal" "main_loader.cp312-win_amd64.pyd"
|
||||
|
||||
robocopy "dist\azaion-loader\_internal" "..\dist-dlls\_internal" /E
|
||||
robocopy "dist\azaion-loader" "..\dist-azaion" "azaion-loader.exe" /E
|
||||
robocopy "dist\azaion-loader" "..\dist-azaion" "azaion-loader.exe"
|
||||
|
||||
cd /d %CURRENT_DIR%
|
||||
@@ -1,6 +1,6 @@
|
||||
import io
|
||||
import os
|
||||
|
||||
cimport constants
|
||||
import boto3
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ cdef class CDNManager:
|
||||
cdef upload(self, str bucket, str filename, bytes file_bytes):
|
||||
try:
|
||||
self.upload_client.upload_fileobj(io.BytesIO(file_bytes), bucket, filename)
|
||||
print(f'uploaded {filename} ({len(file_bytes)} bytes) to the {bucket}')
|
||||
constants.log(f'uploaded {filename} ({len(file_bytes)} bytes) to the {bucket}')
|
||||
return True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -37,7 +37,7 @@ cdef class CDNManager:
|
||||
try:
|
||||
os.makedirs(folder, exist_ok=True)
|
||||
self.download_client.download_file(folder, filename, f'{folder}\\{filename}')
|
||||
print(f'downloaded {filename} from the {folder}')
|
||||
constants.log(f'downloaded {filename} from the {folder}')
|
||||
return True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -13,4 +13,12 @@ cdef class UploadFileData(FileData):
|
||||
@staticmethod
|
||||
cdef from_msgpack(bytes data)
|
||||
|
||||
cdef bytes serialize(self)
|
||||
|
||||
cdef class FileList:
|
||||
cdef public list[str] files
|
||||
|
||||
@staticmethod
|
||||
cdef from_msgpack(bytes data)
|
||||
|
||||
cdef bytes serialize(self)
|
||||
@@ -37,4 +37,16 @@ cdef class UploadFileData(FileData):
|
||||
"Resource": self.resource,
|
||||
"Folder": self.folder,
|
||||
"Filename": self.filename
|
||||
})
|
||||
})
|
||||
|
||||
cdef class FileList:
|
||||
def __init__(self, list[str] files):
|
||||
self.files = files
|
||||
|
||||
@staticmethod
|
||||
cdef from_msgpack(bytes data):
|
||||
unpacked = unpackb(data, strict_map_key=False)
|
||||
return FileList(unpacked.get("files"))
|
||||
|
||||
cdef bytes serialize(self):
|
||||
return packb({ "files": self.files })
|
||||
|
||||
@@ -4,7 +4,7 @@ import traceback
|
||||
from credentials cimport Credentials
|
||||
from remote_command cimport RemoteCommand, CommandType
|
||||
from remote_command_handler cimport RemoteCommandHandler
|
||||
from file_data cimport FileData, UploadFileData
|
||||
from file_data cimport FileData, UploadFileData, FileList
|
||||
from api_client cimport ApiClient
|
||||
|
||||
cdef class CommandProcessor:
|
||||
@@ -47,6 +47,11 @@ cdef class CommandProcessor:
|
||||
file_data = FileData.from_msgpack(command.data)
|
||||
file_bytes = self.api_client.load_bytes(file_data.filename, file_data.folder)
|
||||
self.remote_handler.send(command.client_id, RemoteCommand(CommandType.DATA_BYTES, file_bytes).serialize())
|
||||
elif command.command_type == CommandType.LIST_REQUEST:
|
||||
search_data = FileData.from_msgpack(command.data)
|
||||
list_files = self.api_client.load_bytes(search_data.folder, search_data.filename)
|
||||
file_list_bytes = FileList(list_files).serialize()
|
||||
self.remote_handler.send(command.client_id, RemoteCommand(CommandType.LIST_FILES, file_list_bytes).serialize())
|
||||
elif command.command_type == CommandType.LOAD_BIG_SMALL:
|
||||
data = FileData.from_msgpack(command.data)
|
||||
file_bytes = self.api_client.load_big_small_resource(data.filename, data.folder)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
cdef enum CommandType:
|
||||
OK = 3
|
||||
LOGIN = 10
|
||||
LIST_REQUEST = 15
|
||||
LIST_FILES = 18
|
||||
LOAD = 20
|
||||
LOAD_BIG_SMALL = 22
|
||||
UPLOAD_BIG_SMALL = 24
|
||||
|
||||
@@ -10,6 +10,8 @@ cdef class RemoteCommand:
|
||||
command_type_names = {
|
||||
3: "OK",
|
||||
10: "LOGIN",
|
||||
15: "LIST_REQUEST",
|
||||
18: "LIST_FILES",
|
||||
20: "LOAD",
|
||||
22: "LOAD_BIG_SMALL",
|
||||
24: "UPLOAD_BIG_SMALL",
|
||||
|
||||
+88
-82
@@ -106,100 +106,106 @@ public partial class App
|
||||
|
||||
private void Start(ApiCredentials credentials)
|
||||
{
|
||||
new ConfigUpdater().CheckConfig();
|
||||
var initConfig = SecurityConstants.ReadInitConfig();
|
||||
var apiDir = initConfig.DirectoriesConfig.ApiResourcesDirectory;
|
||||
_loaderClient = new LoaderClient(initConfig.LoaderClientConfig, Log.Logger, _mainCTokenSource.Token);
|
||||
try
|
||||
{
|
||||
new ConfigUpdater().CheckConfig();
|
||||
var initConfig = SecurityConstants.ReadInitConfig();
|
||||
var apiDir = initConfig.DirectoriesConfig.ApiResourcesDirectory;
|
||||
_loaderClient = new LoaderClient(initConfig.LoaderClientConfig, Log.Logger, _mainCTokenSource.Token);
|
||||
|
||||
#if DEBUG
|
||||
_loaderClient.StartClient();
|
||||
#endif
|
||||
_loaderClient.Connect(); //Client app should be already started by LoaderUI
|
||||
_loaderClient.Login(credentials);
|
||||
_loaderClient.StartClient();
|
||||
_loaderClient.Connect(); //Client app should be already started by LoaderUI
|
||||
_loaderClient.Login(credentials);
|
||||
|
||||
var azaionApi = new AzaionApi(new HttpClient { BaseAddress = new Uri(initConfig.InferenceClientConfig.ApiUrl) }, _cache, credentials);
|
||||
var azaionApi = new AzaionApi(new HttpClient { BaseAddress = new Uri(initConfig.InferenceClientConfig.ApiUrl) }, _cache, credentials);
|
||||
|
||||
_host = Host.CreateDefaultBuilder()
|
||||
.ConfigureAppConfiguration((_, config) => config
|
||||
.AddCommandLine(Environment.GetCommandLineArgs())
|
||||
.AddJsonFile(SecurityConstants.CONFIG_PATH, optional: true, reloadOnChange: true)
|
||||
.AddJsonStream(GetSystemConfig(_loaderClient, apiDir))
|
||||
.AddJsonStream(GetSecuredConfig(_loaderClient, apiDir)))
|
||||
.UseSerilog()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
services.AddSingleton<MainSuite>();
|
||||
|
||||
services.Configure<AppConfig>(context.Configuration);
|
||||
services.ConfigureSection<QueueConfig>(context.Configuration);
|
||||
services.ConfigureSection<DirectoriesConfig>(context.Configuration);
|
||||
services.ConfigureSection<AnnotationConfig>(context.Configuration);
|
||||
services.ConfigureSection<AIRecognitionConfig>(context.Configuration);
|
||||
services.ConfigureSection<ThumbnailConfig>(context.Configuration);
|
||||
services.ConfigureSection<UIConfig>(context.Configuration);
|
||||
services.ConfigureSection<MapConfig>(context.Configuration);
|
||||
|
||||
#region External Services
|
||||
|
||||
services.ConfigureSection<LoaderClientConfig>(context.Configuration);
|
||||
services.AddSingleton(_loaderClient);
|
||||
|
||||
services.ConfigureSection<InferenceClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IInferenceClient, InferenceClient>();
|
||||
services.AddSingleton<IInferenceService, InferenceService>();
|
||||
|
||||
services.ConfigureSection<GpsDeniedClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IGpsMatcherClient, GpsMatcherClient>();
|
||||
services.AddSingleton<IGpsMatcherService, GpsMatcherService>();
|
||||
services.AddSingleton<ISatelliteDownloader, SatelliteDownloader>();
|
||||
|
||||
services.AddHttpClient();
|
||||
services.AddSingleton<IAzaionApi>(azaionApi);
|
||||
#endregion
|
||||
|
||||
services.AddSingleton<IConfigUpdater, ConfigUpdater>();
|
||||
services.AddSingleton<Annotator.Annotator>();
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<HelpWindow>();
|
||||
services.AddMediatR(c => c.RegisterServicesFromAssemblies(
|
||||
typeof(Annotator.Annotator).Assembly,
|
||||
typeof(DatasetExplorer).Assembly,
|
||||
typeof(AnnotationService).Assembly));
|
||||
services.AddSingleton<LibVLC>(_ => new LibVLC());
|
||||
services.AddSingleton<FormState>();
|
||||
services.AddSingleton<MediaPlayer>(sp =>
|
||||
_host = Host.CreateDefaultBuilder()
|
||||
.ConfigureAppConfiguration((_, config) => config
|
||||
.AddCommandLine(Environment.GetCommandLineArgs())
|
||||
.AddJsonFile(SecurityConstants.CONFIG_PATH, optional: true, reloadOnChange: true)
|
||||
.AddJsonStream(GetSystemConfig(_loaderClient, apiDir))
|
||||
.AddJsonStream(GetSecuredConfig(_loaderClient, apiDir)))
|
||||
.UseSerilog()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
var libVLC = sp.GetRequiredService<LibVLC>();
|
||||
return new MediaPlayer(libVLC);
|
||||
});
|
||||
services.AddSingleton<AnnotatorEventHandler>();
|
||||
services.AddSingleton<IDbFactory, DbFactory>();
|
||||
services.AddSingleton<MainSuite>();
|
||||
|
||||
services.AddSingleton<FailsafeAnnotationsProducer>();
|
||||
services.Configure<AppConfig>(context.Configuration);
|
||||
services.ConfigureSection<QueueConfig>(context.Configuration);
|
||||
services.ConfigureSection<DirectoriesConfig>(context.Configuration);
|
||||
services.ConfigureSection<AnnotationConfig>(context.Configuration);
|
||||
services.ConfigureSection<AIRecognitionConfig>(context.Configuration);
|
||||
services.ConfigureSection<ThumbnailConfig>(context.Configuration);
|
||||
services.ConfigureSection<UIConfig>(context.Configuration);
|
||||
services.ConfigureSection<MapConfig>(context.Configuration);
|
||||
|
||||
services.AddSingleton<IAnnotationService, AnnotationService>();
|
||||
#region External Services
|
||||
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<IGalleryService, GalleryService>();
|
||||
services.ConfigureSection<LoaderClientConfig>(context.Configuration);
|
||||
services.AddSingleton(_loaderClient);
|
||||
|
||||
services.AddSingleton<IAzaionModule, AnnotatorModule>();
|
||||
services.AddSingleton<IAzaionModule, DatasetExplorerModule>();
|
||||
})
|
||||
.Build();
|
||||
services.ConfigureSection<InferenceClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IInferenceClient, InferenceClient>();
|
||||
services.AddSingleton<IInferenceService, InferenceService>();
|
||||
|
||||
Annotation.InitializeDirs(_host.Services.GetRequiredService<IOptions<DirectoriesConfig>>().Value);
|
||||
_host.Services.GetRequiredService<DatasetExplorer>();
|
||||
// datasetExplorer.Show();
|
||||
// datasetExplorer.Hide();
|
||||
services.ConfigureSection<GpsDeniedClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IGpsMatcherClient, GpsMatcherClient>();
|
||||
services.AddSingleton<IGpsMatcherService, GpsMatcherService>();
|
||||
services.AddSingleton<ISatelliteDownloader, SatelliteDownloader>();
|
||||
|
||||
_mediator = _host.Services.GetRequiredService<IMediator>();
|
||||
services.AddHttpClient();
|
||||
services.AddSingleton<IAzaionApi>(azaionApi);
|
||||
#endregion
|
||||
|
||||
_formState = _host.Services.GetRequiredService<FormState>();
|
||||
DispatcherUnhandledException += OnDispatcherUnhandledException;
|
||||
services.AddSingleton<IConfigUpdater, ConfigUpdater>();
|
||||
services.AddSingleton<Annotator.Annotator>();
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<HelpWindow>();
|
||||
services.AddMediatR(c => c.RegisterServicesFromAssemblies(
|
||||
typeof(Annotator.Annotator).Assembly,
|
||||
typeof(DatasetExplorer).Assembly,
|
||||
typeof(AnnotationService).Assembly));
|
||||
services.AddSingleton<LibVLC>(_ => new LibVLC());
|
||||
services.AddSingleton<FormState>();
|
||||
services.AddSingleton<MediaPlayer>(sp =>
|
||||
{
|
||||
var libVLC = sp.GetRequiredService<LibVLC>();
|
||||
return new MediaPlayer(libVLC);
|
||||
});
|
||||
services.AddSingleton<AnnotatorEventHandler>();
|
||||
services.AddSingleton<IDbFactory, DbFactory>();
|
||||
|
||||
_host.Start();
|
||||
EventManager.RegisterClassHandler(typeof(UIElement), UIElement.PreviewKeyDownEvent, new RoutedEventHandler(GlobalKeyHandler));
|
||||
_host.Services.GetRequiredService<MainSuite>().Show();
|
||||
services.AddSingleton<FailsafeAnnotationsProducer>();
|
||||
|
||||
services.AddSingleton<IAnnotationService, AnnotationService>();
|
||||
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<IGalleryService, GalleryService>();
|
||||
|
||||
services.AddSingleton<IAzaionModule, AnnotatorModule>();
|
||||
services.AddSingleton<IAzaionModule, DatasetExplorerModule>();
|
||||
})
|
||||
.Build();
|
||||
|
||||
Annotation.InitializeDirs(_host.Services.GetRequiredService<IOptions<DirectoriesConfig>>().Value);
|
||||
_host.Services.GetRequiredService<DatasetExplorer>();
|
||||
// datasetExplorer.Show();
|
||||
// datasetExplorer.Hide();
|
||||
|
||||
_mediator = _host.Services.GetRequiredService<IMediator>();
|
||||
|
||||
_formState = _host.Services.GetRequiredService<FormState>();
|
||||
DispatcherUnhandledException += OnDispatcherUnhandledException;
|
||||
|
||||
_host.Start();
|
||||
EventManager.RegisterClassHandler(typeof(UIElement), UIElement.PreviewKeyDownEvent, new RoutedEventHandler(GlobalKeyHandler));
|
||||
_host.Services.GetRequiredService<MainSuite>().Show();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Logger.Error(e, e.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void GlobalKeyHandler(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionDate>$([System.DateTime]::UtcNow.ToString("yyyy.MM.dd"))</VersionDate>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalSeconds)))</VersionSeconds>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalMinutes)))</VersionSeconds>
|
||||
|
||||
<AssemblyVersion>$(VersionDate).$(VersionSeconds)</AssemblyVersion>
|
||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"LoaderClientConfig": {
|
||||
"ZeroMqHost": "127.0.0.1",
|
||||
"ZeroMqPort": 5025,
|
||||
"ApiUrl": "https://api.azaion.com"
|
||||
},
|
||||
"InferenceClientConfig": {
|
||||
"ZeroMqHost": "127.0.0.1",
|
||||
"ZeroMqPort": 5131,
|
||||
"RetryCount": 25,
|
||||
"TimeoutSeconds": 5,
|
||||
"ZeroMqPort": 5127,
|
||||
"ApiUrl": "https://api.azaion.com"
|
||||
},
|
||||
"GpsDeniedClientConfig": {
|
||||
"ZeroMqHost": "127.0.0.1",
|
||||
"ZeroMqPort": 5555,
|
||||
"ZeroMqReceiverPort": 5556,
|
||||
"RetryCount": 25,
|
||||
"TimeoutSeconds": 5
|
||||
"ZeroMqReceiverPort": 5556
|
||||
},
|
||||
"DirectoriesConfig": {
|
||||
"ApiResourcesDirectory": "",
|
||||
|
||||
@@ -10,6 +10,8 @@ if exist dist-dlls rmdir dist-dlls /s /q
|
||||
mkdir dist-dlls
|
||||
if exist dist-azaion rmdir dist-azaion /s /q
|
||||
mkdir dist-azaion
|
||||
if exist dist rmdir dist /s /q
|
||||
mkdir dist
|
||||
|
||||
echo Copying shared libs
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
#define MyAppVersion GetFileVersion("..\dist-azaion\Azaion.Suite.exe")
|
||||
|
||||
[Setup]
|
||||
AppId={{CCFEC8E2-0FCC-4B03-8EEA-00AF20D265E5}}
|
||||
AppName=Azaion Suite
|
||||
AppVersion=1.5.0
|
||||
AppPublisher=Azaion Ukraine
|
||||
AppVersion={#MyAppVersion}
|
||||
VersionInfoVersion={#MyAppVersion}
|
||||
AppPublisher=Azaion LLC
|
||||
DefaultDirName={localappdata}\Azaion\Azaion Suite
|
||||
DefaultGroupName=Azaion Suite
|
||||
OutputDir=..\
|
||||
OutputBaseFilename=AzaionSuite.Iterative.1.5.0
|
||||
OutputBaseFilename=AzaionSuite.Iterative.{#MyAppVersion}
|
||||
SetupIconFile=..\dist-azaion\logo.ico
|
||||
UninstallDisplayName=Azaion Suite
|
||||
UninstallDisplayIcon={app}\Azaion.Suite.exe
|
||||
|
||||
+4
-1
@@ -1,10 +1,13 @@
|
||||
@echo off
|
||||
rem
|
||||
@echo off
|
||||
pushd %~dp0..
|
||||
|
||||
call build\init
|
||||
|
||||
call build\build_dotnet
|
||||
|
||||
call Azaion.Loader\build_loader
|
||||
|
||||
call Azaion.Inference\build_inference
|
||||
|
||||
call ..\gps-denied\image-matcher\build_gps
|
||||
|
||||
Reference in New Issue
Block a user