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

[Fix] Fix bug in restoration_video_inference.py #379

Merged
merged 2 commits into from
Jun 24, 2021

Conversation

ckkelvinchan
Copy link
Member

Motivation

In restoration_video_inference.py, when using

for i in range(0, data.size(1) - window_size):

a part of the input frames is omitted. This results in fewer output frames.

Modification

This PR fixes the bug and replace the original command by

for i in range(0, data.size(1) - 2 * (window_size // 2)):

@innerlee
Copy link
Contributor

Can this be tested?

@ckkelvinchan
Copy link
Member Author

Can this be tested?

The unittests stucked at Install CUDA.

@innerlee
Copy link
Contributor

Do all vid models require cuda?

@ckkelvinchan
Copy link
Member Author

Do all vid models require cuda?

Not really, and those apis for inference are actually not included in unittests.

@innerlee
Copy link
Contributor

Would you like to have a try? You can use a dummy model in the test (say, one layer, as long as the input/output format is good)

@innerlee
Copy link
Contributor

Our general philosophy is to test everything 😃

@ckkelvinchan
Copy link
Member Author

Would you like to have a try? You can use a dummy model in the test (say, one layer, as long as the input/output format is good)

Sure, let me think about how to write a test for it.

@codecov
Copy link

codecov bot commented Jun 17, 2021

Codecov Report

Merging #379 (df83ee6) into master (7328829) will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
+ Coverage   80.44%   80.45%   +0.01%     
==========================================
  Files         185      186       +1     
  Lines        9889     9911      +22     
  Branches     1441     1444       +3     
==========================================
+ Hits         7955     7974      +19     
- Misses       1742     1744       +2     
- Partials      192      193       +1     
Flag Coverage Δ
unittests 80.43% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmedit/apis/restoration_video_inference.py 21.42% <0.00%> (ø)
...medit/models/components/discriminators/__init__.py 100.00% <0.00%> (ø)
...edit/models/components/discriminators/ttsr_disc.py 85.71% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7328829...df83ee6. Read the comment docs.

@innerlee innerlee merged commit 2efae2b into open-mmlab:master Jun 24, 2021
@ckkelvinchan ckkelvinchan deleted the inference branch July 8, 2021 03:12
Yshuo-Li pushed a commit to Yshuo-Li/mmediting that referenced this pull request Jul 15, 2022
* Fix bug for sliding window inference

* Add unittest for inference
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

Successfully merging this pull request may close these issues.

2 participants