-
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
[Enhancement] Refactor DataPreprocessor #1537
[Enhancement] Refactor DataPreprocessor #1537
Conversation
19be629
to
57327a4
Compare
ac7c142
to
2d32bfc
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## refactor-metric-loop-and-preprocessor #1537 +/- ##
========================================================================
Coverage ? 88.93%
========================================================================
Files ? 400
Lines ? 25954
Branches ? 4079
========================================================================
Hits ? 23081
Misses ? 2004
Partials ? 869
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ae4965c
to
b2fc76d
Compare
2d32bfc
to
3b93e4d
Compare
7eaf5b7
to
6828c76
Compare
a071059
to
b219a43
Compare
… and value range of data_samples and inputs
… metafile and handle single channel images
6828c76
to
fcf6f61
Compare
* unify GenDataPreprocessor and EditDataPreprocessor * revise models with EditDataPreprocessor * adopt configs with revised EditDataPreprocessor * adopt train_step and unit tests to revised EditDataPreprocessor * fix unit test of inpainter inferencer * add more metainfo to EditDataSample * refactor EditDataPreprocessor to standardize the output channel order and value range of data_samples and inputs * adopt SR models to refactored EditDataPreprocessor * revise padding checking in destruct * revise color order conversion to support get input channel order from metafile and handle single channel images * remove norm_data_samples_in_testing and use upper case for channel order * adopt baseGAN and baseCondGAN for new data preprocessor * convert is_list_of to is_seq_of * refactor inpaintors to adopt new data preprocessor * standardize channel order representation and refactor channel order conversion behaviors * refactor channel conversion in destruct and remove unused codes * update unit test for edit data preprocessor and fix some bugs * adopt inpainting models' with data preprocessor * adopt frame interpolation models' with data preprocessor * revise train_step and unit tests of global_local and partial_conv * adopt colorization models' with data preprocessor * revise train_step and unit tests of aot-gan * adopt SR and VSR models with data preprocessor * revise test config of LIIF * adopt dcgan and SWD, MS-SSIM to new data preprocessor * adopt wgan, ggan and lsgan to new data preprocessor * adopt pggan and styleganv1 to new data preprocessor * adopt pix2pix to new data preprocessor * adopt cyclegan to new data preprocessor * adopt conditional-datasets to new data preprocessor * adopt sngan and sagan to new data preprocessor * adopt biggan to new data preprocessor * adopt stylegan2, singan and mspie to new data preprocessor * adopt stylegan3 to new data preprocessor * adopt eg3d to new data preprocessor * revise transform pipelines * revise unit test of EditDataSample * adopt baseEditModel, vis_hook and visualizer for new data preprocessor * some minor fix of edit data preprocessor and add unit test for model utils * adopt metrics for new data preprocessor * add env var for deterministic training * refactor mattor data preprocessor based on edit data preprocessor * fix lint error * fix some unit tests * update unit test of inpainting inferencer, sad and data preprocessor * optimize the memory cost for AOT-GAN and BasicVSR's unit tests * optimize the memory cost for IconVSR's unit tests * skip ttsr unit test on windows CI
* unify GenDataPreprocessor and EditDataPreprocessor * revise models with EditDataPreprocessor * adopt configs with revised EditDataPreprocessor * adopt train_step and unit tests to revised EditDataPreprocessor * fix unit test of inpainter inferencer * add more metainfo to EditDataSample * refactor EditDataPreprocessor to standardize the output channel order and value range of data_samples and inputs * adopt SR models to refactored EditDataPreprocessor * revise padding checking in destruct * revise color order conversion to support get input channel order from metafile and handle single channel images * remove norm_data_samples_in_testing and use upper case for channel order * adopt baseGAN and baseCondGAN for new data preprocessor * convert is_list_of to is_seq_of * refactor inpaintors to adopt new data preprocessor * standardize channel order representation and refactor channel order conversion behaviors * refactor channel conversion in destruct and remove unused codes * update unit test for edit data preprocessor and fix some bugs * adopt inpainting models' with data preprocessor * adopt frame interpolation models' with data preprocessor * revise train_step and unit tests of global_local and partial_conv * adopt colorization models' with data preprocessor * revise train_step and unit tests of aot-gan * adopt SR and VSR models with data preprocessor * revise test config of LIIF * adopt dcgan and SWD, MS-SSIM to new data preprocessor * adopt wgan, ggan and lsgan to new data preprocessor * adopt pggan and styleganv1 to new data preprocessor * adopt pix2pix to new data preprocessor * adopt cyclegan to new data preprocessor * adopt conditional-datasets to new data preprocessor * adopt sngan and sagan to new data preprocessor * adopt biggan to new data preprocessor * adopt stylegan2, singan and mspie to new data preprocessor * adopt stylegan3 to new data preprocessor * adopt eg3d to new data preprocessor * revise transform pipelines * revise unit test of EditDataSample * adopt baseEditModel, vis_hook and visualizer for new data preprocessor * some minor fix of edit data preprocessor and add unit test for model utils * adopt metrics for new data preprocessor * add env var for deterministic training * refactor mattor data preprocessor based on edit data preprocessor * fix lint error * fix some unit tests * update unit test of inpainting inferencer, sad and data preprocessor * optimize the memory cost for AOT-GAN and BasicVSR's unit tests * optimize the memory cost for IconVSR's unit tests * skip ttsr unit test on windows CI
* unify GenDataPreprocessor and EditDataPreprocessor * revise models with EditDataPreprocessor * adopt configs with revised EditDataPreprocessor * adopt train_step and unit tests to revised EditDataPreprocessor * fix unit test of inpainter inferencer * add more metainfo to EditDataSample * refactor EditDataPreprocessor to standardize the output channel order and value range of data_samples and inputs * adopt SR models to refactored EditDataPreprocessor * revise padding checking in destruct * revise color order conversion to support get input channel order from metafile and handle single channel images * remove norm_data_samples_in_testing and use upper case for channel order * adopt baseGAN and baseCondGAN for new data preprocessor * convert is_list_of to is_seq_of * refactor inpaintors to adopt new data preprocessor * standardize channel order representation and refactor channel order conversion behaviors * refactor channel conversion in destruct and remove unused codes * update unit test for edit data preprocessor and fix some bugs * adopt inpainting models' with data preprocessor * adopt frame interpolation models' with data preprocessor * revise train_step and unit tests of global_local and partial_conv * adopt colorization models' with data preprocessor * revise train_step and unit tests of aot-gan * adopt SR and VSR models with data preprocessor * revise test config of LIIF * adopt dcgan and SWD, MS-SSIM to new data preprocessor * adopt wgan, ggan and lsgan to new data preprocessor * adopt pggan and styleganv1 to new data preprocessor * adopt pix2pix to new data preprocessor * adopt cyclegan to new data preprocessor * adopt conditional-datasets to new data preprocessor * adopt sngan and sagan to new data preprocessor * adopt biggan to new data preprocessor * adopt stylegan2, singan and mspie to new data preprocessor * adopt stylegan3 to new data preprocessor * adopt eg3d to new data preprocessor * revise transform pipelines * revise unit test of EditDataSample * adopt baseEditModel, vis_hook and visualizer for new data preprocessor * some minor fix of edit data preprocessor and add unit test for model utils * adopt metrics for new data preprocessor * add env var for deterministic training * refactor mattor data preprocessor based on edit data preprocessor * fix lint error * fix some unit tests * update unit test of inpainting inferencer, sad and data preprocessor * optimize the memory cost for AOT-GAN and BasicVSR's unit tests * optimize the memory cost for IconVSR's unit tests * skip ttsr unit test on windows CI
* unify GenDataPreprocessor and EditDataPreprocessor * revise models with EditDataPreprocessor * adopt configs with revised EditDataPreprocessor * adopt train_step and unit tests to revised EditDataPreprocessor * fix unit test of inpainter inferencer * add more metainfo to EditDataSample * refactor EditDataPreprocessor to standardize the output channel order and value range of data_samples and inputs * adopt SR models to refactored EditDataPreprocessor * revise padding checking in destruct * revise color order conversion to support get input channel order from metafile and handle single channel images * remove norm_data_samples_in_testing and use upper case for channel order * adopt baseGAN and baseCondGAN for new data preprocessor * convert is_list_of to is_seq_of * refactor inpaintors to adopt new data preprocessor * standardize channel order representation and refactor channel order conversion behaviors * refactor channel conversion in destruct and remove unused codes * update unit test for edit data preprocessor and fix some bugs * adopt inpainting models' with data preprocessor * adopt frame interpolation models' with data preprocessor * revise train_step and unit tests of global_local and partial_conv * adopt colorization models' with data preprocessor * revise train_step and unit tests of aot-gan * adopt SR and VSR models with data preprocessor * revise test config of LIIF * adopt dcgan and SWD, MS-SSIM to new data preprocessor * adopt wgan, ggan and lsgan to new data preprocessor * adopt pggan and styleganv1 to new data preprocessor * adopt pix2pix to new data preprocessor * adopt cyclegan to new data preprocessor * adopt conditional-datasets to new data preprocessor * adopt sngan and sagan to new data preprocessor * adopt biggan to new data preprocessor * adopt stylegan2, singan and mspie to new data preprocessor * adopt stylegan3 to new data preprocessor * adopt eg3d to new data preprocessor * revise transform pipelines * revise unit test of EditDataSample * adopt baseEditModel, vis_hook and visualizer for new data preprocessor * some minor fix of edit data preprocessor and add unit test for model utils * adopt metrics for new data preprocessor * add env var for deterministic training * refactor mattor data preprocessor based on edit data preprocessor * fix lint error * fix some unit tests * update unit test of inpainting inferencer, sad and data preprocessor * optimize the memory cost for AOT-GAN and BasicVSR's unit tests * optimize the memory cost for IconVSR's unit tests * skip ttsr unit test on windows CI
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Generative models (e.g., BigGAN, StyleGAN) and low-level models (e.g., BasicVSR) use different data preprocessors, and those data preprocessors take different kinds of input (e.g., GenDataPreprocessor support tensor, list of tensor, and dict as input, while EditDataPreprocessor only support list of tensor as input).
In this PR, we unify GenDatapreprocessor and EditDatapreprocessor.
Modification
In this PR,
EditDatapreprocessor
is refactored.List[Tensor]
,Tensor
,Dict
,List[Dict]
as input.pad_args
and change topad_mode
andpad_value
input_view
andoutput_view
automaticallydata_sample.gt_img
in val/test stage viaonly_norm_gt_in_training
destructor
support un-pad image by key.inputs
is packed into a dict with the fieldimg
.Who can help? @ them here!
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist
Before PR:
After PR: