-
Notifications
You must be signed in to change notification settings - Fork 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] Add SRFolderMultipleGTDataset #355
Conversation
Codecov Report
@@ Coverage Diff @@
## master #355 +/- ##
==========================================
+ Coverage 80.11% 80.44% +0.32%
==========================================
Files 181 183 +2
Lines 9496 9760 +264
Branches 1385 1417 +32
==========================================
+ Hits 7608 7851 +243
- Misses 1698 1717 +19
- Partials 190 192 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Can the |
Not sure if |
|
How about After this PR, there will be another named |
|
||
@DATASETS.register_module() | ||
class SRCustomMultipleGTDataset(BaseSRDataset): | ||
"""Custom dataset for video super resolution for recurrent networks. |
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.
Docstring failed to explain Multiple
.
Besides, This sentence is a bit difficult to understand (... for video super resolution for recurrent networks.)
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.
It is explained in line 15: The dataset loads several LQ (Low-Quality) frames and GT (Ground-Truth) frames.
. There are multiple GT frames.
pipeline (list[dict | callable]): A sequence of data transformations. | ||
scale (int): Upsampling scale ratio. | ||
num_input_frames (None | int): The number of frames per iteration. | ||
If None, the whole clip are extracted. If it is an integer |
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.
If None, the whole clip will be extracted.
pipeline (list[dict | callable]): A sequence of data transformations. | ||
scale (int): Upsampling scale ratio. | ||
num_input_frames (None | int): The number of frames per iteration. | ||
If None, the whole clip are extracted. If it is an integer |
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.
please delete an integer
.
gt_path=self.gt_folder, | ||
key=sequence.replace(f'{self.lq_folder}/', ''), | ||
num_input_frames=num_input_frames, | ||
sequence_length=int(sequence_length))) |
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.
sequence_length = len(glob.glob(osp.join(sequence, '*.png')))
len(__obj: Sized) -> int
No need to use int(sequence_length)
@@ -27,6 +28,10 @@ class SRTestMultipleGTDataset(BaseSRDataset): | |||
def __init__(self, lq_folder, gt_folder, pipeline, scale, test_mode=True): | |||
super().__init__(pipeline, scale, test_mode) | |||
|
|||
warnings.warn('"SRTestMultipleGTDataset" have been deprecated and ' | |||
'will be removed in future release. Please use ' | |||
'"SRFolderMultipleGTDataset" instead.') |
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.
Details see https://github.com/open-mmlab/mmediting/pull/355
* Add SRCutomMultipleGTDataset * Rename and minor updates * Fix * Add dataset * Modify warnings for SRTestMultipleGTDataset
Motivation
Currently, MMEditing does not support training video SR models with custom datasets. Users can only trained on pre-determined datasets such as REDS and Vimeo-90K.
Modification
This PR adds support to training recurrent networks (e.g. BasicVSR, IconVSR) on custom datasets. Changes are as follows:
SRFolderMultipleGTDataset
, which allows users to train and test on their own datasets.SRTestMultipleGTDataset
is deprecated. All existing uses ofSRTestMultipleGTDataset
are replaced withSRFolderMultipleGTDataset
, but we still keepSRTestMultipleGTDataset
to avoid any unexpected compatibility issue. It can be removed in the future.