vt-vl-lab / FGVC

[ECCV 2020] Flow-edge Guided Video Completion
Other
1.55k stars 263 forks source link

Same problem result of '--Nonlocal' (as issue #52) #60

Closed habijung closed 2 years ago

habijung commented 2 years ago

I have a same problem of '--Nonlocal' as issue #52

In my case,

python video_completion.py `
    --seamless `
    --edge_guide `
    --mode object_removal `
    --path '{% path %}' `
    --path_mask '{% path_mask %} `
    --outroot '{% outroot %}' `
    --Nonlocal true `
    --mixed_precision

and the result is also

File "~\FGVC\tool\get_flowNN_gradient.py", line 440, in get_flowNN_gradient
    videoNonLocalFlowB[:, :, :, 0, indFrame],
TypeError: 'NoneType' object is not subscriptable

In video_completion.py and get_flowNN_gradient.py, there is not defined videoNonLocalFlowB, videoNonLocalFlowF.

How can I get this value?

Can I define videoNonLocalFlowB or videoNonLocalFlowF like this

# videoNonLocalFlowB: imgH x imgW x 2 x 3 x nFrame
videoNonLocalFlowB = np.empty(((imgH, imgW, 2, 3, nFrame)), dtype=np.float32)

before get_flowNN_gradient at line 334 of video_completion.py?

Thank you!

gaochen315 commented 2 years ago

Hi @habijung,

Sorry for the late reply. Now the code supports non-local flow. You can enable the --Nonlocal flag.

Please note that I haven't thoroughly tested the correctness of the non-local flow (this codebase is different from the one I used for ECCV).

Hope this helps. Please let me know if there is anything I can help with.

habijung commented 2 years ago

@gaochen315

Thank you very much for your update. But I have a question.

Why is FlowNLB1 duplicated in calculate_flow line 290? It seems to FlowNLB = np.concatenate((FlowNLB, np.stack((FlowNLB0, FlowNLB1, FlowNLB2), -1)[..., None]), axis=-1).