Skip to content

Commit c90073f

Browse files
author
David Doukhan
committed
update to have cleaner releases
1 parent 960aa7b commit c90073f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

inaFaceGender/remote_utils.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,30 @@
2828
# inaFaceGender models are stored remotely within github releases
2929
# this code allows to download and use them on demand
3030

31-
url_r1 = 'https://github.com/ina-foss/inaFaceGender/releases/download/models-init/'
32-
url_r2 = 'https://github.com/ina-foss/inaFaceGender/releases/download/models-init-2/'
31+
r1_url = 'https://github.com/ina-foss/inaFaceGender/releases/download/models/'
3332

3433
dmodels = {
3534
# These 2 models are provided for face detection in opencv
3635
# https://raw.githubusercontent.com/opencv/opencv_3rdparty/dnn_samples_face_detector_20180220_uint8/opencv_face_detector_uint8.pb
3736
# https://github.com/opencv/opencv/blob/4eb296655958e9241f43a7bd144d5e63759f6cea/samples/dnn/face_detector/opencv_face_detector.pbtxt
38-
'opencv_face_detector_uint8.pb' : url_r2,
39-
'opencv_face_detector.pbtxt' : url_r2,
37+
'opencv_face_detector_uint8.pb' : r1_url,
38+
'opencv_face_detector.pbtxt' : r1_url,
4039
# Dlib's Facial landmarks prediction
4140
# http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
42-
'shape_predictor_68_face_landmarks.dat' : url_r2,
41+
'shape_predictor_68_face_landmarks.dat' : r1_url,
4342
# Resnet50 architectures trained on FairFace database
44-
'keras_resnet50_fairface_GRA.h5' : url_r1,
45-
'keras_resnet50_fairface.h5' : url_r1,
43+
'keras_resnet50_fairface_GRA.h5' : r1_url,
44+
'keras_resnet50_fairface.h5' : r1_url,
4645
# linear SVM trained on Youtube Faces VGG16 face embeddings
47-
'svm_ytf_zrezgui.hdf5': url_r2,
46+
'svm_ytf_zrezgui.hdf5' : r1_url,
4847
# linear SVM trained on FairFace VGG 16 embeddings
49-
'svm_vgg16_fairface.hdf5': url_r2,
50-
}
51-
48+
'svm_vgg16_fairface.hdf5' : r1_url}
5249

5350
def get_remote(model_fname):
5451
url = dmodels[model_fname]
55-
return get_file(model_fname, url + model_fname)
52+
return get_file(model_fname, url + model_fname, cache_subdir='inaFaceGender')
53+
54+
def download_all():
55+
# usefull at the initalisation of a Docker image
56+
for k in dmodels:
57+
get_remote(k)

0 commit comments

Comments
 (0)