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

Integrate app with FaceAPI #59

Merged
merged 18 commits into from Aug 20, 2018

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Member

commented Aug 16, 2018

Also: implement /findsimilar algorithm

@c-w c-w force-pushed the face-api-integration branch from ab909a6 to 5e94c05 Aug 16, 2018

@c-w c-w force-pushed the face-api-integration branch from 63b3f7a to bc4a7a7 Aug 16, 2018

@c-w c-w force-pushed the face-api-integration branch from ecd8b13 to d0b8e63 Aug 17, 2018

large_face_list_id=model_id)
matches.extend(face_matches)

face_id_to_confidence = {} # type: Dict[str, float]

This comment has been minimized.

Copy link
@michaelperel

michaelperel Aug 20, 2018

Collaborator

Is there an advantage to adding types in the comments vs.
face_id_to_confidence: Dict[str, float} = {}? Usually I do not like comments because they go stale, but in this case, the typechecker would pick up it up, so that is not a problem, so genuinely curious if there is an advantage (if it is just style, please feel free to ignore :))

This comment has been minimized.

Copy link
@c-w

c-w Aug 20, 2018

Author Member

Variable annotations were only added in Python 3.6 (see PEP), so using the comment means that the code will also work in Python 3.5.



def delete_models(database_engine):
Base.metadata.drop_all(database_engine)
class ImageStatusEnum(Enum):

This comment has been minimized.

Copy link
@michaelperel

michaelperel Aug 20, 2018

Collaborator

Do these values have meaning or would it possible to use auto()?

This comment has been minimized.

Copy link
@c-w

c-w Aug 20, 2018

Author Member

Yes, definitely. If we stored the enum as an int in the DB, we shouldn't use auto, but we're storing them as strings so auto will be fine. Done in 8744e33.



# pylint: disable=broad-except
@contextmanager

This comment has been minimized.

Copy link
@michaelperel

michaelperel Aug 20, 2018

Collaborator

This is such a good use of contextmanager!

This comment has been minimized.

Copy link
@c-w

c-w Aug 20, 2018

Author Member

Custom context managers are a very nice way to clean up code. Definitely a powerful tool worth learning.

@c-w c-w merged commit 72fa19c into master Aug 20, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@c-w c-w deleted the face-api-integration branch Aug 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.