mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 12:35:22 +00:00
dlib and lgbm are not must
This commit is contained in:
parent
d62d6d152f
commit
e2fde9157b
@ -4,8 +4,6 @@ import os
|
||||
from os import path
|
||||
from pathlib import Path
|
||||
import numpy as np
|
||||
import lightgbm as lgb #lightgbm==2.3.1
|
||||
|
||||
from deepface.commons import functions, distance as dst
|
||||
|
||||
def loadModel():
|
||||
@ -35,10 +33,16 @@ def validate_model(model):
|
||||
#print("Ensemble learning will be applied for ", found_models," models")
|
||||
valid = True
|
||||
else:
|
||||
raise ValueError("You would like to apply ensemble learning and pass pre-built models but models must contain [VGG-Face, Facenet, OpenFace, DeepFace] but you passed "+found_models)
|
||||
|
||||
missing_ones = set(['VGG-Face', 'Facenet', 'OpenFace', 'DeepFace']) - set(found_models)
|
||||
|
||||
raise ValueError("You'd like to apply ensemble method and pass pre-built models but models must contain [VGG-Face, Facenet, OpenFace, DeepFace] but you passed "+str(found_models)+". So, you need to pass "+str(missing_ones)+" models as well.")
|
||||
|
||||
def build_gbm():
|
||||
|
||||
#this is not a must dependency
|
||||
import lightgbm as lgb #lightgbm==2.3.1
|
||||
|
||||
home = str(Path.home())
|
||||
|
||||
if os.path.isfile(home+'/.deepface/weights/face-recognition-ensemble-model.txt') != True:
|
||||
|
@ -1,4 +1,3 @@
|
||||
import dlib #19.20.0
|
||||
import os
|
||||
import zipfile
|
||||
import bz2
|
||||
@ -9,6 +8,9 @@ from pathlib import Path
|
||||
class DlibResNet:
|
||||
|
||||
def __init__(self):
|
||||
|
||||
#this is not a must dependency
|
||||
import dlib #19.20.0
|
||||
|
||||
self.layers = [DlibMetaData()]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user