-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] Support FLOPs calculation of video SR models #309
Conversation
Codecov Report
@@ Coverage Diff @@
## master #309 +/- ##
=======================================
Coverage 80.74% 80.74%
=======================================
Files 163 163
Lines 8147 8147
Branches 1194 1194
=======================================
Hits 6578 6578
Misses 1425 1425
Partials 144 144
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
tools/get_flops.py
Outdated
split_line = '=' * 30 | ||
print(f'{split_line}\nInput shape: {input_shape}\n' | ||
f'Flops: {flops}\nParams: {params}\n{split_line}') | ||
print('!!!If you are testing a recurrent network, please divide the ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it should be divided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since a recurrent network (e.g. BasicVSR) takes N frames as inputs and outputs N frames, therefore the FLOPs for each frame should be the output FLOPs divided by N.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, print this info only when the input is N frames, and change "recurrent network" to some other name. N frame to N frame does not have to be recurrent
* Support FLOPs calculation of video SR models * Modify printscreen * revised message
As discussed in #306, Existing
get_flops.py
does not accept video inputs with size(t, c, h, w)
. Therefore, the function is not compatible with video SR models such as EDVR, BasicVSR.This PR adds the support of FLOPs computation of video SR models, by accepting
--shape t c h w
. For example, for BasicVSR, we can compute the FLOPs by using the following command.python tools/get_flops.py configs/restorers/basicvsr/basicvsr_vimeo90k_bi.py --shape 5 3 180 320