-
Notifications
You must be signed in to change notification settings - Fork 228
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
Lazy Masks / Detections2D #979
Conversation
…ate masks for all objects
…htX32bit int with zero copying
This pull request introduces 1 alert when merging 4da7e68 into 1d35fba - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging c68795e into f9fb7fa - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 84d4f16 into f9fb7fa - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 1dacd77 into ea60106 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging f518057 into dc0f9ec - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 27ac088 into dc0f9ec - view on LGTM.com new alerts:
|
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.
Looks nice! A couple of minor comments here and there, it would be great to have a bit of documentation about the inputs/outputs for some of the more important, user facing, functions.
… all the instancedetections and then an iter()
This pull request introduces 2 alerts when merging a262b25 into 86e58cb - view on LGTM.com new alerts:
|
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, having the type hints is very nice :)!
Currently, when using instance segmentation (
ai2thor.controller.Controller(renderInstanceSegmentation=True)
) instance masks, class masks and 2D detections are generated for every object in the image. This process is quite costly and end-users don't often use every single bounding-box or mask that is generated. This PR introduces lazily generated masks and 2D detections. In the absolute best case, users will get a 4x speed improvement (this means that no masks or 2D detections are generated, but the instance segmentation frame is sent from Unity to Python). In the worst case (we generate all the bounding boxes and masks) users should see a 2x improvement over the current implementation. This speed improvement is largely due to the elimination of the use ofnp.unique
andnp.tile
in favor of a zero-copy based approach. The relevant properties onEvent
are:instance_masks
,class_masks
,instance_detections_2D
, andclass_detections_2D
. All these properties now point to a class that implements theMapping
interface, but the behavior should be identical to the current scheme (i.e. if a key doesn't exist in the lazy-map a KeyError will get thrown). My plan is to merge this in post-ECCV.