44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using ImageCatalog_2.Models;
|
|
|
|
namespace ImageCatalog_2.Services;
|
|
|
|
public sealed class AiExtractionRequest
|
|
{
|
|
public required string SearchRoot { get; init; }
|
|
public required bool Recursive { get; init; }
|
|
public bool IncludeThumbnails { get; init; }
|
|
public required string ModelsFolderPath { get; init; }
|
|
public bool UseGpu { get; init; }
|
|
public int WorkloadLevel { get; init; } = 3;
|
|
public string CsvOutputPath { get; init; } = string.Empty;
|
|
}
|
|
|
|
public sealed record AiExtractionProgressUpdate(
|
|
int TotalFiles,
|
|
int ProcessedFiles,
|
|
double PercentComplete,
|
|
double AverageImagesPerSecond,
|
|
int WorkloadLevel,
|
|
int WorkerCount,
|
|
bool UseGpu);
|
|
|
|
public sealed record AiExtractionRunSummary(
|
|
int TotalFiles,
|
|
int ProcessedFiles,
|
|
int FailedFiles,
|
|
double AverageImagesPerSecond,
|
|
int WorkloadLevel,
|
|
int WorkerCount,
|
|
bool UseGpu);
|
|
|
|
public interface IAiExtractionService
|
|
{
|
|
Task<AiExtractionRunSummary> RunAsync(
|
|
AiExtractionRequest request,
|
|
CancellationToken token,
|
|
Func<AiResultItem, Task> onResult,
|
|
Func<AiExtractionProgressUpdate, Task> onProgress);
|
|
}
|