-
Notifications
You must be signed in to change notification settings - Fork 17
Conversation
maxfw/utils/image_utils.py
Outdated
assert sum(encoding[:-1]) == 0, \ | ||
'A Standardize or Normalize transformation must be positioned at the end of the pipeline.' | ||
if sum(encoding[:-1]) != 0: | ||
raise ValueError('A Standardize or Normalize transformation must be positioned at the end of the pipeline.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ValueError('A Standardize or Normalize transformation must be positioned at the end of the pipeline.') | |
raise ValueError('A Standardize or Normalize transformation can only be positioned at the end of the pipeline.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe another if-clause for encoding[-1]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xuhdev something like this:
if sum(encoding[:-1]) != 0 or encoding[-1]:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the error message would be hard to write if done in one if-clause
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this being caught here?
https://github.com/IBM/MAX-Framework/blob/master/maxfw/core/utils.py#L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't look like the same thing to me, maybe @djalova can confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to ask @kmh4321
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC: #34
Co-authored-by: Hong Xu <hong@topbug.net>
Co-authored-by: Brendan Dwyer <brendan.dwyer@ibm.com>
Co-authored-by: Brendan Dwyer <brendan.dwyer@ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bandit
security checksbandit
flask-restplus
toflask-restx