Catalog/imagecatalog/ViewModels/AiSettingsViewModel.cs
Maddo e9142df97c
Some checks failed
Build Windows Avalonia / build (push) Failing after 1m48s
Release Windows Avalonia / build (push) Failing after 1m41s
Release Windows Avalonia / release (push) Has been skipped
feat: Enhance Face AI upload functionality and UI
- Updated MainWindow.axaml to increase height and add new UI elements for SSH upload configuration.
- Implemented commands for opening source and destination paths in file explorer.
- Added FaceUploadPath and SSH configuration properties to DataModel and AiSettingsViewModel.
- Introduced validation for FaceUploadPath format and commands for uploading face encoder output.
- Enhanced PickerPreferenceService to manage SSH credentials and upload preferences.
- Updated settings persistence to include FaceUploadPath and SSH preferences.
- Added tests for FaceUploadPath validation and upload command enabling logic.
2026-06-06 11:54:21 +02:00

440 lines
9.5 KiB
C#

using System.Collections.ObjectModel;
using ImageCatalog_2.Models;
namespace ImageCatalog_2.ViewModels;
public class AiSettingsViewModel : ViewModelBase
{
private bool _extractNumbers;
public bool ExtractNumbers
{
get => _extractNumbers;
set
{
_extractNumbers = value;
NotifyPropertyChanged();
}
}
private string _modelsFolderPath = string.Empty;
public string ModelsFolderPath
{
get => _modelsFolderPath;
set
{
_modelsFolderPath = value;
NotifyPropertyChanged();
}
}
private string _csvOutputPath = string.Empty;
public string CsvOutputPath
{
get => _csvOutputPath;
set
{
_csvOutputPath = value;
NotifyPropertyChanged();
}
}
private bool _useNumberAiGpu;
public bool UseNumberAiGpu
{
get => _useNumberAiGpu;
set
{
_useNumberAiGpu = value;
NotifyPropertyChanged();
}
}
private bool _numberAiGpuOptionEnabled;
public bool NumberAiGpuOptionEnabled
{
get => _numberAiGpuOptionEnabled;
set
{
_numberAiGpuOptionEnabled = value;
NotifyPropertyChanged();
}
}
private bool _includeNumberAiThumbnails;
public bool IncludeNumberAiThumbnails
{
get => _includeNumberAiThumbnails;
set
{
_includeNumberAiThumbnails = value;
NotifyPropertyChanged();
}
}
private int _numberAiWorkloadLevel = 3;
public int NumberAiWorkloadLevel
{
get => _numberAiWorkloadLevel;
set
{
_numberAiWorkloadLevel = value;
NotifyPropertyChanged();
}
}
private string _numberAiStatsSummary = string.Empty;
public string NumberAiStatsSummary
{
get => _numberAiStatsSummary;
set
{
_numberAiStatsSummary = value;
NotifyPropertyChanged();
}
}
private string _faceExecutablePath = string.Empty;
public string FaceExecutablePath
{
get => _faceExecutablePath;
set
{
_faceExecutablePath = value;
NotifyPropertyChanged();
}
}
private string _faceOutputFolderPath = string.Empty;
public string FaceOutputFolderPath
{
get => _faceOutputFolderPath;
set
{
_faceOutputFolderPath = value;
NotifyPropertyChanged();
}
}
private string _faceUploadPath = string.Empty;
public string FaceUploadPath
{
get => _faceUploadPath;
set
{
_faceUploadPath = value;
NotifyPropertyChanged();
}
}
private bool _faceUploadDryRun;
public bool FaceUploadDryRun
{
get => _faceUploadDryRun;
set
{
_faceUploadDryRun = value;
NotifyPropertyChanged();
}
}
private string _faceSshUsername = string.Empty;
public string FaceSshUsername
{
get => _faceSshUsername;
set
{
_faceSshUsername = value;
NotifyPropertyChanged();
}
}
private string _faceSshPassword = string.Empty;
public string FaceSshPassword
{
get => _faceSshPassword;
set
{
_faceSshPassword = value;
NotifyPropertyChanged();
}
}
private string _faceSshAddress = string.Empty;
public string FaceSshAddress
{
get => _faceSshAddress;
set
{
_faceSshAddress = value;
NotifyPropertyChanged();
}
}
private string _faceSshPort = "22";
public string FaceSshPort
{
get => _faceSshPort;
set
{
_faceSshPort = value;
NotifyPropertyChanged();
}
}
private string _faceSshPathA = string.Empty;
public string FaceSshPathA
{
get => _faceSshPathA;
set
{
_faceSshPathA = value;
NotifyPropertyChanged();
}
}
private string _faceSshPathB = string.Empty;
public string FaceSshPathB
{
get => _faceSshPathB;
set
{
_faceSshPathB = value;
NotifyPropertyChanged();
}
}
private bool _isFaceUploadRunning;
public bool IsFaceUploadRunning
{
get => _isFaceUploadRunning;
set
{
_isFaceUploadRunning = value;
NotifyPropertyChanged();
}
}
private bool _faceRecursive;
public bool FaceRecursive
{
get => _faceRecursive;
set
{
_faceRecursive = value;
NotifyPropertyChanged();
}
}
private bool _faceIncludeThumbnails;
public bool FaceIncludeThumbnails
{
get => _faceIncludeThumbnails;
set
{
_faceIncludeThumbnails = value;
NotifyPropertyChanged();
}
}
private int _faceParallelism = 3;
public int FaceParallelism
{
get => _faceParallelism;
set
{
_faceParallelism = value;
NotifyPropertyChanged();
}
}
private int _faceMinSize = 35;
public int FaceMinSize
{
get => _faceMinSize;
set
{
_faceMinSize = value;
NotifyPropertyChanged();
}
}
private bool _faceUpsample = true;
public bool FaceUpsample
{
get => _faceUpsample;
set
{
_faceUpsample = value;
NotifyPropertyChanged();
}
}
private bool _faceGpuOptionEnabled;
public bool FaceGpuOptionEnabled
{
get => _faceGpuOptionEnabled;
set
{
_faceGpuOptionEnabled = value;
NotifyPropertyChanged();
}
}
private bool _useFaceGpu;
public bool UseFaceGpu
{
get => _useFaceGpu;
set
{
_useFaceGpu = value;
NotifyPropertyChanged();
}
}
private bool _isFaceEncoderRunning;
public bool IsFaceEncoderRunning
{
get => _isFaceEncoderRunning;
set
{
_isFaceEncoderRunning = value;
NotifyPropertyChanged();
}
}
private string _faceStatusMessage = string.Empty;
public string FaceStatusMessage
{
get => _faceStatusMessage;
set
{
_faceStatusMessage = value;
NotifyPropertyChanged();
}
}
private string _faceCommandOutput = string.Empty;
public string FaceCommandOutput
{
get => _faceCommandOutput;
set
{
_faceCommandOutput = value;
NotifyPropertyChanged();
}
}
private string _faceMatcherExecutablePath = string.Empty;
public string FaceMatcherExecutablePath
{
get => _faceMatcherExecutablePath;
set
{
_faceMatcherExecutablePath = value;
NotifyPropertyChanged();
}
}
private string _faceMatcherEncodingsPath = string.Empty;
public string FaceMatcherEncodingsPath
{
get => _faceMatcherEncodingsPath;
set
{
_faceMatcherEncodingsPath = value;
NotifyPropertyChanged();
}
}
private string _faceMatcherOutputPath = string.Empty;
public string FaceMatcherOutputPath
{
get => _faceMatcherOutputPath;
set
{
_faceMatcherOutputPath = value;
NotifyPropertyChanged();
}
}
private string _faceMatcherLogPath = string.Empty;
public string FaceMatcherLogPath
{
get => _faceMatcherLogPath;
set
{
_faceMatcherLogPath = value;
NotifyPropertyChanged();
}
}
private double _faceMatcherTolerance = 0.5;
public double FaceMatcherTolerance
{
get => _faceMatcherTolerance;
set
{
_faceMatcherTolerance = value;
NotifyPropertyChanged();
}
}
private string _faceMatcherSelectedImagePath = string.Empty;
public string FaceMatcherSelectedImagePath
{
get => _faceMatcherSelectedImagePath;
set
{
_faceMatcherSelectedImagePath = value;
NotifyPropertyChanged();
}
}
private bool _isFaceMatcherRunning;
public bool IsFaceMatcherRunning
{
get => _isFaceMatcherRunning;
set
{
_isFaceMatcherRunning = value;
NotifyPropertyChanged();
}
}
private string _faceMatcherStatusMessage = string.Empty;
public string FaceMatcherStatusMessage
{
get => _faceMatcherStatusMessage;
set
{
_faceMatcherStatusMessage = value;
NotifyPropertyChanged();
}
}
private string _faceMatcherCommandOutput = string.Empty;
public string FaceMatcherCommandOutput
{
get => _faceMatcherCommandOutput;
set
{
_faceMatcherCommandOutput = value;
NotifyPropertyChanged();
}
}
private double _aiProgress;
public double AiProgress
{
get => _aiProgress;
set
{
_aiProgress = value;
NotifyPropertyChanged();
}
}
public ObservableCollection<AiResultItem> PreviewResults { get; } = new();
public ObservableCollection<FaceMatcherResultItem> FaceMatcherResults { get; } = new();
}