cangumeli / ROCA

Official code for ROCA: Robust CAD Model Retrieval and Alignment from a Single Image (CVPR 2022)
Other
176 stars 19 forks source link

First issue :) Trying to run it on new images #1

Open ThibaultGROUEIX opened 2 years ago

ThibaultGROUEIX commented 2 years ago

Hi,

Thanks for this great work, it looks very promising and exciting! I am doing some tests. I did not have major issues with installation and the demo runs. Congrats!

I want to adapt the code to get a simple CLI with an input image and its intrinsics. It would be great if such a demo was part of the codebase IMHO.

To this end, could you kindly explain, in demo.py, what is the "scene" argument here ?

   for name, scene in zip(
        ('3m', 'sofa', 'lab', 'desk'),
        ('scene0474_02', 'scene0207_00', 'scene0378_02', 'scene0474_02')
    ):

Thanks Thibault

cangumeli commented 2 years ago

Hi Thibault, thanks a lot for your interest in this project :). Having a cli would be super cool indeed!

"scene" is a ScanNet scene id. In Scan2CAD evaluation protocol, the CAD retrieval pool is limited to the CAD models that appear in a ScanNet scene. Inside the Scan2CAD's full_annotations.json file, aligned_models field lists the aligned CAD model ids. Note that each image in ScanNet is part of a scene, so the scene id is known when evaluating on the ScanNet validation set. In applications like demo.py, one may select a scene to determine a good CAD retrieval pool. For instance, scene0474_02 is a good office scene that has good tables, chairs, and monitors.

If you use the --wild option in demo.py, the scene argument should no longer be important, all CAD models that appear in the Scan2CAD training set will be used for retrieval. Some classes like table work poorly in this case, so there is the excluded_classes argument that can be used to omit some categories.

As a final note, the method is trained on 360x480 images of ScanNet, so all images have roughly the same focal length (approx. 435). So if the new input images do not work, you may try to crop and resize images to fit the size and intrinsics.

I hope that helps :) Can

ThibaultGROUEIX commented 2 years ago

Thanks @cangumeli ! Sorry i did not get back to this sooner, but I am planning to give it another try very soon!

csyhping commented 3 months ago

@cangumeli Hi, thanks for your great work. So if I want to try your work with a new image, the only thing I should modify is this name list ('3m', 'sofa', 'lab', 'desk') and use --wild, is it correct? ie., if my image is 'img1.jpg', then

   for name, scene in zip(`
        ('img1'),
        ('scene0474_02') # leave one scene according to #8 
    ):