Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFSR-885 gender age plugins #281

Merged
merged 5 commits into from
Dec 25, 2020
Merged

EFSR-885 gender age plugins #281

merged 5 commits into from
Dec 25, 2020

Conversation

z268
Copy link
Collaborator

@z268 z268 commented Dec 9, 2020

Change list for the embedding calculator:

  • removed facenet and insightface libraries from embedding_calculator/srcext/, now these install from pypi if necessary
  • split insightface and facenet scanners into separate pluggins
  • added PluginManager for finding plugins dependencies and importing plugins
  • downloader for ML models from URL for plugins
  • added age and gender recognition plugins from
    • insightface (mxnet)
    • rude_carnie (tensorflow)
  • API changes:
    • /status returns a list of availiable plugins with their short names
    • /find_faces accepts argument face_plugins with a comma-separated list of plugins short names (e.g. face_plugins=calculator,age
    • /find_faces returns execution time of each plugin on each detected face

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2020

CLA Assistant Lite bot All contributors have signed the CLA ✍️

@z268 z268 force-pushed the EFRS-885-gender-age-plugins branch from 59f4b80 to 6bdcede Compare December 9, 2020 11:01
@z268 z268 changed the base branch from master to develop December 9, 2020 11:01
@z268 z268 force-pushed the EFRS-885-gender-age-plugins branch 2 times, most recently from 19a29b4 to c895943 Compare December 9, 2020 11:25
@z268 z268 force-pushed the EFRS-885-gender-age-plugins branch 4 times, most recently from f1028fa to c7126c4 Compare December 16, 2020 13:47
@z268 z268 force-pushed the EFRS-885-gender-age-plugins branch from c7126c4 to 27df431 Compare December 17, 2020 07:50
@z268 z268 marked this pull request as ready for review December 17, 2020 07:55
@z268 z268 requested a review from pospielov December 17, 2020 07:55
@z268 z268 force-pushed the EFRS-885-gender-age-plugins branch from 27df431 to 0a6aa79 Compare December 17, 2020 22:41
@z268 z268 force-pushed the EFRS-885-gender-age-plugins branch from 0ea6696 to 3d81d75 Compare December 22, 2020 10:41
@@ -2,7 +2,7 @@ tags:
- Core
summary: 'Find faces in the given image and return their bounding boxes.'
description: 'Returns bounding boxes of detected faces on the image.'
operationId: scanFacesPost
operationId: findFacesPost
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this swagger file? Then I don't see descriptions of gender and age plugins

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a fix of wrong name. Swagger description updated in PR #302

ml_models = (
# links from https://github.com/davidsandberg/facenet#pre-trained-models
# VGGFace2 training set, 0.9965 LFW accuracy
('20180402-114759', 'https://drive.google.com/uc?id=1EXPBSXwTaqrSC0OhUdXNmKSh9qJUQ55-'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are this models stored on our google drive? If not - let's put them to our google drive

IMG_LENGTH_LIMIT = ENV.IMG_LENGTH_LIMIT
class FaceDetector(InsightFaceMixin, base.BaseFaceDetector):
ml_models = (
('retinaface_r50_v1', 'http://insightface.ai/files/models/retinaface_r50_v1.zip'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same - let's store this models in our google drive
Or as an alternative - look at this solution - https://git-lfs.github.com/


class Calculator(InsightFaceMixin, base.BaseCalculator):
ml_models = (
('arcface_r100_v1', 'http://insightface.ai/files/models/arcface_r100_v1.zip'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same - let's store this models in our google drive

class GenderAgeDetector(InsightFaceMixin, base.BasePlugin):
slug = 'gender_age'
ml_models = (
('genderage_v1', 'http://insightface.ai/files/models/genderage_v1.zip'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same - let's store this models in our google drive

slug = 'age'
LABELS = ((0, 2), (4, 6), (8, 12), (15, 20), (25, 32), (38, 43), (48, 53), (60, 100))
ml_models = (
('22801', 'https://drive.google.com/uc?id=1JSggfO1FPu8eM1BeQ6yMG5nKrGbJDyqG'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same - let's store this models in our google drive

slug = 'gender'
LABELS = ('male', 'female')
ml_models = (
('21936', 'https://drive.google.com/uc?id=1Gem2hM6bg746pqgTHQCyNv-Egf3CFgYf'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same - let's store this models in our google drive

@@ -0,0 +1,227 @@
Rude Carnie: Age and Gender Deep Learning with TensorFlow
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to ask for permission or license before adding their code to our repository...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this code until we get permissions

@z268 z268 force-pushed the EFRS-885-gender-age-plugins branch from 491c9fc to d3a40f7 Compare December 25, 2020 11:00
@z268 z268 merged commit d9b4a92 into develop Dec 25, 2020
@z268 z268 deleted the EFRS-885-gender-age-plugins branch December 25, 2020 13:11
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants