diff --git a/Damselfly.Core/Services/ImageRecognitionService.cs b/Damselfly.Core/Services/ImageRecognitionService.cs index c680087e..6d992ee8 100644 --- a/Damselfly.Core/Services/ImageRecognitionService.cs +++ b/Damselfly.Core/Services/ImageRecognitionService.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Drawing; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -23,50 +22,16 @@ namespace Damselfly.Core.Services; -public class ImageRecognitionService : IPeopleService, IProcessJobFactory, IRescanProvider +public class ImageRecognitionService(IServiceScopeFactory _scopeFactory, + IStatusService _statusService, ObjectDetector _objectDetector, + MetaDataService _metdataService, FaceONNXService _faceOnnxService, + ThumbnailService _thumbService, ConfigService _configService, + ImageClassifier _imageClassifier, ImageCache _imageCache, + WorkService _workService, ExifService _exifService) : IPeopleService, IProcessJobFactory, IRescanProvider { - private readonly ConfigService _configService; - private readonly FaceONNXService _faceOnnxService; - private readonly ExifService _exifService; - private readonly ImageCache _imageCache; - private readonly ImageClassifier _imageClassifier; - private readonly ImageProcessService _imageProcessor; - private readonly MetaDataService _metdataService; - private readonly ObjectDetector _objectDetector; - // WASM: This should be a MemoryCache private readonly IDictionary _peopleCache = new ConcurrentDictionary(); - private readonly IServiceScopeFactory _scopeFactory; - private readonly IStatusService _statusService; - private readonly ThumbnailService _thumbService; - private readonly WorkService _workService; - - public ImageRecognitionService(IServiceScopeFactory scopeFactory, - IStatusService statusService, ObjectDetector objectDetector, - MetaDataService metadataService, FaceONNXService faceOnnxService, - ThumbnailService thumbs, ConfigService configService, - ImageClassifier imageClassifier, ImageCache imageCache, - WorkService workService, ExifService exifService, - ImageProcessService imageProcessor) - { - _scopeFactory = scopeFactory; - _thumbService = thumbs; - _statusService = statusService; - _objectDetector = objectDetector; - _metdataService = metadataService; - _faceOnnxService = faceOnnxService; - _configService = configService; - _imageClassifier = imageClassifier; - _imageProcessor = imageProcessor; - _imageCache = imageCache; - _workService = workService; - _exifService = exifService; - } - - public ImageRecognitionService() - { - } - + public static bool EnableImageRecognition { get; set; } = true; public async Task> GetAllPeople() diff --git a/Damselfly.ML.FaceONNX/FaceONNXService.cs b/Damselfly.ML.FaceONNX/FaceONNXService.cs index 79b5ac4f..4ef229ac 100644 --- a/Damselfly.ML.FaceONNX/FaceONNXService.cs +++ b/Damselfly.ML.FaceONNX/FaceONNXService.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -8,29 +7,18 @@ using Damselfly.Shared.Utils; using FaceEmbeddingsClassification; using FaceONNX; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Microsoft.ML.OnnxRuntime; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; namespace Damselfly.ML.FaceONNX; -public class FaceONNXService : IDisposable +public class FaceONNXService( ILogger _logger): IDisposable { - private readonly ILogger _logger; - private readonly IServiceScopeFactory _scopeFactory; - private FaceDetector _faceDetector; private FaceLandmarksExtractor _faceLandmarksExtractor; private FaceEmbedder _faceEmbedder; private readonly Embeddings _embeddings = new(); - - public FaceONNXService(IServiceScopeFactory scopeFactory, ILogger logger ) - { - _scopeFactory = scopeFactory; - _logger = logger; - } public void Dispose() { diff --git a/Damselfly.Web.Client/wwwroot/version.js b/Damselfly.Web.Client/wwwroot/version.js index e52b9fed..9895f1b5 100644 --- a/Damselfly.Web.Client/wwwroot/version.js +++ b/Damselfly.Web.Client/wwwroot/version.js @@ -1 +1 @@ -const CACHE_VERSION='4.1.0-20240307094413' +const CACHE_VERSION='4.1.0-20240307145827' diff --git a/Directory.Build.props b/Directory.Build.props index 062f4238..695ebe3f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,5 +4,6 @@ true net8.0 CS8603;CS8604;CS8618;IL2121 - + latest + \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props index d1e3b93c..7d072109 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -17,7 +17,6 @@ - diff --git a/Dockerfile b/Dockerfile index 17754977..0b9b7fd5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=webreaper/damselfly-base:1.9.1 +ARG BASE_IMAGE=webreaper/damselfly-base:1.7.1 FROM $BASE_IMAGE as final