Skip to content
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

No 2D bounding box on parent when all child objects are labelled. #375

Closed
ragnar-code opened this issue Sep 23, 2021 · 2 comments
Closed

Comments

@ragnar-code
Copy link

Hi, I’m currently working on a vehicle detection algorithm. I currently have a gameobject "car" that is composed of children that are "body", the "wheels" and "spoiler". The children all have a mesh and meshrenderer, they also each have a label. Finally the car also has a label. The perception camera detects and draws correctly the bounding boxes for the children but not for the parent. This is a big problem for me because I want to be able to have a dataset with a bounding box for the car and its components such as wheels, doors, etc. I already have tried different workarounds.

I first followed this: #151
So I tried to create a big transparent cube covering the whole vehicle, then labelled the cube, the label is displayed for the whole vehicle as wished but as the cube covers the rest of the other subsets they are therefore not detected.

I also tried to merge all the child object meshes into one, but the resulting bounding box was completely wrong if I didn’t delete the child meshes but then I didn’t have the bounding boxes on the child objects. And as I said I need the bounding boxes on the child objects and the parent object.

So the question is how can I have the children game objects and the parent game object all have a 2D bounding box?

@JonathanHUnity
Copy link
Contributor

Having a single object contribute to multiple bounding boxes at once is not currently supported. I have two suggestions for working around this:

First, you could record the combinations of wheels, body, and spoiler that contribute to a single 'car' and combine their bounding boxes in a post-processing python script.

Or, you can render the camera twice (or have two cameras), ensuring only the Labeling components on the cars are enabled for the first render and ensure only the child Labeling components are enabled for the second. You can control the order of rendering by calling Camera.Render() explicitly, instead of having the camera enabled (and thus render automatically).

There are ways the labeling could be updated to support this kind of use case, so we will send this to the engineering team.

@ragnar-code
Copy link
Author

Thanks for the solutions, I wrote a post-processing python script and it is working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants