Merge remote-tracking branch 'origin/windows-app-annotation-results' into windows-app-annotation-results

This commit is contained in:
Alex Bezdieniezhnykh
2024-11-23 12:45:21 +02:00
2 changed files with 19 additions and 10 deletions
-5
View File
@@ -5,7 +5,6 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<ApplicationIcon>..\logo.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -31,10 +30,6 @@
<PackageReference Include="YoloV8.Gpu" Version="5.0.4" /> <PackageReference Include="YoloV8.Gpu" Version="5.0.4" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Remove="logo.ico" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Azaion.Common\Azaion.Common.csproj" /> <ProjectReference Include="..\Azaion.Common\Azaion.Common.csproj" />
</ItemGroup> </ItemGroup>
+19 -5
View File
@@ -12,7 +12,6 @@ using Azaion.Common.DTO;
using Azaion.Common.DTO.Config; using Azaion.Common.DTO.Config;
using Azaion.Common.Extensions; using Azaion.Common.Extensions;
using Azaion.Common.Services; using Azaion.Common.Services;
using Azaion.Suite.Services;
using Azaion.Dataset; using Azaion.Dataset;
using Azaion.Suite.Services.DTO; using Azaion.Suite.Services.DTO;
using CommandLine; using CommandLine;
@@ -40,7 +39,7 @@ public partial class App
"Azaion.Dataset.dll" "Azaion.Dataset.dll"
]; ];
private static readonly IResourceLoader? ResourceLoader; private static readonly IResourceLoader? ResourceLoader = new ResourceLoader("", "", null!, null!);
static App() static App()
{ {
@@ -48,9 +47,24 @@ public partial class App
var result = Parser.Default.ParseArguments<SuiteCommandLineOptions>(Environment.GetCommandLineArgs()); var result = Parser.Default.ParseArguments<SuiteCommandLineOptions>(Environment.GetCommandLineArgs());
if (result.Errors.Any()) if (result.Errors.Any())
return; return;
ApiConfig apiConfig;
var configStr = File.ReadAllText(Constants.CONFIG_PATH); try
var apiConfig = JsonConvert.DeserializeObject<AppConfig>(configStr)!.ApiConfig; {
if (File.Exists(Constants.CONFIG_PATH))
throw new FileNotFoundException(Constants.CONFIG_PATH);
var configStr = File.ReadAllText(Constants.CONFIG_PATH);
apiConfig = JsonConvert.DeserializeObject<AppConfig>(configStr)!.ApiConfig;
}
catch (Exception e)
{
Console.WriteLine(e);
apiConfig = new ApiConfig
{
Url = "https://api.azaion.com",
RetryCount = 3,
TimeoutSeconds = 40
};
}
var api = new AzaionApiClient(new HttpClient var api = new AzaionApiClient(new HttpClient
{ {
BaseAddress = new Uri(apiConfig.Url), BaseAddress = new Uri(apiConfig.Url),