lisiyao21 / AnimeInterp

The code for CVPR21 paper "Deep Animation Video Interpolation in the Wild"
396 stars 38 forks source link

How to correctly generate SGM? #26

Open Soooda opened 2 years ago

Soooda commented 2 years ago

Hello Siyao,

Refer to Issue #11, you mentioned there's a guide for generating SGM flows, may I ask where I can find it? If not, would you mind correcting my process for generating SGM flows?

According to my understanding, we need to first generate the label map to label each colour segment. So what I did was

$ python gen_labelmap.py labelmap/input labelmap/output --use_gpu

then I use gen_sgm.py to generate the flows based on it

$ python gen_sgm.py labelmap/input ./sgm --use_gpu --label_root labelmap/output

However, I found that simply run

$ python gen_sgm.py labelmap/input ./sgm --use_gpu

can attain identical results to the previous two-step calculation.

Therefore, I tried to directly call gen_sgm.py on Disney_v4_0_000024_s2 (the first triplet in test_2k_540p). But the SGM flows I attained is somehow different from the pre-calculated ones (provided in atd-12k.zip). My comparison process:

flow13 = np.load(".../guide_flo13.npy")
flow31 = np.load(".../guide_flo31.npy")
gt13 = np.load("test_2k_pre_calc_sgm_flows/.../guide_flo13.npy")
gt31 = np.load("test_2k_pre_calc_sgm_flows/.../guide_flo13.npy")

assert (flow13 == gt13).all()
assert (flow31 == gt31).all()

Both assertions raised errors. Based on my understanding, the SGM module is not dynamic and there's not any prediction involved, there should be strict equality as long as the input frames are the same. Please feel free to correct any mistakes I have made!

Cheers~

chenjjcccc commented 1 year ago

Hi,have you solved this problem?

Soooda commented 1 year ago

Hi,have you solved this problem?

Sorry for the late reply, this project was quite a long while ago. I cannot really recall the details that much. I remember I just go with one of the three commands to generate SGM flows ignoring the issue which we discuss here. By using the SGM flows generated from the previous step, I did witness some improvements in PSNR and SSIM from the overall pipeline. So I just assume I was doing it right here.

I hope maybe this information can help!