-
Notifications
You must be signed in to change notification settings - Fork 19
CVS-160560 nanobindings for keypoint detection and segmentation #258
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
Conversation
| nb::class_<InstanceSegmentationResult, ResultBase>(m, "InstanceSegmentationResult") | ||
| .def(nb::init<int64_t, std::shared_ptr<MetaData>>(), nb::arg("frameId") = -1, nb::arg("metaData") = nullptr) | ||
| .def_prop_ro( | ||
| "feature_vector", |
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.
Iseg result also contains a saliency map as a vector of cv::Mat. Perhaps, it's not that easy to expose but there is a chance a vector of nb::ndarray<uint8_t... would work here
| .def_prop_ro( | ||
| "soft_prediction", | ||
| [](ResultBase& r) { | ||
| ImageResultWithSoftPrediction ir = r.asRef<ImageResultWithSoftPrediction>(); |
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.
Would that work if the result entity is actually an ImageResult?
In sseg wrapper now we have the following logic:
if (return_soft_prediction) {
return a ptr to ImageResultWithSoftPrediction
}
else
return a ptr to ImageResult
infer() method's return type is a ptr to ImageResult. I think that kind of design looks weird an overall inconvenient, because we always need to check if type conversion to ImageResultWithSoftPrediction is successful.
Related refactoring can be done in subsequent PR, here we just need to be sure that both the cases return_soft_prediction==true/false are handled correctly
|
Closed as outdated |
What does this PR do?
Ready for python replacement, this will have the same structure results as python version:
Still needs work: