cmusatyalab / mega-nerf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No pictures were copied to the 'rgbs' folder after running copy_images.py

ShenghaoJia opened this issue · comments

Hi, thanks for your wonderful work,

when run it with Quad 6k Dataset, I run

python scripts/copy_images.py --image_path ./dataset/ArtsQuad_dataset/images/ --dataset_path ./dataset/quad-pixsfm/

where ArtsQuad_dataset and quad-pixsfm are downloaded from the link you provid.

After I run copy_images.py, the folders ./dataset/quad-pixsfm/train/rgbs and ./dataset/quad-pixsfm/val/rgbs are created, but they are both empty.

I read the code of copy_images.py and think there should be some pictures in the rgbs folder because I find

cv2.imwrite(str(dataset_path / metadata_path.parent.parent / 'rgbs' / '{}.{}'.format(metadata_path.stem,
                                                                                                 image_name.split('.')[
                                                                                                     -1])),
                        undistorted)

in line 45, but I am confused that metadata_path.parent.parent is equal to dataset_path / 'train' / or dataset_path / 'val' / due to

metadata_path = dataset_path / 'train' / 'metadata' / metadata_name

in line 29 and

metadata_path = dataset_path / 'val' / 'metadata' / metadata_name

in line 31,

so dataset_path / metadata_path.parent.parent / 'rgbs' / is equal to dataset_path / dataset_path / 'train' / 'rgbs' / , which is not created before, and I guess it should be dataset_path / 'train' / 'rgbs' /.

so, I change the code in line 45 to

cv2.imwrite(str(metadata_path.parent.parent / 'rgbs' / '{}.{}'.format(metadata_path.stem,
                                                                                                 image_name.split('.')[
                                                                                                     -1])),
                        undistorted)

and images are copied to the directory rgbs after running the script.

I wonder whether this is a small bug or whether the rgbs folder should be empty after the code runs.

Thanks in advance.

I also met the same problem. Have you solved your problem

I also met the same problem. Have you solved your problem

You can try changing line 45 of copy_images.py to

cv2.imwrite(str(metadata_path.parent.parent / 'rgbs' / '{}.{}'.format(metadata_path.stem, image_name.split('.')[-1])), undistorted)