Make face detection optional at build-time (#881)

Add a "no_face_detection" build tag to disable face detection
when building. This is useful when installing the face detection
dependencies is undesirable and cuts down build times (e.g. on a
Raspberry Pi).
This commit is contained in:
Simon Ser
2024-04-11 23:20:09 +02:00
committed by GitHub
parent 896cd1c2fe
commit d0d0bf21bc
4 changed files with 324 additions and 294 deletions

View File

@@ -9,7 +9,6 @@ import (
"strconv"
"strings"
"github.com/Kagami/go-face"
"github.com/photoview/photoview/api/database/drivers"
"github.com/photoview/photoview/api/scanner/media_encoding/media_utils"
"gorm.io/gorm"
@@ -45,7 +44,7 @@ func (f *ImageFace) FillMedia(db *gorm.DB) error {
return nil
}
type FaceDescriptor face.Descriptor
type FaceDescriptor [128]float32 // same as go-face's Descriptor
// GormDataType datatype used in database
func (FaceDescriptor) GormDBDataType(db *gorm.DB, field *schema.Field) string {