diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-16 01:14:40 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-16 01:14:40 +0100 |
| commit | f9616b08ce0fa8ab5d60b544b5c0ad1212f201b8 (patch) | |
| tree | df2036f710122c9f4979785c643b76622b7c5989 /megapixels/app/processors | |
| parent | 63335120a5800142ebe827bd10a1a0106c24b8d8 (diff) | |
| parent | 10f467b64e3be528ac246d5cf664d675aca3e7f3 (diff) | |
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'megapixels/app/processors')
| -rw-r--r-- | megapixels/app/processors/face_age.py | 28 | ||||
| -rw-r--r-- | megapixels/app/processors/face_beauty.py | 27 | ||||
| -rw-r--r-- | megapixels/app/processors/face_emotion.py | 28 | ||||
| -rw-r--r-- | megapixels/app/processors/face_gender.py | 27 | ||||
| -rw-r--r-- | megapixels/app/processors/face_landmarks_3d.py | 27 | ||||
| -rw-r--r-- | megapixels/app/processors/face_mesh.py | 27 |
6 files changed, 164 insertions, 0 deletions
diff --git a/megapixels/app/processors/face_age.py b/megapixels/app/processors/face_age.py new file mode 100644 index 00000000..222858a5 --- /dev/null +++ b/megapixels/app/processors/face_age.py @@ -0,0 +1,28 @@ +import os +from os.path import join +from pathlib import Path +import math + +import cv2 as cv +import numpy as np +import imutils + +from app.utils import im_utils, logger_utils +from app.models.bbox import BBox +from app.settings import app_cfg as cfg +from app.settings import types + + + +class FaceAge: + + # Estimates face age + + def __init__(self): + self.log = logger_utils.Logger.getLogger() + pass + + + def age(self): + # use enum typed emotions + return {'age': types.Age.ADULT, 'confidence': 0.5}
\ No newline at end of file diff --git a/megapixels/app/processors/face_beauty.py b/megapixels/app/processors/face_beauty.py new file mode 100644 index 00000000..a1ddd9f8 --- /dev/null +++ b/megapixels/app/processors/face_beauty.py @@ -0,0 +1,27 @@ +import os +from os.path import join +from pathlib import Path +import math + +import cv2 as cv +import numpy as np +import imutils + +from app.utils import im_utils, logger_utils +from app.models.bbox import BBox +from app.settings import app_cfg as cfg +from app.settings import types + + + +class FaceBeauty: + + # Estimates beauty using CNN + + def __init__(self): + self.log = logger_utils.Logger.getLogger() + pass + + + def beauty(self): + return 0.5
\ No newline at end of file diff --git a/megapixels/app/processors/face_emotion.py b/megapixels/app/processors/face_emotion.py new file mode 100644 index 00000000..c45da9ba --- /dev/null +++ b/megapixels/app/processors/face_emotion.py @@ -0,0 +1,28 @@ +import os +from os.path import join +from pathlib import Path +import math + +import cv2 as cv +import numpy as np +import imutils + +from app.utils import im_utils, logger_utils +from app.models.bbox import BBox +from app.settings import app_cfg as cfg +from app.settings import types + + + +class FaceEmotion: + + # Estimates face emotion + + def __init__(self): + self.log = logger_utils.Logger.getLogger() + pass + + + def emotion(self): + # use enum typed emotions + return {'emotion': types.Emotion.NEUTRAL, 'confidence': 0.5}
\ No newline at end of file diff --git a/megapixels/app/processors/face_gender.py b/megapixels/app/processors/face_gender.py new file mode 100644 index 00000000..ee152098 --- /dev/null +++ b/megapixels/app/processors/face_gender.py @@ -0,0 +1,27 @@ +import os +from os.path import join +from pathlib import Path +import math + +import cv2 as cv +import numpy as np +import imutils + +from app.utils import im_utils, logger_utils +from app.models.bbox import BBox +from app.settings import app_cfg as cfg +from app.settings import types + + + +class FaceGender: + + # Estimates gender using CNN + + def __init__(self): + self.log = logger_utils.Logger.getLogger() + pass + + + def gender(self): + return 'm'
\ No newline at end of file diff --git a/megapixels/app/processors/face_landmarks_3d.py b/megapixels/app/processors/face_landmarks_3d.py new file mode 100644 index 00000000..84a423b0 --- /dev/null +++ b/megapixels/app/processors/face_landmarks_3d.py @@ -0,0 +1,27 @@ +import os +from os.path import join +from pathlib import Path +import math + +import cv2 as cv +import numpy as np +import imutils + +from app.utils import im_utils, logger_utils +from app.models.bbox import BBox +from app.settings import app_cfg as cfg +from app.settings import types + + + +class FaceLandmarks3D: + + # Estimates 3D facial landmarks + + def __init__(self): + self.log = logger_utils.Logger.getLogger() + pass + + + def landmarks(self): + return [1,2,3,4,100]
\ No newline at end of file diff --git a/megapixels/app/processors/face_mesh.py b/megapixels/app/processors/face_mesh.py new file mode 100644 index 00000000..2d3deb4f --- /dev/null +++ b/megapixels/app/processors/face_mesh.py @@ -0,0 +1,27 @@ +import os +from os.path import join +from pathlib import Path +import math + +import cv2 as cv +import numpy as np +import imutils + +from app.utils import im_utils, logger_utils +from app.models.bbox import BBox +from app.settings import app_cfg as cfg +from app.settings import types + + + +class FaceMesh3D: + + # Estimates 3D face mesh + + def __init__(self): + self.log = logger_utils.Logger.getLogger() + pass + + + def mesh(self): + return [1,2,3,4,100]
\ No newline at end of file |
