Skip to content

Commit

Permalink
EFRS-885 Remove rude-carnie age/gender detection
Browse files Browse the repository at this point in the history
  • Loading branch information
z268 committed Dec 25, 2020
1 parent 7904f29 commit 491c9fc
Show file tree
Hide file tree
Showing 17 changed files with 4 additions and 2,454 deletions.
2 changes: 1 addition & 1 deletion embedding-calculator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ARG GPU_IDX=-1
ENV GPU_IDX=$GPU_IDX INTEL_OPTIMIZATION=$INTEL_OPTIMIZATION
ARG FACE_DETECTION_PLUGIN="facenet.FaceDetector"
ARG CALCULATION_PLUGIN="facenet.Calculator"
ARG EXTRA_PLUGINS="rude_carnie.AgeDetector,rude_carnie.GenderDetector"
ARG EXTRA_PLUGINS=""
ENV FACE_DETECTION_PLUGIN=$FACE_DETECTION_PLUGIN CALCULATION_PLUGIN=$CALCULATION_PLUGIN \
EXTRA_PLUGINS=$EXTRA_PLUGINS
COPY src src
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
from typing import List

import numpy as np
import tensorflow as tf
from tensorflow.python.platform import gfile
from cached_property import cached_property
from facenet.src.align import detect_face

from src.constants import ENV
from src.services.dto.bounding_box import BoundingBoxDTO
Expand Down Expand Up @@ -52,9 +55,6 @@ class FaceDetector(base.BaseFaceDetector):

@cached_property
def _face_detection_nets(self):
import tensorflow as tf
from facenet.src.align import detect_face

with tf.Graph().as_default():
sess = tf.Session()
return _FaceDetectionNets(*detect_face.create_mtcnn(sess, None))
Expand All @@ -63,8 +63,6 @@ def crop_face(self, img: Array3D, box: BoundingBoxDTO) -> Array3D:
return squish_img(crop_img(img, box), (self.IMAGE_SIZE, self.IMAGE_SIZE))

def find_faces(self, img: Array3D, det_prob_threshold: float = None) -> List[BoundingBoxDTO]:
from facenet.src.align import detect_face

if det_prob_threshold is None:
det_prob_threshold = self.det_prob_threshold
assert 0 <= det_prob_threshold <= 1
Expand Down Expand Up @@ -119,8 +117,6 @@ def calc_embedding(self, face_img: Array3D) -> Array3D:

@cached_property
def _embedding_calculator(self):
import tensorflow as tf
from tensorflow.python.platform import gfile
with tf.Graph().as_default() as graph:
graph_def = tf.GraphDef()
with gfile.FastGFile(self.ml_model_file, 'rb') as f:
Expand Down

This file was deleted.

This file was deleted.

227 changes: 0 additions & 227 deletions embedding-calculator/srcext/rude_carnie/README.md

This file was deleted.

Loading

0 comments on commit 491c9fc

Please sign in to comment.