-
Notifications
You must be signed in to change notification settings - Fork 56
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
Simplify IRISPipeline
output.
#12
Simplify IRISPipeline
output.
#12
Conversation
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.
Thanks for the change. I think any effort to try to simply the open-source while maintaining the functionality will be greatly appreciated.
colab/GettingStarted.ipynb
Outdated
"\n", | ||
"Each code available in `output[\"iris_template\"]` dictionary is a `numpy.ndarray` of shape `(16, 256, 2, 2)`. The output shape of iris code is determined by `IRISPipeline` filter bank parameters. The iris/mask code shape's dimmensions correspond to the following `(iris_code_height, iris_code_width, num_filters, 2)`. Values `iris_code_height` and `iris_code_width` are determined by `ProbeSchema`s defined for `ConvFilterBank` object and `num_filters` is determined by number of filters specified for `ConvFilterBank` object. The last `2` value of the iris/mask code dimmension corresponds to real and complex parts of each complex filter response.\n", | ||
"Each code available in `output[\"iris_template\"]` object is a `numpy.ndarray` of shape `(16, 256, 2)`. The length of arrays containing iris codes and mask codes is determined by `IRISPipeline` filter bank parameters. The iris/mask code shape's dimmensions correspond to the following `(iris_code_height, iris_code_width, 2)`. Values `iris_code_height` and `iris_code_width` are determined by `ProbeSchema`s defined for `ConvFilterBank` object and `num_filters` is determined by number of filters specified for `ConvFilterBank` object. The last `2` value of the iris/mask code dimmension corresponds to real and complex parts of each complex filter response.\n", |
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.
"to the real and imaginary parts of each complex filter response", "are determined by ProbeSchema's definition for ..."
|
||
Each code available in ``output["iris_template"]`` dictionary is a ``numpy.ndarray`` of shape ``(16, 256, 2, 2)``. The output shape of iris code is determined by ``IRISPipeline`` filter bank parameters. The iris/mask code shape's dimensions correspond to the following ``(iris_code_height, iris_code_width, num_filters, 2)``. Values ``iris_code_height`` and ``iris_code_width`` are determined by ``ProbeSchema``s defined for ``ConvFilterBank`` object and ``num_filters`` is determined by number of filters specified for ``ConvFilterBank`` object. The last ``2`` value of the iris/mask code dimension corresponds to real and complex parts of each complex filter response. | ||
Each code available in ``output["iris_template"]`` dictionary is a ``numpy.ndarray`` of shape ``(16, 256, 2)``. The length of arrays containing iris codes and mask codes is determined by ``IRISPipeline`` filter bank parameters. The iris/mask code shape's dimensions correspond to the following ``(iris_code_height, iris_code_width, 2)``. Values ``iris_code_height`` and ``iris_code_width`` are determined by ``ProbeSchema``s defined for ``ConvFilterBank`` object and ``num_filters`` is determined by number of filters specified for ``ConvFilterBank`` object. The last ``2`` value of the iris/mask code dimension corresponds to real and complex parts of each complex filter response. |
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.
same here: "to the real and imaginary parts of each complex filter response", "are determined by ProbeSchema's definition for ..."
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.
Thanks for the contribution ! One minor comment on simplifying more build_simple_output
, then it will be all good to go 🙌
elif isinstance(exception, Exception): | ||
error = { | ||
"error_type": type(exception).__name__, | ||
"message": str(exception), | ||
"traceback": "".join(traceback.format_tb(exception.__traceback__)), | ||
} |
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.
@wiktorlazarski This is already dealt with in __get_error
, we can simplify this function even 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.
Nice! I completely missed that. Thanks for the hint. That'll allow us to simplify also build_orb_output
function.
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 ! 🙌 🌲
Simplify
IRISPipeline
output.PR description
Currently,
IRISPipeline
returns serialised version of generatedIrisTemplate
that causes confusions and make it less intuitive how one can useHammingDistanceMatcher
. This PR simplifiesIRISPipeline
output such that together withmetadata
, unserialisedIrisTemplate
object is by default returned fromIRISPipeline
inference call.Also, update
ruff
tool setup to remove it's warnings and apply code quality tools to unify code base style etc.Issue
Without knowing more details about inner working of a code base, users find it difficult to simply take two IR images, generate
IrisTemplate
s and useHammingDistanceMatcher
to get final distance between two irises.Solution
Introduce a new builder function that returns
IrisTemplate
object (if error wasn't raised during theIRISPipeline
inference call) andmetadata
in a dictionary.Type
Checklist