baowenbo / DAIN

Depth-Aware Video Frame Interpolation (CVPR 2019)
https://sites.google.com/view/wenbobao/dain
MIT License
8.23k stars 840 forks source link

Undefined names in my_package #45

Open cclauss opened 4 years ago

cclauss commented 4 years ago

Undefined names are usually a sign of a typo, missing imports, or code that has not been ported to Python 3. These would be compile-time errors in a compiled language but in Python a NameError is raised which will halt/crash the script on the user.

flake8 testing of https://github.com/baowenbo/DAIN on Python 3.8.0

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./my_package/test_module.py:21:25: F821 undefined name 'SeparableConvFlowModule'
    FilterInterpolate = SeparableConvFlowModule(filtersize)
                        ^
./my_package/test_module.py:125:25: F821 undefined name 'SeparableConvModule'
    FilterInterpolate = SeparableConvModule(filtersize)
                        ^
./my_package/test_module.py:219:25: F821 undefined name 'FilterInterpolationModule'
    FilterInterpolate = FilterInterpolationModule()
                        ^
./my_package/test_module.py:324:19: F821 undefined name 'InterpolationModule'
    Interpolate = InterpolationModule()
                  ^
./my_package/test_module.py:408:19: F821 undefined name 'InterpolationChModule'
    Interpolate = InterpolationChModule(input1.size(1))
                  ^
./my_package/test_module.py:492:15: F821 undefined name 'FlowProjectionModule'
    Project = FlowProjectionModule()
              ^
./my_package/test_module.py:518:15: F821 undefined name 'FlowProjectionModule'
    Project = FlowProjectionModule() # regnenerate
              ^
./my_package/test_module.py:632:23: F821 undefined name 'output'
    x = output_cuda - output.cuda()
                      ^
./my_package/test_module.py:683:15: F821 undefined name 'WeightedFlowProjectionModule'
    Project = WeightedFlowProjectionModule(threshold=20.0/255.0,requires_grad=True)
              ^
./my_package/test_module.py:710:15: F821 undefined name 'WeightedFlowProjectionModule'
    Project = WeightedFlowProjectionModule(threshold=20.0/255.0, requires_grad=True) # regnenerate
              ^
./my_package/test_module.py:770:19: F821 undefined name 'AdaptiveWeightInterpolationModule'
    Interpolate = AdaptiveWeightInterpolationModule(training=training)
                  ^
./MegaDepth/data/image_folder.py:42:78: F821 undefined name 'IMG_EXTENSIONS'
                               "Supported image extensions are: " + ",".join(IMG_EXTENSIONS)))
                                                                             ^
./MegaDepth/data/image_folder.py:131:78: F821 undefined name 'IMG_EXTENSIONS'
                               "Supported image extensions are: " + ",".join(IMG_EXTENSIONS)))
                                                                             ^
13    F821 undefined name 'IMG_EXTENSIONS'
13

https://flake8.pycqa.org/en/latest/user/error-codes.html

On the flake8 test selection, this PR does not focus on "style violations" (the majority of flake8 error codes that psf/black can autocorrect). Instead these tests are focus on runtime safety and correctness: