mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-17 11:07:36 +08:00
feat(background): add face recognition functionality- Implement face recognition task type and processing
This commit is contained in:
@@ -8,6 +8,7 @@ namespace Foxel.Models.DataBase
|
||||
{
|
||||
PictureProcessing = 0,
|
||||
VisualRecognition = 1,
|
||||
FaceRecognition = 2,
|
||||
}
|
||||
|
||||
public enum TaskExecutionStatus
|
||||
|
||||
24
Models/DataBase/Face.cs
Normal file
24
Models/DataBase/Face.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Foxel.Models.DataBase;
|
||||
|
||||
public class Face : BaseModel
|
||||
{
|
||||
public float[]? Embedding { get; set; }
|
||||
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public int W { get; set; }
|
||||
public int H { get; set; }
|
||||
|
||||
[Range(0.0, 1.0)]
|
||||
public double FaceConfidence { get; set; }
|
||||
|
||||
public int PictureId { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? PersonName { get; set; }
|
||||
[ForeignKey("PictureId")]
|
||||
public Picture Picture { get; set; } = null!;
|
||||
}
|
||||
@@ -48,6 +48,8 @@ public class Picture : BaseModel
|
||||
public Album? Album { get; set; }
|
||||
|
||||
public ICollection<Favorite>? Favorites { get; set; }
|
||||
|
||||
public ICollection<Face>? Faces { get; set; }
|
||||
|
||||
public bool ContentWarning { get; set; } = false;
|
||||
public PermissionType Permission { get; set; } = PermissionType.Public;
|
||||
|
||||
Reference in New Issue
Block a user