amansouri3476 / OC-CRL

Object-Centric Causal Representation Learning
4 stars 0 forks source link

Sparse Clevr dataset instructions #7

Open despoinatouska opened 23 hours ago

despoinatouska commented 23 hours ago

Hi! Are there any instructions of creating the sparse clevr dataset? For example do you use kurbic from docker? Thank you!

amansouri3476 commented 16 hours ago

Hi! I'm hoping to add the instructions soon, and yes we do use a singularity image. Here's a brief overview of the pipeline until I can complete and upload the readme:

The heart of data generation happens in https://github.com/amansouri3476/OC-CRL/blob/master/kubric/examples/sparse_clevr_worker.py

In a nutshell, arguments are passed for the setup (fixed properties, changing properties, their values, etc.), then the first frame is rendered and saved, then the offset is chosen, the scene modified, and rendered and saved again. This is a worker to generate two frames (and segmentation masks, etc.) for one sample. You can see how to run this if you scroll all the way down to the end of the file https://github.com/amansouri3476/OC-CRL/blob/683f2ed36139917ef3ef255bb55bc3825c084cd9/kubric/examples/sparse_clevr_worker.py#L842

You can test this to see if you’ve set up the image and the environment properly. You can check out the saved figures and manipulate it as you wish. This gives you the core generative process. Now if you wish to have one frame or wish to change the camera angle and so on, you can modify this file to achieve this. There are comments here and there and I hope it’s helpful, but let me know if you needed help with this file.

Now the point is that this worker generates a pair of images/masks/etc for a single sample. How to go about generating 10k samples without taking forever? You need to launch many instances of the same worker in parallel. That’s where you need submit_scripts: https://github.com/amansouri3476/OC-CRL/blob/master/kubric/submit_scripts.py Again, at the end of the file you can see how to run this and what different flags accomplish.

Playing around with these two files should give you a handle on what you want to modify and achieve.