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

During the simulation process, only local information of the object is recognized for annotation #1122

Open
Bainily028 opened this issue Jul 1, 2024 · 6 comments
Labels
question Question, not yet a bug ;)

Comments

@Bainily028
Copy link

Describe the issue

Hello, Dear developers,, thank you again for your contribution.
I have a question I would like to ask while using BlendPro.
Can I only focus on the local information of the object and generate a mask for that local information during the process of creating a dataset for blenderproc simulation.
For example, the following model is a combination of a cube and a cone. In the simulation process, I only want to focus on the cone part and generate a mask with only the cone part.
May I ask if the current blenderproc supports this feature?
image

Minimal code example

No response

Files required to run the code

No response

Expected behavior

Only focus on local information of the model during the simulation process.

BlenderProc version

V2.7.1

@Bainily028 Bainily028 added the question Question, not yet a bug ;) label Jul 1, 2024
@cornerfarmer
Copy link
Member

I dont understand your question. Could you please provide a minimal code example and describe what output you would like.

@Bainily028
Copy link
Author

Hey@cornerfarmer ,Thank you for your reply. Every question is always answered promptly.

Sorry, maybe my description was not clear enough.

Let me explain it in a different scenario. I want to use BlendPro to complete my segmentation task.

For example, the objects and scenes below are the results of my simulation using BlendPro. In the scene, I can obtain the mask of the entire object of the bottle, but if my core goal is not the entire bottle, but a partial part of the bottle, such as the bottle cap. The final output mask is only the mask of the bottle cap, not the mask of the entire bottle.

So, can I achieve this in BlendProc by importing the overall model for simulation, but only outputting the mask at the specified position in the model.

image

@cornerfarmer
Copy link
Member

Hey @Bainily028, the easiest way to achieve that is by splitting the object into multiple separate objects. Then you will get masks for each of them. Maybe you can first run the simulation with the full object and then swap it with the split up object.

@Bainily028
Copy link
Author

Hello @cornerfarmer ,Thank you for your reply.
I have tried to divide the model of an object into several parts for simulation, because I simulate the object falling onto a plane. If the object is separated into several parts in advance, it will scatter during the falling process, which may not be the result I want.
So may I ask if there is a way to obtain a local mask after an object falls without being disassembled (like simulating several bottles falling to the ground, and I get the mask of the bottle cap on the bottle).

@cornerfarmer
Copy link
Member

One thing you could try is to use a common parent object and let that act as a compound rigid body.
This should look something like:

parent_obj = bproc.object.create_empty("parent")
cap_obj.set_parent(parent_obj)
bottle_obj.set_parent(parent_obj)

parent_obj.enable_rigidbody(True, "COMPOUND")
cap_obj.enable_rigidbody(True, "CONVEX_HULL")
bottle_obj.enable_rigidbody(True, "CONVEX_HULL")

@Bainily028
Copy link
Author

@cornerfarmer
Hey,Sorry for being busy lately and not being able to discuss with you in a timely manner.
I conducted a code experiment according to your method, but the problem occurred with the sentence parent_obj.enable_rigidbody(True, "COMPOUND").
Error message: 'Entity' object has no attribute 'enable_rigidbody'. The object created by bproc.oobject.create does not have the enable_rigidbody attribute.
If this sentence is removed, the target will not combine into a composite rigid body and will still scatter during the simulation process.
Look forward to your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question, not yet a bug ;)
Projects
None yet
Development

No branches or pull requests

2 participants