yyang181 / colormnet

44 stars 3 forks source link

Bug on "disable_long_term" #10

Open dan64 opened 2 months ago

dan64 commented 2 months ago

Hello,

If in the script test.py I set the parameter --disable_long_term = True The images are not colored and in output is produced always a black frame. There is a combination of parameters that allows to set --disable_long_term = True ?

Thank you, Dan

UPstud commented 2 months ago

Try python test.py --benchmark 😊And that's all

dan64 commented 2 months ago

Sorry but I don't understand your answer. I reported the problem that when --disable_long_term is set to True, in output (folder result) are provided only black images. To set this parameter to True it is possible either, run the command:

python test.py --disable_long_term

or change the code in this way

parser.add_argument('--disable_long_term', default=True, action='store_true')

In any case the result is always the same: black images.

Dan

yyang181 commented 2 weeks ago

Hi @dan64,

It's weird. If you set --disable_long_term to True, the performance should remain the same for short videos, yet it degrades performance for longer ones due to the deactivation of the temporally-efficient memory bank.

I will review the output once the CVPR deadline has passed. Please accept my apologies for any inconvenience caused by the delay.

yyang181 commented 2 weeks ago

Hi @dan64,

I've set --disable_long_term to True and couldn't reproduce the bug you mentioned. Could you provide more details if the issue persists?

image
dan64 commented 2 weeks ago

Unfortunately, if I set --disable_long_term=True (as shown in the image below) script_no-long-term

I get only black frames (see picture below) script_no-long-term_result

If I set --disable_long_term=False I get coloured images as expected.

I guess that this problem is due to the fact that I'm using Windows O.S.

I solved the problem in another way. I wrote a filter based on colormnet where it is possible to control the memory allocated using the parameter max_memory (from 1 to total number of frames).

you can see the code here: https://github.com/dan64/vs-deoldify/blob/main/vsdeoldify/colormnet/colormnet_render.py

the control of the memory is implemented at row 197.

Dan

yyang181 commented 2 weeks ago

Hi @dan64,

I identified the issue: to disable long-term memory, you need to set action='store_false' instead of using default=True. Alternatively, you can simply add --disable_long_term to your inference command, like this (please check the command at the bottom of the picture in https://github.com/yyang181/colormnet/issues/10#issuecomment-2482359686):

python test.py --disable_long_term

Please refer to the official guidance of argparse or https://stackoverflow.com/questions/8203622/argparse-store-false-if-unspecified

dan64 commented 2 weeks ago

Hi @yyang181

If in your script you add the following code

print('--disable_long_term = ', args.disable_long_term)

after config['enable_long_term'] = not config['disable_long_term']

you will see that:

1) python _test.py --disable_longterm will print False 2) parser.add_argument('--disable_long_term', action='store_false') will print True 3) parser.add_argument('--disable_long_term', default=True) will print True 4) parser.add_argument('--disable_long_term', default=True, action='store_true') will print True

The last 3 are not working as reported previously.

Dan