qiuyu96 / CoDeF

[CVPR'24 Highlight] Official PyTorch implementation of CoDeF: Content Deformation Fields for Temporally Consistent Video Processing
https://qiuyu96.github.io/CoDeF/
Other
4.84k stars 385 forks source link

with masks test_canonical.sh report error : expected grid and input to have same batch size #42

Closed oceanheart closed 1 year ago

oceanheart commented 1 year ago

File "D:\workspace\CoDeF\train.py", line 214, in forward results = torch.nn.functional.grid_sample( File "C:\Users\ASUS\anaconda3\lib\site-packages\torch\nn\functional.py", line 4244, in grid_sample return torch.grid_sampler(input, grid, mode_enum, padding_mode_enum, align_corners) RuntimeError: grid_sampler(): expected grid and input to have same batch size, but got input with sizes [0, 3, 540, 540] and grid with sizes [1, 291600, 1, 2]

But if I config mask_dir= null, the code runs well.

sigrace1111 commented 1 year ago

same error

FSYFSYFSY commented 1 year ago

Got same error

rainsoulsrx commented 1 year ago

same error

qiuyu96 commented 1 year ago

Hi, sorry for the error. I have updated the mask preprocessing script here.

zhanghongyong123456 commented 1 year ago

Hi, sorry for the error. I have updated the mask preprocessing script here.

NO, Still have this problem,

FSYFSYFSY commented 1 year ago

seems still doesn't work

qiuyu96 commented 1 year ago

I think I have identified the issue. When using masks, multiple canonical images will be generated. Please verify the contents of your result folder after running ./scripts/test_multi.sh, you should find canonical_0.png and canonical_1.png files. Please ensure that all canonical images are placed in the base_control folder.

rainsoulsrx commented 1 year ago

I got canonical_0.png and canonical_1.png, so when I run test video translation step, I need translate both of them using text prompts?

zhanghongyong123456 commented 1 year ago

I think I have identified the issue. When using masks, multiple canonical images will be generated. Please verify the contents of your result folder after running ./scripts/test_multi.sh, you should find canonical_0.png and canonical_1.png files. Please ensure that all canonical images are placed in the base_control folder.

There will be two faces in the video image

qiuyu96 commented 1 year ago

I got canonical_0.png and canonical_1.png, so when I run test video translation step, I need translate both of them using text prompts?

It depends on your requirements. If you intend to transfer the entire video, you should transfer both canonical images. However, if you only wish to transfer the foreground of the video sequences, you will only need to transfer canonical_0.png.

ChdDongyang commented 1 year ago

I got canonical_0.png and canonical_1.png, so when I run test video translation step, I need translate both of them using text prompts?

It depends on your requirements. If you intend to transfer the entire video, you should transfer both canonical images. However, if you only wish to transfer the foreground of the video sequences, you will only need to transfer canonical_0.png.

Hello,if I put the thranfered canonical images both "canonical_0_transfered.png" and "canonical_1_transfered.png" to the dir all_sequences/$NAME/$EXP_NAME_control. How will the program distinguish between foreground and background? Is it based on naming or can it be automatically recognized?