mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 20:59:03 +00:00
Add environment variables to disable features
Face detection still needs to be hidden on the frontend if it's disabled
This commit is contained in:
@@ -19,9 +19,13 @@ type FaceDetector struct {
|
||||
imageFaceIDs []int
|
||||
}
|
||||
|
||||
var GlobalFaceDetector FaceDetector
|
||||
var GlobalFaceDetector *FaceDetector = nil
|
||||
|
||||
func InitializeFaceDetector(db *gorm.DB) error {
|
||||
if utils.EnvDisableRawProcessing.GetBool() {
|
||||
log.Printf("Face detection disabled (%s=1)\n", utils.EnvDisableRawProcessing.GetName())
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Println("Initializing face detector")
|
||||
|
||||
@@ -35,7 +39,7 @@ func InitializeFaceDetector(db *gorm.DB) error {
|
||||
return errors.Wrap(err, "get face detection samples from database")
|
||||
}
|
||||
|
||||
GlobalFaceDetector = FaceDetector{
|
||||
GlobalFaceDetector = &FaceDetector{
|
||||
rec: rec,
|
||||
faceDescriptors: faceDescriptors,
|
||||
faceGroupIDs: faceGroupIDs,
|
||||
|
||||
Reference in New Issue
Block a user