mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 20:45: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 os import path
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import lightgbm as lgb #lightgbm==2.3.1
|
|
||||||
|
|
||||||
from deepface.commons import functions, distance as dst
|
from deepface.commons import functions, distance as dst
|
||||||
|
|
||||||
def loadModel():
|
def loadModel():
|
||||||
@ -35,10 +33,16 @@ def validate_model(model):
|
|||||||
#print("Ensemble learning will be applied for ", found_models," models")
|
#print("Ensemble learning will be applied for ", found_models," models")
|
||||||
valid = True
|
valid = True
|
||||||
else:
|
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():
|
def build_gbm():
|
||||||
|
|
||||||
|
#this is not a must dependency
|
||||||
|
import lightgbm as lgb #lightgbm==2.3.1
|
||||||
|
|
||||||
home = str(Path.home())
|
home = str(Path.home())
|
||||||
|
|
||||||
if os.path.isfile(home+'/.deepface/weights/face-recognition-ensemble-model.txt') != True:
|
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 os
|
||||||
import zipfile
|
import zipfile
|
||||||
import bz2
|
import bz2
|
||||||
@ -10,6 +9,9 @@ class DlibResNet:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
|
#this is not a must dependency
|
||||||
|
import dlib #19.20.0
|
||||||
|
|
||||||
self.layers = [DlibMetaData()]
|
self.layers = [DlibMetaData()]
|
||||||
|
|
||||||
#---------------------
|
#---------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user