dolev104 / neural_congealing

Official PyTorch implementation of the paper "Neural Congealing: Aligning Images to a Joint Semantic Atlas" (CVPR 2023)
https://neural-congealing.github.io/
MIT License
46 stars 4 forks source link

Missing file: checkerboard_gray_256.png #5

Open morrisalp opened 7 months ago

morrisalp commented 7 months ago

Running train.py throws the error: FileNotFoundError: [Errno 2] No such file or directory: 'data/checkerboard_gray_256.png'. It seems like this missing file is required by propagate_edit.py and logger.py.

dolev104 commented 7 months ago

Hi @morrisalp,

I checked from my end, the file is there after I downloaded it. Is your folder hierarchy the same as shown in the README.md? Also, it looks like a similar problem as your other issue, so try adding the project to PYTHONPATH (see README.md).

Regardless, you don't have to use this image, you can instead create a checkerboard directly in the code -- so you can replace this line https://github.com/dolev104/neural_congealing/blob/main/utils_atlas/logger.py#L256 (also appears here) with the following code:

import torch
from torchvision import transforms

squares_per_side = 32
checkerboard_lowres = torch.eye(2).unsqueeze(0).repeat(3, squares_per_side // 2, squares_per_side // 2) * 0.2 + 0.6
checkerboard = transforms.Resize((256, 256), interpolation=transforms.InterpolationMode.NEAREST)(checkerboard_lowres)
checkerboard = checkerboard[None, ...].to(self.device)

Let me know if you're still having problems with anything.

morrisalp commented 7 months ago

I see, I didn't realize downloading the sample image sets (containing this file) was required for this. Thanks!