.editorconfig JSON002 Private IDE0230 Use Immich assets for random
This commit is contained in:
@ -167,7 +167,13 @@ public class FaceRecognition : DisposableObject
|
||||
}
|
||||
else
|
||||
{
|
||||
ShapePredictor posePredictor = _PredictorModel switch { PredictorModel.Large => _PosePredictor68Point, PredictorModel.Small => _PosePredictor5Point, _ => throw new Exception() };
|
||||
ShapePredictor posePredictor = _PredictorModel switch
|
||||
{
|
||||
PredictorModel.Large => _PosePredictor68Point,
|
||||
PredictorModel.Small => _PosePredictor5Point,
|
||||
PredictorModel.Custom => throw new NotImplementedException(),
|
||||
_ => throw new Exception()
|
||||
};
|
||||
foreach (Location location in locations)
|
||||
{
|
||||
DlibDotNet.Rectangle rectangle = new(location.Left, location.Top, location.Right, location.Bottom);
|
||||
@ -422,8 +428,10 @@ public class FaceRecognition : DisposableObject
|
||||
faceEncodingToCompare.ThrowIfDisposed();
|
||||
foreach (FaceDistance faceDistance in faceDistances)
|
||||
{
|
||||
#pragma warning disable CA1513
|
||||
if (faceDistance.Encoding is not FaceEncoding faceEncoding || faceEncoding.IsDisposed)
|
||||
throw new ObjectDisposedException($"{nameof(faceDistances)} contains disposed object.");
|
||||
#pragma warning restore CA1513
|
||||
using (Matrix<double> diff = faceEncoding.Encoding - faceEncodingToCompare.Encoding)
|
||||
length = DlibDotNet.Dlib.Length(diff);
|
||||
result = new(faceDistance, length);
|
||||
|
Reference in New Issue
Block a user