AshanGimhana
commited on
Commit
•
5d74497
1
Parent(s):
13a83ac
Update app.py
Browse files
app.py
CHANGED
@@ -52,18 +52,25 @@ age_calc_model = torch.load('Custom_Age_prediction_model.pth')
|
|
52 |
########################################################################
|
53 |
|
54 |
# Download models from Huggingface
|
55 |
-
age_prototxt = hf_hub_download(repo_id="AshanGimhana/Age_Detection_caffe", filename="age.prototxt")
|
56 |
-
caffe_model = hf_hub_download(repo_id="AshanGimhana/Age_Detection_caffe", filename="dex_imdb_wiki.caffemodel")
|
57 |
-
|
58 |
|
59 |
########################################################################
|
60 |
############## caffe model for age calculation #######################
|
61 |
|
|
|
|
|
62 |
# Age prediction model setup
|
63 |
#age_net = cv2.dnn.readNetFromCaffe(age_prototxt, caffe_model)
|
64 |
########################################################################
|
65 |
|
66 |
|
|
|
|
|
|
|
|
|
|
|
67 |
# Face detection and landmarks predictor setup
|
68 |
detector = dlib.get_frontal_face_detector()
|
69 |
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
|
|
|
52 |
########################################################################
|
53 |
|
54 |
# Download models from Huggingface
|
55 |
+
#age_prototxt = hf_hub_download(repo_id="AshanGimhana/Age_Detection_caffe", filename="age.prototxt")
|
56 |
+
#caffe_model = hf_hub_download(repo_id="AshanGimhana/Age_Detection_caffe", filename="dex_imdb_wiki.caffemodel")
|
57 |
+
|
58 |
|
59 |
########################################################################
|
60 |
############## caffe model for age calculation #######################
|
61 |
|
62 |
+
#age_prototxt = hf_hub_download(repo_id="AshanGimhana/Age_Detection_caffe", filename="age.prototxt")
|
63 |
+
#caffe_model = hf_hub_download(repo_id="AshanGimhana/Age_Detection_caffe", filename="dex_imdb_wiki.caffemodel")
|
64 |
# Age prediction model setup
|
65 |
#age_net = cv2.dnn.readNetFromCaffe(age_prototxt, caffe_model)
|
66 |
########################################################################
|
67 |
|
68 |
|
69 |
+
########################################################################################################
|
70 |
+
# Aging model #
|
71 |
+
sam_ffhq_aging = hf_hub_download(repo_id="AshanGimhana/Face_Agin_model", filename="sam_ffhq_aging.pt")
|
72 |
+
########################################################################################################
|
73 |
+
|
74 |
# Face detection and landmarks predictor setup
|
75 |
detector = dlib.get_frontal_face_detector()
|
76 |
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
|