Skip to content

Commit

Permalink
Merge pull request #124 from lacmus-foundation/dev
Browse files Browse the repository at this point in the history
0.5.0-preview-1
  • Loading branch information
gosha20777 authored Aug 3, 2021
2 parents 65d47aa + 9d57211 commit 3ebd067
Show file tree
Hide file tree
Showing 141 changed files with 971 additions and 2,502 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnetcore.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet_version: ['2.2.108']
dotnet_version: ['5.0.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified CODE_OF_CONDUCT.md
100644 → 100755
Empty file.
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified Directory.Build.props
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified docs/main_view.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions mk-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ rm -rf ./bin/app/ && rm -rf ./src/bin/Release/
echo "restoring packeges"
dotnet restore
echo -n "building for linux"
dotnet publish --framework netcoreapp3.1 --runtime="linux-x64" -c Release -o ./bin/app/linux
dotnet publish --framework net5.0 --runtime="linux-x64" -c Release -o ./bin/app/linux
echo -n "building for win10"
dotnet publish --framework netcoreapp3.1 --runtime="win10-x64" -c Release -o ./bin/app/win10
dotnet publish --framework net5.0 --runtime="win10-x64" -c Release -o ./bin/app/win10
echo -n "building for osx"
dotnet publish --framework netcoreapp3.1 --runtime="osx-x64" -c Release -o ./bin/app/osx
dotnet publish --framework net5.9 --runtime="osx-x64" -c Release -o ./bin/app/osx
cd ./bin/app/
zip -r -9 ./linux.zip ./linux/
zip -r -9 ./win10.zip ./win10/
Expand Down
1 change: 0 additions & 1 deletion src/App.xaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
-->
<StyleInclude Source="avares://Citrus.Avalonia/Citrus.xaml"/>
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Default.xaml"/>
<StyleInclude Source="avares://ThemeEditor.Controls.ColorPicker/ColorPicker.xaml"/>
<!--
<StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/>
Expand Down
Empty file modified src/App.xaml.cs
100644 → 100755
Empty file.
Empty file modified src/Assets/IsFavorite.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Assets/IsObject.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Assets/IsWatched.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Assets/avalonia-logo.ico
100644 → 100755
Empty file.
Empty file modified src/Assets/lacmus_logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Assets/lacmus_text.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Extensions/AnnotationExtension.cs
100644 → 100755
Empty file.
Empty file modified src/Extensions/AppStatusInfoExtension.cs
100644 → 100755
Empty file.
126 changes: 0 additions & 126 deletions src/Extensions/MLModelConfigExtension.cs

This file was deleted.

Empty file modified src/Extensions/PhotoViewModelExtension.cs
100644 → 100755
Empty file.
Empty file modified src/FodyWeavers.xsd
100644 → 100755
Empty file.
7 changes: 0 additions & 7 deletions src/Interfaces/IContent.cs

This file was deleted.

7 changes: 0 additions & 7 deletions src/Interfaces/IContentLoader.cs

This file was deleted.

7 changes: 0 additions & 7 deletions src/Interfaces/IContentSaver.cs

This file was deleted.

10 changes: 5 additions & 5 deletions src/LacmusApp.csproj
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
<Company>Lacmus Foundation</Company>
<AssemblyVersion>0.4.3.0</AssemblyVersion>
<FileVersion>0.4.3.0</FileVersion>
<AssemblyVersion>0.5.0.1</AssemblyVersion>
<FileVersion>0.5.0.1</FileVersion>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
Expand All @@ -28,7 +28,8 @@
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.12" />
<PackageReference Include="Avalonia.Skia.Linux.Natives" Version="1.68.0.2" />
<PackageReference Include="Citrus.Avalonia" Version="1.2.6" />
<PackageReference Include="Docker.DotNet" Version="3.125.2" />
<PackageReference Include="Flurl" Version="3.0.2" />
<PackageReference Include="LacmusPlugin" Version="2.0.2" />
<PackageReference Include="Material.Avalonia" Version="0.9.0" />
<PackageReference Include="MessageBox.Avalonia" Version="0.9.6.1" />
<PackageReference Include="MetadataExtractor" Version="2.4.3" />
Expand All @@ -41,6 +42,5 @@
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.7.0" />
<PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.9.4" />
</ItemGroup>
</Project>
Empty file modified src/Managers/ApplicationStatusManager.cs
100644 → 100755
Empty file.
Empty file modified src/Managers/ThemeManager.cs
100644 → 100755
Empty file.
Empty file modified src/Models/Annotation.cs
100644 → 100755
Empty file.
93 changes: 50 additions & 43 deletions src/Models/AppConfig.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,48 @@
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Avalonia.Media;
using LacmusApp.Managers;
using LacmusApp.Models.Docker;
using LacmusApp.Models.ML;
using LacmusApp.Services;
using LacmusApp.Services.Files;
using LacmusApp.Models.Plugins;
using LacmusApp.Services.Plugin;
using LacmusPlugin.Enums;
using Newtonsoft.Json;
using Octokit;
using Serilog;
using Language = LacmusApp.Services.Language;
using OperatingSystem = LacmusPlugin.OperatingSystem;
using Version = LacmusPlugin.Version;

namespace LacmusApp.Models
{
[JsonObject]
public class AppConfig
{
private string _borderColor = "#FFFF0000";
private MLModelConfig _mlModelConfig = new MLModelConfig();
private string[] _repositories =
private PluginRepository _repository = new("lacmus", "http://176.99.131.182:80");

private string _configDir =
Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus");
private string _pluginDir =
Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus", "plugins");

private PluginInfo _pluginInfo = new()
{
"gosha20777/lacmus",
"gosha20777/lacmus-kseniia"
Author = "gosha20777",
Company = "Lacmus Foundation",
Description = "Resnet50+deepFPN neural network",
Name = "Lacmus Retinanet",
Tag = "LacmusRetinanetPlugin.Cpu",
Url = "https://github.com/lacmus-foundation/lacmus",
Version = new(api: 2, major: 1, minor: 0),
InferenceType = InferenceType.Cpu,
OperatingSystems = new HashSet<OperatingSystem>()
{
OperatingSystem.LinuxAmd64,
OperatingSystem.WindowsAmd64,
OperatingSystem.OsxAmd64
}
};

public Language Language { get; set; } = Language.English;

public string BorderColor
Expand All @@ -41,28 +61,24 @@ public string BorderColor
}
public ThemeManager.Theme Theme { get; set; }

public string[] Repositories
public PluginRepository Repository
{
get => _repositories;
set
{
if(value == null || value.Length < 1)
{
throw new Exception($"invalid Repositories: {_repositories}");
}
_repositories = value;
}
}
get => _repository;
set => _repository = value;
}

public string PluginDir
{
get => _pluginDir;
set => _pluginDir = value;
}

public MLModelConfig MlModelConfig
public PluginInfo PluginInfo
{
get => _mlModelConfig;
set
{
_mlModelConfig = value ?? throw new Exception($"MlModelConfig is null");
}
get => _pluginInfo;
set => _pluginInfo = value;
}

public async Task Save(string path)
{
try
Expand All @@ -73,6 +89,7 @@ public async Task Save(string path)
Directory.CreateDirectory(dir);
await File.WriteAllTextAsync(path, str);
Log.Debug($"Config saved to {path}.");
Log.Debug(_pluginInfo.Tag);
}
catch (Exception e)
{
Expand All @@ -82,8 +99,7 @@ public async Task Save(string path)

public async Task Save()
{
var confDir = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus");
var configPath = Path.Join(confDir,"appConfig.json");
var configPath = Path.Join(_configDir,"appConfig-v2.json");
await Save(configPath);
}

Expand All @@ -107,20 +123,11 @@ public static AppConfig DeepCopy(AppConfig config)
//deep copy ml config
var newConfig = new AppConfig();
newConfig.Language = config.Language;
newConfig.Repositories = new List<string>(config.Repositories).ToArray();
newConfig.Repository = config.Repository;
newConfig.BorderColor = config.BorderColor;
newConfig.MlModelConfig = new MLModelConfig();
newConfig.MlModelConfig.Accaunt = new DockerAccaunt();
newConfig.MlModelConfig.Accaunt.Email = config.MlModelConfig.Accaunt.Email;
newConfig.MlModelConfig.Accaunt.Password = config.MlModelConfig.Accaunt.Password;
newConfig.MlModelConfig.Accaunt.Username = config.MlModelConfig.Accaunt.Username;
newConfig.MlModelConfig.Image = new DockerImage();
newConfig.MlModelConfig.Image.Name = config.MlModelConfig.Image.Name;
newConfig.MlModelConfig.Image.Tag = config.MlModelConfig.Image.Tag;
newConfig.MlModelConfig.Type = config.MlModelConfig.Type;
newConfig.MlModelConfig.Url = config.MlModelConfig.Url;
newConfig.MlModelConfig.ApiVersion = config.MlModelConfig.ApiVersion;
newConfig.MlModelConfig.ModelVersion = config.MlModelConfig.ModelVersion;
newConfig.Theme = config.Theme;
newConfig.PluginDir = config.PluginDir;
newConfig.PluginInfo = config.PluginInfo;
return newConfig;
}
}
Expand Down
Empty file modified src/Models/AppStatusInfo.cs
100644 → 100755
Empty file.
Loading

0 comments on commit 3ebd067

Please sign in to comment.