-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Enhance AssignResult and SamplingResult #1995
Enhance AssignResult and SamplingResult #1995
Conversation
Thanks for the PR as well as previous ones! ubelt is indeed an excellent util library, but it may be too early to introduce it since we only need two methods/classes of it. We can redefine |
Add runtime dependency on ubelt (pending approval) Fix issue in SamplingResult.__init__ Add rng as attribute of RandomSampler
6811333
to
e73f65d
Compare
Sounds good. I removed ubelt as a dependency. Instead of redefining I was also using |
* origin/viame/master: (28 commits) Fix FPN upscale Extra compiler args VIAME-specific build parameters Bump version to 1.0.0 (open-mmlab#2029) Fix the incompatibility of the latest numpy and pycocotools (open-mmlab#2024) format configs with yapf (open-mmlab#2023) options for FCNMaskHead during testtime (open-mmlab#2013) Enhance AssignResult and SamplingResult (open-mmlab#1995) Fix typo activatation -> activation (open-mmlab#2007) Reorganize requirements, make albumentations optional (open-mmlab#1969) Encapsulate DCN into a ConvModule & Conv_layers (open-mmlab#1894) Code for Paper "Bridging the Gap Between Anchor-based and Anchor-free… (open-mmlab#1872) Non color images (open-mmlab#1976) Fix albu mask format bug (open-mmlab#1818) Fix CI by limiting the version of torchvision (open-mmlab#2005) Add ability to overwite existing module in Registry (open-mmlab#1982) bug for distributed training (open-mmlab#1985) Update Libra RetinaNet config with the latest code (open-mmlab#1975) Fix issue in refine_bboxes and add doctest (open-mmlab#1962) add link to official repo (open-mmlab#1971) ...
* Enhance AssignResult and SamplingResult Add runtime dependency on ubelt (pending approval) Fix issue in SamplingResult.__init__ Add rng as attribute of RandomSampler * fix linters * remove ubelt * Fix linters * fix linters again
* Enhance AssignResult and SamplingResult Add runtime dependency on ubelt (pending approval) Fix issue in SamplingResult.__init__ Add rng as attribute of RandomSampler * fix linters * remove ubelt * Fix linters * fix linters again
* Enhance AssignResult and SamplingResult Add runtime dependency on ubelt (pending approval) Fix issue in SamplingResult.__init__ Add rng as attribute of RandomSampler * fix linters * remove ubelt * Fix linters * fix linters again
Added
random
classmethods to SamplingResult and AssignResult.These allow for the simple creation of "demo data" that can be use for testing, debugging, and potentially more (although I don't think these are as useful as random boxes might be).
Fix issue in
SamplingResult.__init__
I've been hitting issues where sometimes
gt_bboxes
looks like its had its dimensions squashed. This causes an error when doing the index selection. Adding two checks fixes it.Add rng as attribute of RandomSampler
To ensure that the new random methods could be seeded to consistently reproduce an issue if needed, I had to ensure that the
RandomSampler
class could be seeded. I usedensure_rng
, which I added in a previous PR to accomplish this simplify.Misc
I also added a
to
function toSamplingResult
, where it moves the data onto a different device. I wrote this to test something that turned out not to be an issue, but I figure its a nice API to have so I left it in.I also added
info
properties to SamplingResult and RandomSampler as well as implementing the__nice__
debugging string for SamplingResult.I did end up using my ubelt library to accomplish some of these tasks. The core fix and the random clasmethods don't rely on ubelt, so if there is any resistance to adding a dependency I can remove the features that depend on ubelt and still have a functionally useful PR. However, I've been maintaining and keeping ubelt stable for ~2 years, it has 100% test coverage, it itself is fairly small, and its own dependencies are minimal.