Conversation
ab909a6 to
5e94c05
Compare
63b3f7a to
bc4a7a7
Compare
Since there are no static files to host, no access control to apply, no special routing, etc, the indirection doesn't buy us much.
ecd8b13 to
d0b8e63
Compare
| large_face_list_id=model_id) | ||
| matches.extend(face_matches) | ||
|
|
||
| face_id_to_confidence = {} # type: Dict[str, float] |
There was a problem hiding this comment.
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 :))
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Do these values have meaning or would it possible to use auto()?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
This is such a good use of contextmanager!
There was a problem hiding this comment.
Custom context managers are a very nice way to clean up code. Definitely a powerful tool worth learning.
Also: implement /findsimilar algorithm