Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to correctly generate SGM? #26

Open
Soooda opened this issue Mar 28, 2022 · 2 comments
Open

How to correctly generate SGM? #26

Soooda opened this issue Mar 28, 2022 · 2 comments

Comments

@Soooda
Copy link

Soooda commented Mar 28, 2022

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
Copy link

Hi,have you solved this problem?

@Soooda
Copy link
Author

Soooda commented Jan 12, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants