├── .gitignore
├── .idea
├── .gitignore
├── TimeLens-XL.iml
├── inspectionProfiles
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── README.md
├── dataset
├── BSERGBloader
│ ├── .ipynb_checkpoints
│ │ ├── loader_bsergb-checkpoint.py
│ │ ├── loader_bsergb_REFID-checkpoint.py
│ │ ├── loader_bsergb_augment_half-checkpoint.py
│ │ ├── loader_bsergb_half-checkpoint.py
│ │ ├── loader_bsergb_timelens-checkpoint.py
│ │ └── loader_bsergb_timelens_half-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── loader_bsergb.cpython-312.pyc
│ │ ├── loader_bsergb_REFID.cpython-312.pyc
│ │ ├── loader_bsergb_augment.cpython-312.pyc
│ │ ├── loader_bsergb_augment_half.cpython-312.pyc
│ │ ├── loader_bsergb_half.cpython-312.pyc
│ │ ├── loader_bsergb_timelens.cpython-312.pyc
│ │ └── loader_bsergb_timelens_half.cpython-312.pyc
│ ├── loader_bsergb.py
│ ├── loader_bsergb_REFID.py
│ ├── loader_bsergb_augment.py
│ ├── loader_bsergb_augment_half.py
│ ├── loader_bsergb_half.py
│ ├── loader_bsergb_timelens.py
│ └── loader_bsergb_timelens_half.py
├── BaseLoaders
│ ├── .ipynb_checkpoints
│ │ ├── __init__-checkpoint.py
│ │ ├── baseloader-checkpoint.py
│ │ ├── loader_CBMNet-checkpoint.py
│ │ ├── loader_CBMNet_fromevents-checkpoint.py
│ │ ├── loader_ETRFNetv0-checkpoint.py
│ │ ├── loader_ETRFNetv0Mix-checkpoint.py
│ │ ├── loader_ETRFNetv0Mix_weighted-checkpoint.py
│ │ ├── loader_REFID-checkpoint.py
│ │ ├── loader_REFID_mix-checkpoint.py
│ │ ├── loader_bsergb-checkpoint.py
│ │ ├── loader_hsergb-checkpoint.py
│ │ ├── loader_timelens-checkpoint.py
│ │ ├── loader_timelens_mix-checkpoint.py
│ │ └── mixbaseloader-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── baseloader.cpython-312.pyc
│ │ ├── loader_CBMNet.cpython-312.pyc
│ │ ├── loader_CBMNet_fromevents.cpython-312.pyc
│ │ ├── loader_ETRFNetv0.cpython-312.pyc
│ │ ├── loader_ETRFNetv0Mix.cpython-312.pyc
│ │ ├── loader_ETRFNetv0Mix_weighted.cpython-312.pyc
│ │ ├── loader_ETRFNetv0_denseRGB.cpython-312.pyc
│ │ ├── loader_ETRFNetv0_withInit.cpython-312.pyc
│ │ ├── loader_EVDI.cpython-312.pyc
│ │ ├── loader_OursReal.cpython-312.pyc
│ │ ├── loader_REFID.cpython-312.pyc
│ │ ├── loader_REFID_mix.cpython-312.pyc
│ │ ├── loader_REFID_nonorm.cpython-312.pyc
│ │ ├── loader_timelens.cpython-312.pyc
│ │ ├── loader_timelens_mix.cpython-312.pyc
│ │ └── mixbaseloader.cpython-312.pyc
│ ├── baseloader.py
│ ├── debug_EVDI.py
│ ├── loader_CBMNet.py
│ ├── loader_CBMNet_fromevents.py
│ ├── loader_ETRFNetv0.py
│ ├── loader_ETRFNetv0Mix.py
│ ├── loader_ETRFNetv0Mix_weighted.py
│ ├── loader_ETRFNetv0_denseRGB.py
│ ├── loader_ETRFNetv0_withInit.py
│ ├── loader_EVDI.py
│ ├── loader_OursReal.py
│ ├── loader_REFID.py
│ ├── loader_REFID_mix.py
│ ├── loader_REFID_nonorm.py
│ ├── loader_timelens.py
│ ├── loader_timelens_mix.py
│ ├── mixbaseloader.py
│ └── shape_dict.txt
├── RC_4816
│ ├── .ipynb_checkpoints
│ │ ├── dataset_dict-checkpoint.py
│ │ ├── loader_RC-checkpoint.py
│ │ └── loader_RC_timelens-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── dataset_dict.cpython-312.pyc
│ │ ├── loader_RC_mix.cpython-312.pyc
│ │ ├── loader_RC_timelens_mix.cpython-312.pyc
│ │ └── mixloader.cpython-312.pyc
│ ├── dataset_dict.py
│ ├── fordataset.py
│ ├── loader_RC_mix.py
│ ├── loader_RC_timelens_mix.py
│ └── mixloader.py
├── __init__.py
└── __pycache__
│ └── __init__.cpython-312.pyc
├── docs
├── README.md
├── index.html
└── static
│ ├── css
│ ├── bulma-carousel.min.css
│ ├── bulma-slider.min.css
│ ├── bulma.min.css
│ ├── fontawesome.all.min.css
│ └── index.css
│ ├── images
│ ├── icon.png
│ ├── teaser.jpg
│ └── teaser.png
│ └── js
│ ├── bulma-carousel.js
│ ├── bulma-carousel.min.js
│ ├── bulma-slider.js
│ ├── bulma-slider.min.js
│ ├── fontawesome.all.min.js
│ └── index.js
├── losses
├── .ipynb_checkpoints
│ ├── losses_common-checkpoint.py
│ ├── losses_dists-checkpoint.py
│ └── losses_lpips-checkpoint.py
├── DISTS
│ ├── DISTS_pytorch
│ │ ├── DISTS_pt.py
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ │ ├── DISTS_pt.cpython-312.pyc
│ │ │ └── __init__.cpython-312.pyc
│ ├── LICENSE
│ ├── MANIFEST.in
│ ├── README.md
│ ├── __init__.py
│ ├── __pycache__
│ │ └── __init__.cpython-312.pyc
│ └── setup.py
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-312.pyc
│ ├── losses_common.cpython-312.pyc
│ ├── losses_dists.cpython-312.pyc
│ ├── losses_lpips.cpython-312.pyc
│ └── losses_ssim.cpython-312.pyc
├── losses_common.py
├── losses_dists.py
├── losses_lpips.py
└── losses_ssim.py
├── models
├── .ipynb_checkpoints
│ ├── BaseModel-checkpoint.py
│ └── __init__-checkpoint.py
├── BaseModel.py
├── CBMNet
│ ├── .gitignore
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── CBMNet.iml
│ │ ├── inspectionProfiles
│ │ │ ├── Project_Default.xml
│ │ │ └── profiles_settings.xml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ └── vcs.xml
│ ├── .ipynb_checkpoints
│ │ ├── README-checkpoint.md
│ │ ├── __init__-checkpoint.py
│ │ ├── runcbmnet-checkpoint.py
│ │ ├── runcbmnet_large-checkpoint.py
│ │ ├── runmycbmnet-checkpoint.py
│ │ └── test_flops-checkpoint.py
│ ├── README.md
│ ├── __init__.py
│ ├── cbmnet_models
│ │ ├── final_models
│ │ │ ├── .ipynb_checkpoints
│ │ │ │ ├── myCBMNet-checkpoint.py
│ │ │ │ ├── ours-checkpoint.py
│ │ │ │ └── ours_large-checkpoint.py
│ │ │ ├── myCBMNet.py
│ │ │ ├── newcorrelation.py
│ │ │ ├── ours.py
│ │ │ ├── ours_large.py
│ │ │ └── submodules.py
│ │ └── model_manager.py
│ ├── correlation_package
│ │ ├── __init__.py
│ │ ├── correlation.py
│ │ ├── correlation_cuda.cc
│ │ ├── correlation_cuda_kernel.cu
│ │ ├── correlation_cuda_kernel.cuh
│ │ ├── nvcc setting.md
│ │ ├── pyproject.toml
│ │ └── setup.py
│ ├── install_correlation.sh
│ ├── pretrained_model
│ │ └── README.md
│ ├── run_samples.py
│ ├── runcbmnet.py
│ ├── runcbmnet_large.py
│ ├── runmycbmnet.py
│ ├── test_flops.py
│ └── utils.py
├── EVDI
│ ├── .ipynb_checkpoints
│ │ ├── EVDI-checkpoint.py
│ │ └── EVDI_Net_flops_and_macs-checkpoint.txt
│ ├── EVDI.py
│ ├── EVDI_Net_flops_and_macs.txt
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── EVDI.cpython-312.pyc
│ │ ├── __init__.cpython-312.pyc
│ │ └── networks.cpython-312.pyc
│ ├── networks.py
│ └── test_flops.py
├── Expv8_Lights3
│ ├── .ipynb_checkpoints
│ │ ├── __init__-checkpoint.py
│ │ ├── runExpv7_dataprop_fuseFeat_large-checkpoint.py
│ │ ├── runExpv8-checkpoint.py
│ │ ├── runExpv8_Lights2-checkpoint.py
│ │ ├── runExpv8_Lights3-checkpoint.py
│ │ └── test_flops-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ └── runExpv8_Lights3.cpython-312.pyc
│ ├── archs
│ │ ├── .ipynb_checkpoints
│ │ │ ├── TimeTracker-checkpoint.py
│ │ │ ├── XXNet_final_attenfusion_arch-checkpoint.py
│ │ │ ├── __init__-checkpoint.py
│ │ │ ├── encoder_module-checkpoint.py
│ │ │ └── flow_decoder-checkpoint.py
│ │ ├── XXNet_final_attenfusion_arch.py
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── XXNet_final_attenfusion_arch.cpython-312.pyc
│ │ │ ├── __init__.cpython-312.pyc
│ │ │ ├── encoder_module.cpython-312.pyc
│ │ │ ├── flow_decoder.cpython-312.pyc
│ │ │ └── warp_layer.cpython-312.pyc
│ │ ├── data_analysis.py
│ │ ├── encoder_module.py
│ │ ├── flow_decoder.py
│ │ └── warp_layer.py
│ ├── runExpv8_Lights3.py
│ ├── test_flops.py
│ └── utils
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── create_lmdb.cpython-312.pyc
│ │ ├── dist_util.cpython-312.pyc
│ │ ├── file_client.cpython-312.pyc
│ │ ├── img_util.cpython-312.pyc
│ │ ├── logger.cpython-312.pyc
│ │ ├── misc.cpython-312.pyc
│ │ └── timer_util.cpython-312.pyc
│ │ ├── create_lmdb.py
│ │ ├── dist_util.py
│ │ ├── download_util.py
│ │ ├── face_util.py
│ │ ├── file_client.py
│ │ ├── flow_util.py
│ │ ├── img_util.py
│ │ ├── lmdb_util.py
│ │ ├── logger.py
│ │ ├── matlab_functions.py
│ │ ├── misc.py
│ │ ├── options.py
│ │ └── timer_util.py
├── Expv8_large
│ ├── .ipynb_checkpoints
│ │ ├── __init__-checkpoint.py
│ │ ├── runExpv7_dataprop_fuseFeat_large-checkpoint.py
│ │ ├── runExpv8-checkpoint.py
│ │ ├── runExpv8_Lights2-checkpoint.py
│ │ ├── runExpv8_large-checkpoint.py
│ │ └── test_flops-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ └── runExpv8_large.cpython-312.pyc
│ ├── archs
│ │ ├── .ipynb_checkpoints
│ │ │ ├── TimeTracker-checkpoint.py
│ │ │ ├── XXNet_final_attenfusion_arch-checkpoint.py
│ │ │ ├── __init__-checkpoint.py
│ │ │ ├── encoder_module-checkpoint.py
│ │ │ └── flow_decoder-checkpoint.py
│ │ ├── XXNet_final_attenfusion_arch.py
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── XXNet_final_attenfusion_arch.cpython-312.pyc
│ │ │ ├── __init__.cpython-312.pyc
│ │ │ ├── encoder_module.cpython-312.pyc
│ │ │ ├── flow_decoder.cpython-312.pyc
│ │ │ └── warp_layer.cpython-312.pyc
│ │ ├── data_analysis.py
│ │ ├── encoder_module.py
│ │ ├── flow_decoder.py
│ │ └── warp_layer.py
│ ├── runExpv8_large.py
│ ├── test_flops.py
│ └── utils
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── create_lmdb.cpython-312.pyc
│ │ ├── dist_util.cpython-312.pyc
│ │ ├── file_client.cpython-312.pyc
│ │ ├── img_util.cpython-312.pyc
│ │ ├── logger.cpython-312.pyc
│ │ ├── misc.cpython-312.pyc
│ │ └── timer_util.cpython-312.pyc
│ │ ├── create_lmdb.py
│ │ ├── dist_util.py
│ │ ├── download_util.py
│ │ ├── face_util.py
│ │ ├── file_client.py
│ │ ├── flow_util.py
│ │ ├── img_util.py
│ │ ├── lmdb_util.py
│ │ ├── logger.py
│ │ ├── matlab_functions.py
│ │ ├── misc.py
│ │ ├── options.py
│ │ └── timer_util.py
├── Forward_warp.py
├── OursBaseModel.py
├── QVI
│ ├── README.md
│ ├── __init__.py
│ ├── configs
│ │ ├── test_config.py
│ │ └── train_config.py
│ ├── datas
│ │ ├── AIMSequence.py
│ │ ├── Adobe240all.py
│ │ ├── QVI960.py
│ │ ├── Sequence.py
│ │ └── __init__.py
│ ├── demo.py
│ ├── models
│ │ ├── PWCNetnew.py
│ │ ├── QVI.py
│ │ ├── UNet2.py
│ │ ├── __init__.py
│ │ ├── acceleration.py
│ │ └── forward_warp_gaussian.py
│ ├── runQVI.py
│ └── utils
│ │ └── config.py
├── REFID
│ ├── .ipynb_checkpoints
│ │ ├── REFID_twosharpInterp-checkpoint.py
│ │ ├── test_flops-checkpoint.py
│ │ └── twoSharpImage_event_recurrent_model-checkpoint.py
│ ├── REFID_twosharpInterp.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── REFID_twosharpInterp.cpython-312.pyc
│ │ └── __init__.cpython-312.pyc
│ ├── archs
│ │ ├── .ipynb_checkpoints
│ │ │ ├── fusion_modules-checkpoint.py
│ │ │ └── recurrent_sub_modules-checkpoint.py
│ │ ├── XXNet_arch.py
│ │ ├── XXNet_bidirection_arch.py
│ │ ├── XXNet_decoder_recurrent_allbidirection_arch.py
│ │ ├── XXNet_decoder_recurrent_arch.py
│ │ ├── XXNet_decoder_recurrent_bidirection_arch.py
│ │ ├── XXNet_decoder_recurrent_bidirection_attenfusion_arch.py
│ │ ├── XXNet_decoder_recurrent_siamese_arch.py
│ │ ├── XXNet_decoder_recurrent_siamese_noatten_arch.py
│ │ ├── XXNet_final_attenfusion_arch.py
│ │ ├── XXNet_ps_decoder_recurrent_arch.py
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── XXNet_arch.cpython-312.pyc
│ │ │ ├── XXNet_bidirection_arch.cpython-312.pyc
│ │ │ ├── XXNet_decoder_recurrent_allbidirection_arch.cpython-312.pyc
│ │ │ ├── XXNet_decoder_recurrent_arch.cpython-312.pyc
│ │ │ ├── XXNet_decoder_recurrent_bidirection_arch.cpython-312.pyc
│ │ │ ├── XXNet_decoder_recurrent_bidirection_attenfusion_arch.cpython-312.pyc
│ │ │ ├── XXNet_decoder_recurrent_siamese_arch.cpython-312.pyc
│ │ │ ├── XXNet_decoder_recurrent_siamese_noatten_arch.cpython-312.pyc
│ │ │ ├── XXNet_final_attenfusion_arch.cpython-312.pyc
│ │ │ ├── XXNet_ps_decoder_recurrent_arch.cpython-312.pyc
│ │ │ ├── __init__.cpython-312.pyc
│ │ │ ├── arch_util.cpython-312.pyc
│ │ │ ├── dcn_util.cpython-312.pyc
│ │ │ ├── fusion_modules.cpython-312.pyc
│ │ │ ├── recurrent_sub_modules.cpython-312.pyc
│ │ │ └── single_multiconnect_evhinet_arch.cpython-312.pyc
│ │ ├── arch_util.py
│ │ ├── dcn_util.py
│ │ ├── fusion_modules.py
│ │ ├── recurrent_sub_modules.py
│ │ └── single_multiconnect_evhinet_arch.py
│ ├── test_flops.py
│ ├── twoSharpImage_event_recurrent_model.py
│ └── utils
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── create_lmdb.cpython-312.pyc
│ │ ├── dist_util.cpython-312.pyc
│ │ ├── file_client.cpython-312.pyc
│ │ ├── img_util.cpython-312.pyc
│ │ ├── lmdb_util.cpython-312.pyc
│ │ ├── logger.cpython-312.pyc
│ │ ├── misc.cpython-312.pyc
│ │ └── timer_util.cpython-312.pyc
│ │ ├── create_lmdb.py
│ │ ├── dist_util.py
│ │ ├── download_util.py
│ │ ├── face_util.py
│ │ ├── file_client.py
│ │ ├── flow_util.py
│ │ ├── img_util.py
│ │ ├── lmdb_util.py
│ │ ├── logger.py
│ │ ├── matlab_functions.py
│ │ ├── misc.py
│ │ ├── options.py
│ │ └── timer_util.py
├── RIFE
│ ├── .ipynb_checkpoints
│ │ ├── __init__-checkpoint.py
│ │ ├── runRIFE-checkpoint.py
│ │ └── test_flops-checkpoint.py
│ ├── README.md
│ ├── __init__.py
│ ├── benchmark
│ │ ├── .ipynb_checkpoints
│ │ │ └── Vimeo90K-checkpoint.py
│ │ ├── ATD12K.py
│ │ ├── HD.py
│ │ ├── HD_multi_4X.py
│ │ ├── MiddleBury_Other.py
│ │ ├── UCF101.py
│ │ ├── Vimeo90K.py
│ │ ├── testtime.py
│ │ └── yuv_frame_io.py
│ ├── dataset.py
│ ├── demo
│ │ ├── I0_slomo_clipped.gif
│ │ ├── I1_0.png
│ │ ├── I1_1.png
│ │ ├── I2_0.png
│ │ ├── I2_1.png
│ │ ├── I2_slomo_clipped.gif
│ │ └── intro.png
│ ├── docker
│ │ ├── Dockerfile
│ │ ├── inference_img
│ │ └── inference_video
│ ├── inference_folderims.py
│ ├── inference_img.py
│ ├── inference_video.py
│ ├── model
│ │ ├── IFNet.py
│ │ ├── IFNet_2R.py
│ │ ├── IFNet_m.py
│ │ ├── RIFE.py
│ │ ├── laplacian.py
│ │ ├── loss.py
│ │ ├── oldmodel
│ │ │ ├── IFNet_HD.py
│ │ │ ├── IFNet_HDv2.py
│ │ │ ├── RIFE_HD.py
│ │ │ └── RIFE_HDv2.py
│ │ ├── pytorch_msssim
│ │ │ └── __init__.py
│ │ ├── refine.py
│ │ ├── refine_2R.py
│ │ └── warplayer.py
│ ├── runRIFE.py
│ ├── run_vimeo.py
│ ├── test_flops.py
│ └── train.py
├── SuperSlomo
│ ├── .ipynb_checkpoints
│ │ ├── SuperSlomo-checkpoint.py
│ │ ├── runSuperSlomo-checkpoint.py
│ │ └── test_flops-checkpoint.py
│ ├── Dockerfile
│ ├── LICENSE
│ ├── README.md
│ ├── SuperSlomo.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── SuperSlomo.cpython-312.pyc
│ │ ├── __init__.cpython-312.pyc
│ │ ├── model.cpython-312.pyc
│ │ └── runSuperSlomo.cpython-312.pyc
│ ├── dataloader.py
│ ├── eval.py
│ ├── misc
│ │ ├── original.gif
│ │ └── slomo.gif
│ ├── model.py
│ ├── runSuperSlomo.py
│ ├── test_flops.py
│ ├── train.ipynb
│ ├── train.py
│ └── video_to_slomo.py
├── __init__.py
├── __pycache__
│ ├── BaseModel.cpython-312.pyc
│ ├── Forward_warp.cpython-312.pyc
│ └── __init__.cpython-312.pyc
├── raft
│ ├── .ipynb_checkpoints
│ │ └── __init__-checkpoint.py
│ ├── RAFT-master
│ │ ├── .gitignore
│ │ ├── .ipynb_checkpoints
│ │ │ └── __init__-checkpoint.py
│ │ ├── LICENSE
│ │ ├── RAFT.png
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── alt_cuda_corr
│ │ │ ├── correlation.cpp
│ │ │ ├── correlation_kernel.cu
│ │ │ └── setup.py
│ │ ├── core
│ │ │ ├── .ipynb_checkpoints
│ │ │ │ ├── __init__-checkpoint.py
│ │ │ │ ├── corr-checkpoint.py
│ │ │ │ └── raft-checkpoint.py
│ │ │ ├── __init__.py
│ │ │ ├── corr.py
│ │ │ ├── datasets.py
│ │ │ ├── extractor.py
│ │ │ ├── raft.py
│ │ │ ├── update.py
│ │ │ └── utils
│ │ │ │ ├── .ipynb_checkpoints
│ │ │ │ ├── __init__-checkpoint.py
│ │ │ │ └── utils-checkpoint.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── augmentor.py
│ │ │ │ ├── flow_viz.py
│ │ │ │ ├── frame_utils.py
│ │ │ │ └── utils.py
│ │ ├── demo-frames
│ │ │ ├── frame_0016.png
│ │ │ ├── frame_0017.png
│ │ │ ├── frame_0018.png
│ │ │ ├── frame_0019.png
│ │ │ ├── frame_0020.png
│ │ │ ├── frame_0021.png
│ │ │ ├── frame_0022.png
│ │ │ ├── frame_0023.png
│ │ │ ├── frame_0024.png
│ │ │ └── frame_0025.png
│ │ ├── demo.py
│ │ ├── download_models.sh
│ │ ├── evaluate.py
│ │ ├── train.py
│ │ ├── train_mixed.sh
│ │ └── train_standard.sh
│ ├── __init__.py
│ └── __pycache__
│ │ └── __init__.cpython-312.pyc
├── timelens
│ ├── .gitignore
│ ├── .ipynb_checkpoints
│ │ ├── runtimelens-checkpoint.py
│ │ ├── test_flops-checkpoint.py
│ │ └── test_loader-checkpoint.py
│ ├── README.md
│ ├── TimeLens.ipynb
│ ├── __pycache__
│ │ └── runtimelens.cpython-312.pyc
│ ├── runtimelens.py
│ ├── test_flops.py
│ ├── test_loader.py
│ ├── timelens
│ │ ├── .ipynb_checkpoints
│ │ │ ├── attention_average_network-checkpoint.py
│ │ │ └── run_timelens-checkpoint.py
│ │ ├── __init__.py
│ │ ├── attention_average_network.py
│ │ ├── common
│ │ │ ├── __init__.py
│ │ │ ├── event.py
│ │ │ ├── hybrid_storage.py
│ │ │ ├── image_sequence.py
│ │ │ ├── iterator_modifiers.py
│ │ │ ├── os_tools.py
│ │ │ ├── pytorch_tools.py
│ │ │ ├── representation.py
│ │ │ ├── size_adapter.py
│ │ │ ├── transformers.py
│ │ │ ├── visualization_tools.py
│ │ │ └── warp.py
│ │ ├── fusion_network.py
│ │ ├── refine_warp_network.py
│ │ ├── run_timelens.py
│ │ ├── superslomo
│ │ │ ├── __pycache__
│ │ │ │ └── unet.cpython-312.pyc
│ │ │ └── unet.py
│ │ └── warp_network.py
│ └── viz_all_data.py
└── timelens_flow
│ ├── .gitignore
│ ├── .ipynb_checkpoints
│ ├── runtimelens-checkpoint.py
│ ├── test_flops-checkpoint.py
│ └── test_loader-checkpoint.py
│ ├── README.md
│ ├── TimeLens.ipynb
│ ├── __init__.py
│ ├── __pycache__
│ ├── __init__.cpython-312.pyc
│ └── runtimelens.cpython-312.pyc
│ ├── runtimelens.py
│ ├── test_flops.py
│ ├── test_loader.py
│ ├── timelens
│ ├── .ipynb_checkpoints
│ │ ├── attention_average_network-checkpoint.py
│ │ └── run_timelens-checkpoint.py
│ ├── __init__.py
│ ├── attention_average_network.py
│ ├── common
│ │ ├── __init__.py
│ │ ├── event.py
│ │ ├── hybrid_storage.py
│ │ ├── image_sequence.py
│ │ ├── iterator_modifiers.py
│ │ ├── os_tools.py
│ │ ├── pytorch_tools.py
│ │ ├── representation.py
│ │ ├── size_adapter.py
│ │ ├── transformers.py
│ │ ├── visualization_tools.py
│ │ └── warp.py
│ ├── fusion_network.py
│ ├── masknet.py
│ ├── refine_warp_network.py
│ ├── run_timelens.py
│ ├── superslomo
│ │ └── unet.py
│ └── warp_network.py
│ └── viz_all_data.py
├── params
├── .ipynb_checkpoints
│ ├── BaseParams-checkpoint.py
│ ├── __init__-checkpoint.py
│ └── models-checkpoint.py
├── Adobe
│ ├── .ipynb_checkpoints
│ │ ├── params_testCBMNetx16-checkpoint.py
│ │ ├── params_testCBMNetx32-checkpoint.py
│ │ ├── params_testCBMNetx8-checkpoint.py
│ │ ├── params_testOurs_mix16-checkpoint.py
│ │ ├── params_testOurs_mix32-checkpoint.py
│ │ ├── params_testOurs_mix8-checkpoint.py
│ │ ├── params_testRGBx16-checkpoint.py
│ │ ├── params_testRGBx32-checkpoint.py
│ │ ├── params_testRGBx8-checkpoint.py
│ │ ├── params_testTimeLensx16-checkpoint.py
│ │ ├── params_testTimeLensx32-checkpoint.py
│ │ └── params_testTimeLensx8-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── params_testCBMNetx16.cpython-312.pyc
│ │ ├── params_testCBMNetx32.cpython-312.pyc
│ │ ├── params_testCBMNetx8.cpython-312.pyc
│ │ ├── params_testOurs_mix16.cpython-312.pyc
│ │ ├── params_testOurs_mix32.cpython-312.pyc
│ │ ├── params_testOurs_mix8.cpython-312.pyc
│ │ ├── params_testRGBx16.cpython-312.pyc
│ │ ├── params_testRGBx32.cpython-312.pyc
│ │ ├── params_testRGBx8.cpython-312.pyc
│ │ ├── params_testTimeLensx16.cpython-312.pyc
│ │ ├── params_testTimeLensx32.cpython-312.pyc
│ │ ├── params_testTimeLensx8.cpython-312.pyc
│ │ ├── params_trainREFID_mix.cpython-312.pyc
│ │ └── params_trainREFID_mix32.cpython-312.pyc
│ ├── params_testCBMNetx16.py
│ ├── params_testCBMNetx32.py
│ ├── params_testCBMNetx8.py
│ ├── params_testOurs_mix16.py
│ ├── params_testOurs_mix32.py
│ ├── params_testOurs_mix8.py
│ ├── params_testRGBx16.py
│ ├── params_testRGBx32.py
│ ├── params_testRGBx8.py
│ ├── params_testTimeLensx16.py
│ ├── params_testTimeLensx32.py
│ ├── params_testTimeLensx8.py
│ ├── params_trainREFID_mix.py
│ └── params_trainREFID_mix32.py
├── BaseParams.py
├── GOPRO_release
│ ├── .ipynb_checkpoints
│ │ ├── __init__-checkpoint.py
│ │ ├── models-checkpoint.py
│ │ ├── params_testCBMNet_x32-checkpoint.py
│ │ ├── params_testCBMNet_x8-checkpoint.py
│ │ ├── params_testOurs_mix32-checkpoint.py
│ │ ├── params_testOurs_mix8-checkpoint.py
│ │ ├── params_testTimeLensx32-checkpoint.py
│ │ ├── params_testTimeLensx8-checkpoint.py
│ │ ├── params_trainCBMNet_flow-checkpoint.py
│ │ ├── params_trainCBMNet_joint-checkpoint.py
│ │ ├── params_trainCBMNet_tuning-checkpoint.py
│ │ ├── params_trainCBMNet_tuningGC-checkpoint.py
│ │ ├── params_trainOurs_mix-checkpoint.py
│ │ ├── params_trainREFID_largeMotion-checkpoint.py
│ │ ├── params_trainREFID_mbatch-checkpoint.py
│ │ ├── params_trainREFID_mix-checkpoint.py
│ │ ├── params_trainREFIDadam_mix-checkpoint.py
│ │ ├── params_trainREFIDx32-checkpoint.py
│ │ ├── params_trainREFIDx8-checkpoint.py
│ │ ├── params_trainTimeLens_attention-checkpoint.py
│ │ ├── params_trainTimeLens_flow-checkpoint.py
│ │ ├── params_trainTimeLens_fusion-checkpoint.py
│ │ ├── params_trainTimeLens_mix-checkpoint.py
│ │ └── params_trainTimeLens_refine-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── params_testCBMNet_x32.cpython-312.pyc
│ │ ├── params_testCBMNet_x8.cpython-312.pyc
│ │ ├── params_testOurs_mix32.cpython-312.pyc
│ │ ├── params_testOurs_mix8.cpython-312.pyc
│ │ ├── params_testTimeLensx32.cpython-312.pyc
│ │ ├── params_testTimeLensx8.cpython-312.pyc
│ │ ├── params_trainCBMNet_flow.cpython-312.pyc
│ │ ├── params_trainCBMNet_flow_tune.cpython-312.pyc
│ │ ├── params_trainCBMNet_joint.cpython-312.pyc
│ │ ├── params_trainCBMNet_joint_tune.cpython-312.pyc
│ │ ├── params_trainCBMNet_tuning.cpython-312.pyc
│ │ ├── params_trainCBMNet_tuningGC.cpython-312.pyc
│ │ ├── params_trainOurs_mix.cpython-312.pyc
│ │ ├── params_trainOurs_mix_rerun.cpython-312.pyc
│ │ ├── params_trainREFID_mix.cpython-312.pyc
│ │ ├── params_trainREFID_mix32.cpython-312.pyc
│ │ ├── params_trainREFID_mix8.cpython-312.pyc
│ │ ├── params_trainREFIDadam_mix.cpython-312.pyc
│ │ ├── params_trainREFIDx16.cpython-312.pyc
│ │ ├── params_trainREFIDx32.cpython-312.pyc
│ │ ├── params_trainREFIDx8.cpython-312.pyc
│ │ ├── params_trainTimeLens_attention.cpython-312.pyc
│ │ ├── params_trainTimeLens_flow.cpython-312.pyc
│ │ ├── params_trainTimeLens_fusion.cpython-312.pyc
│ │ ├── params_trainTimeLens_mix.cpython-312.pyc
│ │ └── params_trainTimeLens_refine.cpython-312.pyc
│ ├── params_testCBMNet_x32.py
│ ├── params_testCBMNet_x8.py
│ ├── params_testOurs_mix32.py
│ ├── params_testOurs_mix8.py
│ ├── params_testTimeLensx32.py
│ ├── params_testTimeLensx8.py
│ ├── params_trainCBMNet_flow.py
│ ├── params_trainCBMNet_flow_tune.py
│ ├── params_trainCBMNet_joint.py
│ ├── params_trainCBMNet_joint_tune.py
│ ├── params_trainCBMNet_tuning.py
│ ├── params_trainCBMNet_tuningGC.py
│ ├── params_trainOurs_mix.py
│ ├── params_trainOurs_mix_rerun.py
│ ├── params_trainREFID_mix.py
│ ├── params_trainREFID_mix32.py
│ ├── params_trainREFID_mix8.py
│ ├── params_trainREFIDadam_mix.py
│ ├── params_trainREFIDx16.py
│ ├── params_trainREFIDx32.py
│ ├── params_trainREFIDx8.py
│ ├── params_trainTimeLens_attention.py
│ ├── params_trainTimeLens_flow.py
│ ├── params_trainTimeLens_fusion.py
│ ├── params_trainTimeLens_mix.py
│ └── params_trainTimeLens_refine.py
├── HQEVFI
│ ├── .ipynb_checkpoints
│ │ ├── params_cbmnet-checkpoint.py
│ │ ├── params_cbmnet_adam-checkpoint.py
│ │ ├── params_cbmnet_adam_mix-checkpoint.py
│ │ ├── params_cbmnet_adamx32-checkpoint.py
│ │ ├── params_cbmnet_adamx8-checkpoint.py
│ │ ├── params_testRGBx16-checkpoint.py
│ │ ├── params_testRGBx8-checkpoint.py
│ │ ├── params_timelens-checkpoint.py
│ │ ├── params_timelensx32-checkpoint.py
│ │ ├── params_timelensx8-checkpoint.py
│ │ ├── params_traintest_quick_adam_withlpips-checkpoint.py
│ │ ├── params_traintest_quick_adam_withlpips_mix-checkpoint.py
│ │ ├── params_traintest_quick_adam_withlpipsx32-checkpoint.py
│ │ └── params_traintest_quick_adam_withlpipsx8-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── params_cbmnet_adam_mix.cpython-312.pyc
│ │ ├── params_cbmnet_adam_mix4.cpython-312.pyc
│ │ ├── params_cbmnet_adam_mix8.cpython-312.pyc
│ │ ├── params_timelens_mix.cpython-312.pyc
│ │ ├── params_timelens_mix4.cpython-312.pyc
│ │ ├── params_timelens_mix8.cpython-312.pyc
│ │ ├── params_traintest_quick_adam_withlpips_mix.cpython-312.pyc
│ │ ├── params_traintest_quick_adam_withlpips_mix4.cpython-312.pyc
│ │ └── params_traintest_quick_adam_withlpips_mix8.cpython-312.pyc
│ ├── params_cbmnet_adam_mix.py
│ ├── params_cbmnet_adam_mix4.py
│ ├── params_cbmnet_adam_mix8.py
│ ├── params_timelens_mix.py
│ ├── params_timelens_mix4.py
│ ├── params_timelens_mix8.py
│ ├── params_traintest_quick_adam_withlpips_mix.py
│ ├── params_traintest_quick_adam_withlpips_mix4.py
│ └── params_traintest_quick_adam_withlpips_mix8.py
├── Paths
│ ├── .ipynb_checkpoints
│ │ ├── Adobe240-checkpoint.py
│ │ ├── CBMNet-checkpoint.py
│ │ ├── GOPRO-checkpoint.py
│ │ ├── HSERGB-checkpoint.py
│ │ └── __init__-checkpoint.py
│ ├── Adobe240.py
│ ├── BSERGB.py
│ ├── CBMNet.py
│ ├── GOPRO.py
│ ├── HSERGB.py
│ ├── RealCaptured.py
│ ├── __init__.py
│ └── __pycache__
│ │ ├── Adobe240.cpython-312.pyc
│ │ ├── BSERGB.cpython-312.pyc
│ │ ├── CBMNet.cpython-312.pyc
│ │ ├── GOPRO.cpython-312.pyc
│ │ ├── HSERGB.cpython-312.pyc
│ │ ├── RealCaptured.cpython-312.pyc
│ │ └── __init__.cpython-312.pyc
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-312.pyc
│ └── models.cpython-312.pyc
├── bsergb
│ ├── .ipynb_checkpoints
│ │ ├── params_CBMNet_tuning-checkpoint.py
│ │ ├── params_CBMNet_tuning_x4-checkpoint.py
│ │ ├── params_CBMNet_tuning_x4_adam-checkpoint.py
│ │ ├── params_testRGBx2-checkpoint.py
│ │ ├── params_testRGBx4-checkpoint.py
│ │ ├── params_trainTimeLens_flowx4-checkpoint.py
│ │ ├── params_trainTimeLens_tuning-checkpoint.py
│ │ ├── params_trainTimeLens_tuning_x4-checkpoint.py
│ │ ├── params_traintest_REFID-checkpoint.py
│ │ ├── params_traintest_halfhalf-checkpoint.py
│ │ ├── params_traintest_largelr-checkpoint.py
│ │ ├── params_traintest_multilr-checkpoint.py
│ │ ├── params_traintest_quick-checkpoint.py
│ │ ├── params_traintest_quick_adam-checkpoint.py
│ │ ├── params_traintest_quick_adam_withhalflpips-checkpoint.py
│ │ ├── params_traintest_quick_adam_withhalflpipshalflpips-checkpoint.py
│ │ ├── params_traintest_quick_adam_withlpips-checkpoint.py
│ │ ├── params_traintest_quick_adam_withlpips_iter-checkpoint.py
│ │ ├── params_traintest_quick_adam_withlpips_x2iter-checkpoint.py
│ │ ├── params_traintest_quick_adamannel-checkpoint.py
│ │ ├── params_traintest_quick_largerlr-checkpoint.py
│ │ ├── params_traintest_withEloss-checkpoint.py
│ │ ├── params_traintest_x4-checkpoint.py
│ │ ├── params_traintest_x4AdamwithLPIPS-checkpoint.py
│ │ └── params_traintest_x4_iter-checkpoint.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ ├── params_CBMNet_flow_x4.cpython-312.pyc
│ │ ├── params_CBMNet_tuning.cpython-312.pyc
│ │ ├── params_CBMNet_tuning_x4.cpython-312.pyc
│ │ ├── params_CBMNet_tuning_x4_adam.cpython-312.pyc
│ │ ├── params_testRGBx2.cpython-312.pyc
│ │ ├── params_testRGBx4.cpython-312.pyc
│ │ ├── params_trainTimeLens_flowx4.cpython-312.pyc
│ │ ├── params_trainTimeLens_tuning.cpython-312.pyc
│ │ ├── params_trainTimeLens_tuning_x4.cpython-312.pyc
│ │ ├── params_traintest_quick_adam_withlpips_x4iter.cpython-312.pyc
│ │ └── params_traintest_x4AdamwithLPIPS.cpython-312.pyc
│ ├── params_CBMNet_flow_x4.py
│ ├── params_CBMNet_tuning.py
│ ├── params_CBMNet_tuning_x4.py
│ ├── params_CBMNet_tuning_x4_adam.py
│ ├── params_testRGBx2.py
│ ├── params_testRGBx4.py
│ ├── params_trainTimeLens_flowx4.py
│ ├── params_trainTimeLens_tuning.py
│ ├── params_trainTimeLens_tuning_x4.py
│ ├── params_traintest_quick_adam_withlpips_x4iter.py
│ └── params_traintest_x4AdamwithLPIPS.py
└── models.py
├── prepare_dataset.py
├── requirements.txt
├── run_network.py
└── tools
├── .ipynb_checkpoints
├── __init__-checkpoint.py
├── ffmpeg_v2f-checkpoint.py
├── file_path_index-checkpoint.py
├── initOptimScheduler-checkpoint.py
├── interface_deparse-checkpoint.py
└── model_deparse-checkpoint.py
├── TimeTracker.py
├── __init__.py
├── __pycache__
├── TimeTracker.cpython-312.pyc
├── __init__.cpython-312.pyc
├── file_path_index.cpython-312.pyc
├── initOptimScheduler.cpython-312.pyc
├── interface_deparse.cpython-312.pyc
├── model_deparse.cpython-312.pyc
└── registery.cpython-312.pyc
├── data_acceleration.py
├── ffmpeg_v2f.py
├── file_path_index.py
├── gpu_mem_track.py
├── initOptimScheduler.py
├── interface_deparse.py
├── model_deparse.py
├── modelsize_estimate.py
├── print_grad.py
├── registery.py
└── tools_for_debugging.py
/.gitignore:
--------------------------------------------------------------------------------
1 | RGB*
2 | weights*
3 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/TimeLens-XL.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('loader_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'dataset.BSERGBloader.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/loader_bsergb.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/loader_bsergb.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/loader_bsergb_REFID.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/loader_bsergb_REFID.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/loader_bsergb_augment.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/loader_bsergb_augment.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/loader_bsergb_augment_half.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/loader_bsergb_augment_half.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/loader_bsergb_half.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/loader_bsergb_half.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/loader_bsergb_timelens.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/loader_bsergb_timelens.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BSERGBloader/__pycache__/loader_bsergb_timelens_half.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BSERGBloader/__pycache__/loader_bsergb_timelens_half.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('loader_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'dataset.BaseLoaders.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/dataset/BaseLoaders/.ipynb_checkpoints/loader_ETRFNetv0-checkpoint.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from torch.nn.functional import interpolate
3 | from torchvision.transforms import ToTensor, ToPILImage
4 | import numpy as np
5 | import glob
6 | from natsort import natsorted as sorted
7 | from torch.utils.data import Dataset
8 | import os
9 | from PIL import Image
10 | import random
11 | from tools.registery import DATASET_REGISTRY
12 | from .baseloader import BaseLoader
13 |
14 |
15 | @DATASET_REGISTRY.register()
16 | class loader_ERFNetv0(BaseLoader):
17 | def __init__(self, para, training=True):
18 | super().__init__(para, training)
19 |
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('loader_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'dataset.BaseLoaders.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/baseloader.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/baseloader.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_CBMNet.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_CBMNet.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_CBMNet_fromevents.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_CBMNet_fromevents.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0Mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0Mix.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0Mix_weighted.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0Mix_weighted.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0_denseRGB.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0_denseRGB.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0_withInit.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_ETRFNetv0_withInit.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_EVDI.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_EVDI.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_OursReal.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_OursReal.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_REFID.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_REFID.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_REFID_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_REFID_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_REFID_nonorm.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_REFID_nonorm.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_timelens.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_timelens.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/loader_timelens_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/loader_timelens_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/__pycache__/mixbaseloader.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/BaseLoaders/__pycache__/mixbaseloader.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/BaseLoaders/debug_EVDI.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import torch
3 |
4 | def events_dense_to_sparse(events_in, ind_t, events_channel=16):
5 | previous_events_out = torch.zeros(
6 | (events_channel * 2, events_in.shape[1], events_in.shape[2])).float()
7 | post_events_out = torch.zeros(
8 | (events_channel * 2, events_in.shape[1], events_in.shape[2])).float()
9 | previous_event = events_in[:ind_t, ...]
10 | previous_event = previous_event.flip(0)
11 | previous_index = np.linspace(0, ind_t, events_channel + 1)[1:]
12 | itind = 0
13 | for i in range(ind_t):
14 | if i > previous_index[itind]:
15 | itind += 1
16 | previous_events_out[itind][previous_event[i] > 0] += 1
17 | previous_events_out[itind + events_channel][previous_event[i] < 0] += 1
18 | post_event = events_in[ind_t:, ...]
19 | post_index = np.linspace(0, post_event.shape[0], events_channel + 1)[1:]
20 | itind = 0
21 | for i in range(post_event.shape[0]):
22 | if i > post_index[itind]:
23 | itind += 1
24 | post_events_out[itind][post_event[i] > 0] += 1
25 | post_events_out[itind + events_channel][post_event[i] < 0] += 1
26 | return previous_events_out, post_events_out
27 |
28 | fake_events_in = torch.randn(128, 4, 4)
29 | fake_events_in[fake_events_in > 0.5] = 1
30 | fake_events_in[fake_events_in < -0.5] = -1
31 | fake_events_in[(fake_events_in > -0.5) & (fake_events_in < 0.5)] = 0
32 |
33 | for it in range(8, 15*8+1, 8):
34 | print(it)
35 | events_dense_to_sparse(fake_events_in, it)
--------------------------------------------------------------------------------
/dataset/BaseLoaders/loader_ETRFNetv0.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from torch.nn.functional import interpolate
3 | from torchvision.transforms import ToTensor, ToPILImage
4 | import numpy as np
5 | import glob
6 | from natsort import natsorted as sorted
7 | from torch.utils.data import Dataset
8 | import os
9 | from PIL import Image
10 | import random
11 | from tools.registery import DATASET_REGISTRY
12 | from .baseloader import BaseLoader
13 |
14 |
15 | @DATASET_REGISTRY.register()
16 | class loader_ERFNetv0(BaseLoader):
17 | def __init__(self, para, training=True):
18 | super().__init__(para, training)
19 |
--------------------------------------------------------------------------------
/dataset/BaseLoaders/loader_ETRFNetv0_denseRGB.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from torch.nn.functional import interpolate
3 | from torchvision.transforms import ToTensor, ToPILImage
4 | import numpy as np
5 | import glob
6 | from natsort import natsorted as sorted
7 | from torch.utils.data import Dataset
8 | import os
9 | from PIL import Image
10 | import random
11 | from tools.registery import DATASET_REGISTRY
12 | from .baseloader import BaseLoader
13 |
14 |
15 | @DATASET_REGISTRY.register()
16 | class loader_ERFNetv0_denseRGB(BaseLoader):
17 | def __init__(self, para, training=True):
18 | super().__init__(para, training)
19 |
20 | def samples_indexing(self):
21 | self.samples_list = []
22 | for k in self.data_paths.keys():
23 | rgb_path, evs_path = self.data_paths[k]
24 | indexes = list(range(0, len(rgb_path),
25 | self.rgb_sampling_ratio))
26 | for i_ind in range(0, len(indexes) - self.interp_ratio, 1 if self.training_flag else self.interp_ratio):
27 | # print(i_ind, self.interp_ratio, len(indexes), indexes[0], indexes[-1], len(rgb_path), len(evs_path))
28 | rgb_sample = [rgb_path[sind] for sind in indexes[i_ind:i_ind + self.interp_ratio + 1]]
29 | evs_sample = evs_path[indexes[i_ind]:indexes[i_ind + self.interp_ratio]]
30 | rgb_name = [os.path.splitext(os.path.split(rs)[-1])[0] for rs in rgb_sample]
31 | self.samples_list.append([k, rgb_name, rgb_sample, evs_sample])
32 | # self.samples_list = [self.samples_list[0]]
33 | return
--------------------------------------------------------------------------------
/dataset/BaseLoaders/shape_dict.txt:
--------------------------------------------------------------------------------
1 | acquarium_08 256 0
2 | ball_05 192 0
3 | ball_06 288 10
4 | basket_08 288 0
5 | basket_09 288 0
6 | candies_03 352 0
7 | eggs_04 320 0
8 | elastic_bands_01 352 1
9 | fire_02 192 0
10 | football_04 288 0
11 | horse_11 352 0
12 | horse_12 288 0
13 | horse_13 352 0
14 | horse_18 352 1
15 | horse_20 160 0
16 | jacket_03 192 5
17 | juggling_06 384 0
18 | may28_axe_01 0 64
19 | may29_redbull_01 0 32
20 | may29_water_tank_pouring_02 128 0
21 | orange_juice_02 224 1
22 | paprika_1000_gain_control_02 224 0
23 | pen_03 272 4
24 | rope_jumping_01 256 0
25 | street_crossing_08 32 0
26 | watermelon_01 288 0
27 | acquarium_06 320 0
28 | acquarium_07 320 0
29 | ball_07 192 13
30 | basket_06 256 2
31 | basket_07 288 0
32 | candies_02 256 31
33 | eggs_02 224 0
34 | football_03 384 3
35 | horse_09 384 0
36 | horse_10 10000000000.0 10000000000.0
37 | horse_16 10000000000.0 10000000000.0
38 | horse_19 160 0
39 | juggling_05 352 0
40 | may28_pan_01 0 64
41 | may29_rooftop_handheld_01 0 32
42 | pen_02 352 0
43 | rope_jumping_02 256 1
44 | street_crossing_07 32 0
45 | tomatoes_1000_02 160 0
46 | acquarium_01 288 2
47 | acquarium_02 288 0
48 | acquarium_03 288 0
49 | acquarium_04 320 1
50 | acquarium_05 288 0
51 | ball_00 192 0
52 | ball_02 288 0
53 | ball_03 256 0
54 | ball_04 192 0
55 | basket_00 192 1
56 | basket_01 224 3
57 | basket_02 256 7
58 | basket_03 256 0
59 | basket_04 256 0
60 | basket_05 256 1
61 | eggs_01 256 0
62 | eggs_03 256 0
63 | eggs_05 322 0
64 | elastic_bands_03 192 0
65 | fire_01 192 0
66 | football_01 416 20
67 | football_02 416 15
68 | horse_02 288 0
69 | horse_03 256 0
70 | horse_04 288 0
71 | horse_05 352 0
72 | horse_06 352 0
73 | horse_07 384 0
74 | horse_08 384 0
75 | horse_15_0 320 0
76 | horse_15_1 352 0
77 | horse_17 352 0
78 | horse_riding2 128 0
79 | horse_riding4 128 0
80 | horse_x05 288 0
81 | horse_x14 416 0
82 | may28_pan_color_02 0 64
83 | may28_tennis_baloon_01 0 80
84 | may29_handheld_01 96 0
85 | may29_handheld_02 96 0
86 | may29_handheld_03 0 0
87 | may29_handheld_04 0 32
88 | may29_rooftop_handheld_02 0 32
89 | may29_rooftop_handheld_03 0 32
90 | may29_rooftop_handheld_05 0 0
91 | may29_rooftop_handheld_06 0 0
92 | may29_rooftop_handheld_07 0 0
93 | may29_water_tank_pouring_01 128 0
94 |
--------------------------------------------------------------------------------
/dataset/RC_4816/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('loader_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'dataset.RC_4816.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/dataset/RC_4816/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/RC_4816/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/RC_4816/__pycache__/dataset_dict.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/RC_4816/__pycache__/dataset_dict.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/RC_4816/__pycache__/loader_RC_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/RC_4816/__pycache__/loader_RC_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/RC_4816/__pycache__/loader_RC_timelens_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/RC_4816/__pycache__/loader_RC_timelens_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/RC_4816/__pycache__/mixloader.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/RC_4816/__pycache__/mixloader.cpython-312.pyc
--------------------------------------------------------------------------------
/dataset/RC_4816/loader_RC_mix.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import numpy as np
3 | import os
4 | from tools.registery import DATASET_REGISTRY
5 | from dataset.RC_4816.mixloader import MixLoader
6 |
7 |
8 |
9 |
10 | @DATASET_REGISTRY.register()
11 | class mix_loader_smallRC(MixLoader):
12 | def __init__(self, para, training=True):
13 | super().__init__(para, training)
14 |
--------------------------------------------------------------------------------
/dataset/__init__.py:
--------------------------------------------------------------------------------
1 | import dataset.BaseLoaders
2 | import dataset.BSERGBloader
3 | import dataset.RC_4816
--------------------------------------------------------------------------------
/dataset/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/dataset/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/docs/static/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/docs/static/images/icon.png
--------------------------------------------------------------------------------
/docs/static/images/teaser.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/docs/static/images/teaser.jpg
--------------------------------------------------------------------------------
/docs/static/images/teaser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/docs/static/images/teaser.png
--------------------------------------------------------------------------------
/docs/static/js/index.js:
--------------------------------------------------------------------------------
1 | window.HELP_IMPROVE_VIDEOJS = false;
2 |
3 |
4 | $(document).ready(function() {
5 | // Check for click events on the navbar burger icon
6 |
7 | var options = {
8 | slidesToScroll: 1,
9 | slidesToShow: 1,
10 | loop: true,
11 | infinite: true,
12 | autoplay: true,
13 | autoplaySpeed: 5000,
14 | }
15 |
16 | // Initialize all div with carousel class
17 | var carousels = bulmaCarousel.attach('.carousel', options);
18 |
19 | bulmaSlider.attach();
20 |
21 | })
22 |
--------------------------------------------------------------------------------
/losses/.ipynb_checkpoints/losses_dists-checkpoint.py:
--------------------------------------------------------------------------------
1 | from .DISTS.DISTS_pytorch import DISTS
2 | from tools.registery import LOSS_REGISTRY
3 | import torch
4 |
5 |
6 | @LOSS_REGISTRY.register()
7 | class dists():
8 | def __init__(self, loss_dict):
9 | self.func = DISTS().to(torch.device("cuda"))
10 | self.weight = loss_dict.weight
11 | self.as_loss = loss_dict.as_loss
12 |
13 | def forward(self, x, y):
14 | if self.as_loss:
15 | return self.func(x, y)
16 | else:
17 | return self.func(x, y).detach()
18 |
--------------------------------------------------------------------------------
/losses/.ipynb_checkpoints/losses_lpips-checkpoint.py:
--------------------------------------------------------------------------------
1 | import pyiqa
2 | from tools.registery import LOSS_REGISTRY
3 | import torch
4 | from torch.nn import functional as F
5 |
6 |
7 | @LOSS_REGISTRY.register()
8 | class lpips():
9 | def __init__(self, loss_dict):
10 | self.func = pyiqa.create_metric('lpips', as_loss=loss_dict.as_loss, device=torch.device("cuda"))
11 | self.weight = loss_dict.weight
12 |
13 | def forward(self, x, y):
14 | return self.func(x, y)*self.weight
15 |
16 | @LOSS_REGISTRY.register()
17 | class halflpips():
18 | def __init__(self, loss_dict):
19 | self.func = pyiqa.create_metric('lpips', as_loss=loss_dict.as_loss, device=torch.device("cuda"))
20 | self.weight = loss_dict.weight
21 |
22 | def forward(self, x, y):
23 | if len(x.shape) == 5:
24 | N, T, C, H, W = x.shape
25 | x, y = x.view(-1, C, H, W), y.view(-1, C, H, W)
26 | x, y = F.interpolate(x, scale_factor=0.5, mode='bilinear'), F.interpolate(y, scale_factor=0.5, mode='bilinear')
27 | return self.func(x, y)*self.weight
--------------------------------------------------------------------------------
/losses/DISTS/DISTS_pytorch/__init__.py:
--------------------------------------------------------------------------------
1 | from .DISTS_pt import DISTS
--------------------------------------------------------------------------------
/losses/DISTS/DISTS_pytorch/__pycache__/DISTS_pt.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/DISTS/DISTS_pytorch/__pycache__/DISTS_pt.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/DISTS/DISTS_pytorch/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/DISTS/DISTS_pytorch/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/DISTS/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Keyan Ding
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/losses/DISTS/MANIFEST.in:
--------------------------------------------------------------------------------
1 | -- DISTS_pytorch
2 | -- DISTS_pytorch
3 | -- __init__.py
4 | -- DISTS_pt.py
5 | -- weights.pt
6 | -- README.md
7 | -- requirements.txt
8 | -- LICENSE
--------------------------------------------------------------------------------
/losses/DISTS/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/DISTS/__init__.py
--------------------------------------------------------------------------------
/losses/DISTS/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/DISTS/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/DISTS/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup, find_packages
2 | with open("README.md", "r") as fh:
3 | long_description = fh.read()
4 |
5 | setup(
6 | name='DISTS_pytorch',
7 | version='0.1',
8 | description='Deep Image Structure and Texture Similarity (DISTS) Metric',
9 | long_description=long_description,
10 | long_description_content_type="text/markdown",
11 | packages=['DISTS_pytorch'],
12 | package_data= {'': ['DISTS_pytorch/weights.pt']},
13 | data_files= [('', ['DISTS_pytorch/weights.pt'])],
14 | include_package_data=True,
15 | author='Keyan Ding',
16 | author_email='dingkeyan93@outlook.com',
17 | install_requires=["torch>=1.0"],
18 | url='https://github.com/dingkeyan93/DISTS',
19 | keywords = ['pytorch', 'similarity', 'VGG','texture','structure','metric'],
20 | platforms = "python",
21 | license='MIT',
22 | )
23 |
24 | # python setup.py sdist bdist_wheel
25 | # twine check dist/*
26 | # twine upload dist/*
--------------------------------------------------------------------------------
/losses/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | losses_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('losses_')]
10 | # import all the dataset modules
11 | _losses_modules = [importlib.import_module(f'losses.{file_name}') for file_name in losses_filenames]
12 |
--------------------------------------------------------------------------------
/losses/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/__pycache__/losses_common.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/__pycache__/losses_common.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/__pycache__/losses_dists.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/__pycache__/losses_dists.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/__pycache__/losses_lpips.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/__pycache__/losses_lpips.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/__pycache__/losses_ssim.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/losses/__pycache__/losses_ssim.cpython-312.pyc
--------------------------------------------------------------------------------
/losses/losses_dists.py:
--------------------------------------------------------------------------------
1 | from .DISTS.DISTS_pytorch import DISTS
2 | from tools.registery import LOSS_REGISTRY
3 | import torch
4 |
5 |
6 | @LOSS_REGISTRY.register()
7 | class dists():
8 | def __init__(self, loss_dict):
9 | self.func = DISTS().to(torch.device("cuda"))
10 | self.weight = loss_dict.weight
11 | self.as_loss = loss_dict.as_loss
12 |
13 | def forward(self, x, y):
14 | if self.as_loss:
15 | return self.func(x, y)
16 | else:
17 | return self.func(x, y).detach()
18 |
--------------------------------------------------------------------------------
/losses/losses_lpips.py:
--------------------------------------------------------------------------------
1 | import pyiqa
2 | from tools.registery import LOSS_REGISTRY
3 | import torch
4 | from torch.nn import functional as F
5 |
6 |
7 | @LOSS_REGISTRY.register()
8 | class lpips():
9 | def __init__(self, loss_dict):
10 | self.func = pyiqa.create_metric('lpips', as_loss=loss_dict.as_loss, device=torch.device("cuda"))
11 | self.weight = loss_dict.weight
12 |
13 | def forward(self, x, y):
14 | return self.func(x, y)*self.weight
15 |
16 | @LOSS_REGISTRY.register()
17 | class halflpips():
18 | def __init__(self, loss_dict):
19 | self.func = pyiqa.create_metric('lpips', as_loss=loss_dict.as_loss, device=torch.device("cuda"))
20 | self.weight = loss_dict.weight
21 |
22 | def forward(self, x, y):
23 | if len(x.shape) == 5:
24 | N, T, C, H, W = x.shape
25 | x, y = x.view(-1, C, H, W), y.view(-1, C, H, W)
26 | x, y = F.interpolate(x, scale_factor=0.5, mode='bilinear'), F.interpolate(y, scale_factor=0.5, mode='bilinear')
27 | return self.func(x, y)*self.weight
--------------------------------------------------------------------------------
/losses/losses_ssim.py:
--------------------------------------------------------------------------------
1 | import pyiqa
2 | from tools.registery import LOSS_REGISTRY
3 |
4 |
5 | @LOSS_REGISTRY.register()
6 | class ssim():
7 | def __init__(self, loss_dict):
8 | self.loss_dict = loss_dict
9 | if 'weight' in loss_dict.keys():
10 | self.weight = loss_dict['weight']
11 | loss_dict.pop('weight')
12 | else:
13 | self.weight = 1.
14 | self.loss_item = pyiqa.create_metric('ssim', **loss_dict)
15 |
16 | def forward(self, x, y):
17 | return self.weight*self.loss_item(x.clamp(0., 1.), y.clamp(0., 1.))
--------------------------------------------------------------------------------
/models/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | # from .E_TRFNetv0 import E_TRFNetv0
2 | from .EVDI import EVDI
3 | from .REFID.REFID_twosharpInterp import REFID
4 |
5 | # RGB method
6 | from .SuperSlomo.runSuperSlomo import SuperSlomo
7 | from .RIFE.runRIFE import RIFE
8 |
9 | from models.Expv7_dataprop.runExpv7_dataprop import Expv7_dataprop
10 | from models.Expv7_dataprop_fuse.runExpv7_dataprop_fuse import Expv7_datafuse
11 | from models.Expv7_dataprop_fuseFeat.runExpv7_dataprop_fuseFeat import Expv7_datafuseFeat
12 | from models.Expv7_dataprop_fuseFeat_large.runExpv7_dataprop_fuseFeat_large import Expv7_datafuseFeat_large
13 | from models.Expv7_dataprop_fuseFeat_onlyEvents.runExpv7_dataprop_fuseFeat_onlyEvents import Expv7_datafuseFeat_onlyEvents
14 | from models.Expv7_dataprop_fuseFeat_direct.runExpv7_dataprop_fuseFeat_direct import Expv7_datafuseFeat_direct
15 |
16 | # from models.Expv8.runExpv8 import Expv8
17 | # from models.Expv9.runExpv9 import Expv9
18 | # from models.Expv8_Light.runExpv8_Light import Expv8_Light
19 | from models.Expv8_Lights2.runExpv8_Lights2 import Expv8_Lights2
20 | # for ablation
21 | # from models.Expv8_Lights2_fieldflow.runExpv8_Lights2fieldflow import Expv8_Lights2fieldflow
22 | from models.Expv8_large.runExpv8_large import Expv8_large
23 |
24 | # For peer comparisons
25 | from models.timelens.runtimelens import TimeLens
26 | from models.timelens_flow.runtimelens import TimeLens_flow
27 | # from models.RGBGT.runRGBGT import RGBGT
28 | from models.Expv8_Lights3.runExpv8_Lights3 import Expv8_Lights3
29 | try:
30 | from models.CBMNet.runcbmnet import CBMNet
31 | except:
32 | pass
33 |
34 | from models.CBMNet.runmycbmnet import myCBMNet
35 | # from models.CBMNet.runcbmnet_large import CBMNet_large
36 |
37 | # Ablation study
38 | from models.Expv8_Lights2norefine.runExpv8_Lights2norefine import Expv8_Lights2norefine
39 | from models.Expv8_Lights2fieldflow.runExpv8_Lights2fieldflow import Expv8_Lights2fieldflow
40 | from models.Expv8_Lights2fieldflow_direct.runExpv8_Lights2fieldflow_direct import Expv8_Lights2fieldflow_direct
41 | from models.Expv8_Lights2fieldflownorefine_direct.runExpv8_Lights2fieldflownorefine_direct import Expv8_Lights2fieldflownorefine_direct
42 | from models.RGBGT.runRGBGT import RGBGT
--------------------------------------------------------------------------------
/models/CBMNet/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__
2 | output
--------------------------------------------------------------------------------
/models/CBMNet/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/models/CBMNet/.idea/CBMNet.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/models/CBMNet/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/models/CBMNet/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/models/CBMNet/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/models/CBMNet/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/models/CBMNet/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/models/CBMNet/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/CBMNet/.ipynb_checkpoints/__init__-checkpoint.py
--------------------------------------------------------------------------------
/models/CBMNet/__init__.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | sys.path.append(os.path.join(os.getcwd(), "models/CBMNet/"))
--------------------------------------------------------------------------------
/models/CBMNet/cbmnet_models/final_models/newcorrelation.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from torch.nn import Module
3 | from torch.nn import functional as F
4 | from torch import nn
5 |
6 |
7 | class Correlation(Module):
8 | def __init__(self, pad_size=0, kernel_size=0, max_displacement=0, stride1=1, stride2=2, corr_multiply=1):
9 | super().__init__()
10 | self.pad_size = pad_size
11 | self.kernel_size = kernel_size
12 | self.max_displacement = max_displacement
13 | self.stride1 = stride1
14 | self.stride2 = stride2
15 | self.corr_multiply = corr_multiply
16 | self.sum_down = nn.AvgPool2d(kernel_size, stride=(stride1, stride2))
17 |
18 | def forward(self, input1, input2):
19 | input2_ = F.pad(input2, (self.pad_size, self.pad_size, self.pad_size, self.pad_size), mode='reflect')
20 | corr = []
21 | c, h1, w1 = input1.shape[1:]
22 | for hi in range(self.pad_size*2+1):
23 | for wi in range(self.pad_size*2+1):
24 | corr_cur_compute = input1*input2_[..., hi:hi+h1, wi:wi+w1]
25 | corr_cur_kerneldown = self.sum_down(corr_cur_compute)
26 | corr_cur = torch.sum(corr_cur_kerneldown, 1, keepdim=True)/(c)
27 | corr.append(corr_cur)
28 | return torch.cat(corr, 1)
--------------------------------------------------------------------------------
/models/CBMNet/correlation_package/__init__.py:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/models/CBMNet/correlation_package/correlation_cuda_kernel.cuh:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | int correlation_forward_cuda_kernel(at::Tensor& output,
8 | int ob,
9 | int oc,
10 | int oh,
11 | int ow,
12 | int osb,
13 | int osc,
14 | int osh,
15 | int osw,
16 |
17 | at::Tensor& input1,
18 | int ic,
19 | int ih,
20 | int iw,
21 | int isb,
22 | int isc,
23 | int ish,
24 | int isw,
25 |
26 | at::Tensor& input2,
27 | int gc,
28 | int gsb,
29 | int gsc,
30 | int gsh,
31 | int gsw,
32 |
33 | at::Tensor& rInput1,
34 | at::Tensor& rInput2,
35 | int pad_size,
36 | int kernel_size,
37 | int max_displacement,
38 | int stride1,
39 | int stride2,
40 | int corr_type_multiply,
41 | cudaStream_t stream);
42 |
43 |
44 | int correlation_backward_cuda_kernel(
45 | at::Tensor& gradOutput,
46 | int gob,
47 | int goc,
48 | int goh,
49 | int gow,
50 | int gosb,
51 | int gosc,
52 | int gosh,
53 | int gosw,
54 |
55 | at::Tensor& input1,
56 | int ic,
57 | int ih,
58 | int iw,
59 | int isb,
60 | int isc,
61 | int ish,
62 | int isw,
63 |
64 | at::Tensor& input2,
65 | int gsb,
66 | int gsc,
67 | int gsh,
68 | int gsw,
69 |
70 | at::Tensor& gradInput1,
71 | int gisb,
72 | int gisc,
73 | int gish,
74 | int gisw,
75 |
76 | at::Tensor& gradInput2,
77 | int ggc,
78 | int ggsb,
79 | int ggsc,
80 | int ggsh,
81 | int ggsw,
82 |
83 | at::Tensor& rInput1,
84 | at::Tensor& rInput2,
85 | int pad_size,
86 | int kernel_size,
87 | int max_displacement,
88 | int stride1,
89 | int stride2,
90 | int corr_type_multiply,
91 | cudaStream_t stream);
92 |
--------------------------------------------------------------------------------
/models/CBMNet/correlation_package/nvcc setting.md:
--------------------------------------------------------------------------------
1 | # How to set the nvcc version (Default:CUDA-11.0)
2 |
3 | ## Pre-requisite
4 |
5 | Check installed `cuda-11.0` path:
6 | ```bash
7 | $ cd /usr/local
8 | $ find . -maxdepth 1 -name 'cuda-11.0'
9 | ```
10 | - If there is no `cuda-11.0` folder in the directory, install `cuda-11.0` first.
11 |
12 | ## Change environments of the terminal (temporal)
13 | Change your terminal `PATH` and `LD_LIBRARY_PATH`:
14 | ```bash
15 | $ export PATH=/usr/local/cuda-11.0/bin${PATH:+:${PATH}}
16 | $ export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64
17 | $ nvcc --version
18 | ```
19 | ## Change default environments of the terminal
20 | For change default `nvcc` version of your terminal, you should add below two lines in your `~/.bashrc`.
21 | ```bash
22 | $ gedit ~/.bashrc
23 | export PATH=/usr/local/cuda-11.0/bin${PATH:+:${PATH}}
24 | export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64
25 | ```
26 | Save and then open new terminal:
27 | ```bash
28 | $ nvcc --version
29 | ```
30 |
--------------------------------------------------------------------------------
/models/CBMNet/correlation_package/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | # Minimum requirements for the build system to execute.
3 | requires = ["setuptools", "wheel", "numpy", "torch"] # PEP 508 specifications.
4 |
--------------------------------------------------------------------------------
/models/CBMNet/correlation_package/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import os
3 | import torch
4 |
5 | from setuptools import setup, find_packages
6 | from torch.utils.cpp_extension import BuildExtension, CUDAExtension
7 |
8 | cxx_args = ['-std=c++14']
9 |
10 | nvcc_args = [
11 | '-gencode', 'arch=compute_50,code=sm_50',
12 | '-gencode', 'arch=compute_52,code=sm_52',
13 | '-gencode', 'arch=compute_60,code=sm_60',
14 | '-gencode', 'arch=compute_61,code=sm_61',
15 | '-gencode', 'arch=compute_70,code=sm_70',
16 | '-gencode', 'arch=compute_70,code=compute_70'
17 | ]
18 |
19 | setup(
20 | name='correlation_cuda',
21 | ext_modules=[
22 | CUDAExtension('correlation_cuda', [
23 | 'correlation_cuda.cc',
24 | 'correlation_cuda_kernel.cu'
25 | ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
26 | ],
27 | cmdclass={
28 | 'build_ext': BuildExtension
29 | })
30 |
--------------------------------------------------------------------------------
/models/CBMNet/install_correlation.sh:
--------------------------------------------------------------------------------
1 | cd correlation_package
2 | python setup.py install
3 | cd ..
--------------------------------------------------------------------------------
/models/CBMNet/pretrained_model/README.md:
--------------------------------------------------------------------------------
1 | ### put the downloaded model here
--------------------------------------------------------------------------------
/models/CBMNet/utils.py:
--------------------------------------------------------------------------------
1 | import os
2 | import numpy as np
3 |
4 | def str2bool(v):
5 | return v.lower() in ('true')
6 |
7 | def tensor2numpy(tensor, rgb_range=1.):
8 | rgb_coefficient = 255 / rgb_range
9 | img = tensor.mul(rgb_coefficient).clamp(0, 255).round()
10 | img = img[0].data
11 | img = np.transpose(img.cpu().numpy(), (1, 2, 0)).astype(np.uint8)
12 | return img
13 |
14 | def batch2device(dictionary_of_tensors):
15 | if isinstance(dictionary_of_tensors, dict):
16 | return {key: batch2device(value) for key, value in dictionary_of_tensors.items()}
17 | return dictionary_of_tensors.cuda()
18 |
19 | def str2bool(v):
20 | return v.lower() in ('true')
21 |
22 | def randomCrop(tensor, x, y, height, width):
23 | tensor = tensor[..., y:y+height, x:x+width]
24 | return tensor
25 |
26 | def tensor2numpy(tensor, rgb_range=1.):
27 | rgb_coefficient = 255 / rgb_range
28 | img = tensor.mul(rgb_coefficient).clamp(0, 255).round()
29 | img = img[0].data
30 | img = np.transpose(img.cpu().numpy(), (1, 2, 0)).astype(np.uint8)
31 | return img
32 |
33 | def tensor2numpy_batch_idxs(tensor, batch_idx, rgb_range=1.):
34 | rgb_coefficient = 255 / rgb_range
35 | img = tensor.mul(rgb_coefficient).clamp(0, 255).round()
36 | img = img[batch_idx].data
37 | img = np.transpose(img.cpu().numpy(), (1, 2, 0)).astype(np.uint8)
38 | return img
--------------------------------------------------------------------------------
/models/EVDI/.ipynb_checkpoints/EVDI_Net_flops_and_macs-checkpoint.txt:
--------------------------------------------------------------------------------
1 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x2 [MACs] 37.231 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.000 G
2 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x4 [MACs] 111.693 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.001 G
3 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x6 [MACs] 186.154 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.002 G
4 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x8 [MACs] 260.616 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.003 G
5 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x10 [MACs] 335.078 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.004 G
6 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x12 [MACs] 409.540 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.004 G
7 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x14 [MACs] 484.001 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.005 G
8 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x16 [MACs] 558.463 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.006 G
9 |
--------------------------------------------------------------------------------
/models/EVDI/EVDI_Net_flops_and_macs.txt:
--------------------------------------------------------------------------------
1 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x2 [MACs] 37.231 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.000 G
2 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x4 [MACs] 111.693 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.001 G
3 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x6 [MACs] 186.154 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.002 G
4 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x8 [MACs] 260.616 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.003 G
5 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x10 [MACs] 335.078 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.004 G
6 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x12 [MACs] 409.540 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.004 G
7 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x14 [MACs] 484.001 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.005 G
8 | [MODEL NAME] EVDI_Net [INPUT INFO] 256x256x16 [MACs] 558.463 GMACs [AVERAGE MACs]: 37.231 GMACs[PARAMs] 0.006 G
9 |
--------------------------------------------------------------------------------
/models/EVDI/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/EVDI/__init__.py
--------------------------------------------------------------------------------
/models/EVDI/__pycache__/EVDI.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/EVDI/__pycache__/EVDI.cpython-312.pyc
--------------------------------------------------------------------------------
/models/EVDI/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/EVDI/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/EVDI/__pycache__/networks.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/EVDI/__pycache__/networks.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | '''
2 | Initial network Expv4_withlargeConv
3 | Adjustments:
4 | * Mask is done in 1/4 resolution
5 | '''
--------------------------------------------------------------------------------
/models/Expv8_Lights3/__init__.py:
--------------------------------------------------------------------------------
1 | '''
2 | Initial network Expv4_withlargeConv
3 | Adjustments:
4 | * Mask is done in 1/4 resolution
5 | '''
--------------------------------------------------------------------------------
/models/Expv8_Lights3/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/__pycache__/runExpv8_Lights3.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/__pycache__/runExpv8_Lights3.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/.ipynb_checkpoints/TimeTracker-checkpoint.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | class Ttracker():
4 | def __init__(self, track=False, count_step=10):
5 | self.if_track = track
6 | self.count = 0
7 | self.count_step = count_step
8 | self.record = {str(self.count):{}}
9 | self.last_time = time.time()
10 | self.count_start = None
11 |
12 | def count_plus(self):
13 | self.record[str(self.count)]['start'] = [time.time()-self.count_start]
14 | self.count += 1
15 | if self.count % self.count_step == 0:
16 | self.print()
17 | self.record.update({str(self.count):{}})
18 |
19 | def print(self):
20 | with open('time_analysis.txt', 'a+') as f:
21 | f.write(f'From {self.count-self.count_step} to {self.count-1}\n')
22 | keys = self.record[str(self.count-1)].keys()
23 | for k in keys:
24 | time_ana = 0.
25 | for count in self.record.keys():
26 | time_ana += self.record[count][k][0]
27 | f.write(f"{k}, avg: {time_ana/self.count_step*1000:.4f} ms\n")
28 | self.record = {}
29 |
30 | def time_init(self):
31 | self.last_time= time.time()
32 |
33 | def time_init_count(self):
34 | self.count_start = time.time()
35 |
36 |
37 |
38 | def track(self, record):
39 | if not self.if_track:
40 | return
41 | self.record[str(self.count)].update({
42 | str(record):[time.time()-self.last_time]
43 | })
44 | self.time_init()
45 | return
46 |
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | import importlib
2 | from os import path as osp
3 |
4 | from ..utils import scandir
5 |
6 | # automatically scan and import arch modules
7 | # scan all the files under the 'archs' folder and collect files ending with
8 | # '_arch.py'
9 | arch_folder = osp.dirname(osp.abspath(__file__))
10 | arch_filenames = [
11 | osp.splitext(osp.basename(v))[0] for v in scandir(arch_folder)
12 | if v.endswith('_arch.py')
13 | ]
14 | # import all the arch modules
15 | _arch_modules = [
16 | importlib.import_module(f'models.Expv8_Lights2.archs.{file_name}')
17 | for file_name in arch_filenames
18 | ]
19 |
20 |
21 | def dynamic_instantiation(modules, cls_type, opt):
22 | """Dynamically instantiate class.
23 |
24 | Args:
25 | modules (list[importlib modules]): List of modules from importlib
26 | files.
27 | cls_type (str): Class type.
28 | opt (dict): Class initialization kwargs.
29 |
30 | Returns:
31 | class: Instantiated class.
32 | """
33 |
34 | for module in modules:
35 | cls_ = getattr(module, cls_type, None)
36 | if cls_ is not None:
37 | break
38 | if cls_ is None:
39 | raise ValueError(f'{cls_type} is not found.')
40 | return cls_(**opt)
41 |
42 |
43 | def define_network(opt):
44 | network_type = opt.pop('type')
45 | net = dynamic_instantiation(_arch_modules, network_type, opt)
46 | return net
47 |
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/__init__.py:
--------------------------------------------------------------------------------
1 | import importlib
2 | from os import path as osp
3 |
4 | from ..utils import scandir
5 |
6 | # automatically scan and import arch modules
7 | # scan all the files under the 'archs' folder and collect files ending with
8 | # '_arch.py'
9 | arch_folder = osp.dirname(osp.abspath(__file__))
10 | arch_filenames = [
11 | osp.splitext(osp.basename(v))[0] for v in scandir(arch_folder)
12 | if v.endswith('_arch.py')
13 | ]
14 | # import all the arch modules
15 | _arch_modules = [
16 | importlib.import_module(f'models.Expv8_Lights3.archs.{file_name}')
17 | for file_name in arch_filenames
18 | ]
19 |
20 |
21 | def dynamic_instantiation(modules, cls_type, opt):
22 | """Dynamically instantiate class.
23 |
24 | Args:
25 | modules (list[importlib modules]): List of modules from importlib
26 | files.
27 | cls_type (str): Class type.
28 | opt (dict): Class initialization kwargs.
29 |
30 | Returns:
31 | class: Instantiated class.
32 | """
33 |
34 | for module in modules:
35 | cls_ = getattr(module, cls_type, None)
36 | if cls_ is not None:
37 | break
38 | if cls_ is None:
39 | raise ValueError(f'{cls_type} is not found.')
40 | return cls_(**opt)
41 |
42 |
43 | def define_network(opt):
44 | network_type = opt.pop('type')
45 | net = dynamic_instantiation(_arch_modules, network_type, opt)
46 | return net
47 |
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/__pycache__/XXNet_final_attenfusion_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/archs/__pycache__/XXNet_final_attenfusion_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/archs/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/__pycache__/encoder_module.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/archs/__pycache__/encoder_module.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/__pycache__/flow_decoder.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/archs/__pycache__/flow_decoder.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/__pycache__/warp_layer.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/archs/__pycache__/warp_layer.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/data_analysis.py:
--------------------------------------------------------------------------------
1 | from tools import toim
2 | import os
3 | import torch
4 |
5 |
6 | target_path = 'vis_data'
7 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
8 | mkdir(target_path)
9 |
10 |
11 | def vis_events(e, ind):
12 | dm = max(torch.max(e).item(), torch.max(-e).item())
13 | print(e.max(), e.min())
14 | e = e/(2*dm)+0.5
15 | print(dm, e.max(), e.min())
16 | toim(e).save(os.path.join(target_path, f"{ind}.jpg"))
--------------------------------------------------------------------------------
/models/Expv8_Lights3/archs/warp_layer.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 |
4 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
5 | backwarp_tenGrid = {}
6 |
7 |
8 | def warp(tenInput, tenFlow):
9 | k = (str(tenFlow.device), str(tenFlow.size()))
10 | if k not in backwarp_tenGrid:
11 | tenHorizontal = torch.linspace(-1.0, 1.0, tenFlow.shape[3], device=device).view(
12 | 1, 1, 1, tenFlow.shape[3]).expand(tenFlow.shape[0], -1, tenFlow.shape[2], -1)
13 | tenVertical = torch.linspace(-1.0, 1.0, tenFlow.shape[2], device=device).view(
14 | 1, 1, tenFlow.shape[2], 1).expand(tenFlow.shape[0], -1, -1, tenFlow.shape[3])
15 | backwarp_tenGrid[k] = torch.cat(
16 | [tenHorizontal, tenVertical], 1).to(device)
17 |
18 | tenFlow = torch.cat([tenFlow[:, 0:1, :, :] / ((tenInput.shape[3] - 1.0) / 2.0),
19 | tenFlow[:, 1:2, :, :] / ((tenInput.shape[2] - 1.0) / 2.0)], 1)
20 |
21 | g = (backwarp_tenGrid[k] + tenFlow).permute(0, 2, 3, 1)
22 | return torch.nn.functional.grid_sample(input=tenInput, grid=g, mode='bilinear', padding_mode='border', align_corners=True)
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__init__.py:
--------------------------------------------------------------------------------
1 | from .file_client import FileClient
2 | from .img_util import crop_border, imfrombytes, img2tensor, imwrite, tensor2img, padding, voxel2voxeltensor
3 | from .logger import (MessageLogger, get_env_info, get_root_logger,
4 | init_tb_logger, init_wandb_logger)
5 | from .misc import (check_resume, get_time_str, make_exp_dirs, mkdir_and_rename,
6 | scandir, scandir_SIDD, set_random_seed, sizeof_fmt)
7 | from .create_lmdb import (create_lmdb_for_reds, create_lmdb_for_gopro, create_lmdb_for_rain13k)
8 | from .timer_util import CudaTimer, Timer
9 |
10 | __all__ = [
11 | # file_client.py
12 | 'FileClient',
13 | # img_util.py
14 | 'img2tensor',
15 | 'voxel2voxeltensor',
16 | 'tensor2img',
17 | 'imfrombytes',
18 | 'imwrite',
19 | 'crop_border',
20 | # logger.py
21 | 'MessageLogger',
22 | 'init_tb_logger',
23 | 'init_wandb_logger',
24 | 'get_root_logger',
25 | 'get_env_info',
26 | # misc.py
27 | 'set_random_seed',
28 | 'get_time_str',
29 | 'mkdir_and_rename',
30 | 'make_exp_dirs',
31 | 'scandir',
32 | 'check_resume',
33 | 'sizeof_fmt',
34 | 'padding',
35 | 'create_lmdb_for_reds',
36 | 'create_lmdb_for_gopro',
37 | 'create_lmdb_for_rain13k',
38 | # timer_util.py
39 | 'CudaTimer',
40 | 'Timer',
41 | ]
42 |
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/create_lmdb.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/create_lmdb.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/dist_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/dist_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/file_client.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/file_client.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/img_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/img_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/logger.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/logger.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/misc.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/misc.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/__pycache__/timer_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/__pycache__/timer_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/download_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/download_util.py
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/face_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/face_util.py
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/flow_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/flow_util.py
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/lmdb_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/lmdb_util.py
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/options.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_Lights3/utils/options.py
--------------------------------------------------------------------------------
/models/Expv8_Lights3/utils/timer_util.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import time
3 | import numpy as np
4 | import atexit
5 |
6 | cuda_timers = {}
7 | timers = {}
8 |
9 |
10 | class CudaTimer:
11 | def __init__(self, timer_name=''):
12 | self.timer_name = timer_name
13 | if self.timer_name not in cuda_timers:
14 | cuda_timers[self.timer_name] = []
15 |
16 | self.start = torch.cuda.Event(enable_timing=True)
17 | self.end = torch.cuda.Event(enable_timing=True)
18 |
19 | def __enter__(self):
20 | self.start.record()
21 | return self
22 |
23 | def __exit__(self, *args):
24 | self.end.record()
25 | torch.cuda.synchronize()
26 | cuda_timers[self.timer_name].append(self.start.elapsed_time(self.end))
27 |
28 |
29 | class Timer:
30 | def __init__(self, timer_name=''):
31 | self.timer_name = timer_name
32 | if self.timer_name not in timers:
33 | timers[self.timer_name] = []
34 |
35 | def __enter__(self):
36 | self.start = time.time()
37 | return self
38 |
39 | def __exit__(self, *args):
40 | self.end = time.time()
41 | self.interval = self.end - self.start # measured in seconds
42 | self.interval *= 1000.0 # convert to milliseconds
43 | timers[self.timer_name].append(self.interval)
44 |
45 |
46 | def print_timing_info():
47 | print('== Timing statistics ==')
48 | for timer_name, timing_values in [*cuda_timers.items(), *timers.items()]:
49 | timing_value = np.mean(np.array(timing_values))
50 | if timing_value < 1000.0:
51 | print('{}: {:.2f} ms'.format(timer_name, timing_value))
52 | else:
53 | print('{}: {:.2f} s'.format(timer_name, timing_value / 1000.0))
54 |
55 |
56 | # this will print all the timer values upon termination of any program that imported this file
57 | # atexit.register(print_timing_info)
58 |
--------------------------------------------------------------------------------
/models/Expv8_large/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | '''
2 | Initial network Expv4_withlargeConv
3 | Adjustments:
4 | * Mask is done in 1/4 resolution
5 | '''
--------------------------------------------------------------------------------
/models/Expv8_large/__init__.py:
--------------------------------------------------------------------------------
1 | '''
2 | Initial network Expv4_withlargeConv
3 | Adjustments:
4 | * Mask is done in 1/4 resolution
5 | '''
--------------------------------------------------------------------------------
/models/Expv8_large/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/__pycache__/runExpv8_large.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/__pycache__/runExpv8_large.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/archs/.ipynb_checkpoints/TimeTracker-checkpoint.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | class Ttracker():
4 | def __init__(self, track=False, count_step=10):
5 | self.if_track = track
6 | self.count = 0
7 | self.count_step = count_step
8 | self.record = {str(self.count):{}}
9 | self.last_time = time.time()
10 | self.count_start = None
11 |
12 | def count_plus(self):
13 | self.record[str(self.count)]['start'] = [time.time()-self.count_start]
14 | self.count += 1
15 | if self.count % self.count_step == 0:
16 | self.print()
17 | self.record.update({str(self.count):{}})
18 |
19 | def print(self):
20 | with open('time_analysis.txt', 'a+') as f:
21 | f.write(f'From {self.count-self.count_step} to {self.count-1}\n')
22 | keys = self.record[str(self.count-1)].keys()
23 | for k in keys:
24 | time_ana = 0.
25 | for count in self.record.keys():
26 | time_ana += self.record[count][k][0]
27 | f.write(f"{k}, avg: {time_ana/self.count_step*1000:.4f} ms\n")
28 | self.record = {}
29 |
30 | def time_init(self):
31 | self.last_time= time.time()
32 |
33 | def time_init_count(self):
34 | self.count_start = time.time()
35 |
36 |
37 |
38 | def track(self, record):
39 | if not self.if_track:
40 | return
41 | self.record[str(self.count)].update({
42 | str(record):[time.time()-self.last_time]
43 | })
44 | self.time_init()
45 | return
46 |
--------------------------------------------------------------------------------
/models/Expv8_large/archs/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | import importlib
2 | from os import path as osp
3 |
4 | from ..utils import scandir
5 |
6 | # automatically scan and import arch modules
7 | # scan all the files under the 'archs' folder and collect files ending with
8 | # '_arch.py'
9 | arch_folder = osp.dirname(osp.abspath(__file__))
10 | arch_filenames = [
11 | osp.splitext(osp.basename(v))[0] for v in scandir(arch_folder)
12 | if v.endswith('_arch.py')
13 | ]
14 | # import all the arch modules
15 | _arch_modules = [
16 | importlib.import_module(f'models.Expv8_Lights2.archs.{file_name}')
17 | for file_name in arch_filenames
18 | ]
19 |
20 |
21 | def dynamic_instantiation(modules, cls_type, opt):
22 | """Dynamically instantiate class.
23 |
24 | Args:
25 | modules (list[importlib modules]): List of modules from importlib
26 | files.
27 | cls_type (str): Class type.
28 | opt (dict): Class initialization kwargs.
29 |
30 | Returns:
31 | class: Instantiated class.
32 | """
33 |
34 | for module in modules:
35 | cls_ = getattr(module, cls_type, None)
36 | if cls_ is not None:
37 | break
38 | if cls_ is None:
39 | raise ValueError(f'{cls_type} is not found.')
40 | return cls_(**opt)
41 |
42 |
43 | def define_network(opt):
44 | network_type = opt.pop('type')
45 | net = dynamic_instantiation(_arch_modules, network_type, opt)
46 | return net
47 |
--------------------------------------------------------------------------------
/models/Expv8_large/archs/__init__.py:
--------------------------------------------------------------------------------
1 | import importlib
2 | from os import path as osp
3 |
4 | from ..utils import scandir
5 |
6 | # automatically scan and import arch modules
7 | # scan all the files under the 'archs' folder and collect files ending with
8 | # '_arch.py'
9 | arch_folder = osp.dirname(osp.abspath(__file__))
10 | arch_filenames = [
11 | osp.splitext(osp.basename(v))[0] for v in scandir(arch_folder)
12 | if v.endswith('_arch.py')
13 | ]
14 | # import all the arch modules
15 | _arch_modules = [
16 | importlib.import_module(f'models.Expv8_large.archs.{file_name}')
17 | for file_name in arch_filenames
18 | ]
19 |
20 |
21 | def dynamic_instantiation(modules, cls_type, opt):
22 | """Dynamically instantiate class.
23 |
24 | Args:
25 | modules (list[importlib modules]): List of modules from importlib
26 | files.
27 | cls_type (str): Class type.
28 | opt (dict): Class initialization kwargs.
29 |
30 | Returns:
31 | class: Instantiated class.
32 | """
33 |
34 | for module in modules:
35 | cls_ = getattr(module, cls_type, None)
36 | if cls_ is not None:
37 | break
38 | if cls_ is None:
39 | raise ValueError(f'{cls_type} is not found.')
40 | return cls_(**opt)
41 |
42 |
43 | def define_network(opt):
44 | network_type = opt.pop('type')
45 | net = dynamic_instantiation(_arch_modules, network_type, opt)
46 | return net
47 |
--------------------------------------------------------------------------------
/models/Expv8_large/archs/__pycache__/XXNet_final_attenfusion_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/archs/__pycache__/XXNet_final_attenfusion_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/archs/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/archs/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/archs/__pycache__/encoder_module.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/archs/__pycache__/encoder_module.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/archs/__pycache__/flow_decoder.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/archs/__pycache__/flow_decoder.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/archs/__pycache__/warp_layer.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/archs/__pycache__/warp_layer.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/archs/data_analysis.py:
--------------------------------------------------------------------------------
1 | from tools import toim
2 | import os
3 | import torch
4 |
5 |
6 | target_path = 'vis_data'
7 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
8 | mkdir(target_path)
9 |
10 |
11 | def vis_events(e, ind):
12 | dm = max(torch.max(e).item(), torch.max(-e).item())
13 | print(e.max(), e.min())
14 | e = e/(2*dm)+0.5
15 | print(dm, e.max(), e.min())
16 | toim(e).save(os.path.join(target_path, f"{ind}.jpg"))
--------------------------------------------------------------------------------
/models/Expv8_large/archs/warp_layer.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 |
4 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
5 | backwarp_tenGrid = {}
6 |
7 |
8 | def warp(tenInput, tenFlow):
9 | k = (str(tenFlow.device), str(tenFlow.size()))
10 | if k not in backwarp_tenGrid:
11 | tenHorizontal = torch.linspace(-1.0, 1.0, tenFlow.shape[3], device=device).view(
12 | 1, 1, 1, tenFlow.shape[3]).expand(tenFlow.shape[0], -1, tenFlow.shape[2], -1)
13 | tenVertical = torch.linspace(-1.0, 1.0, tenFlow.shape[2], device=device).view(
14 | 1, 1, tenFlow.shape[2], 1).expand(tenFlow.shape[0], -1, -1, tenFlow.shape[3])
15 | backwarp_tenGrid[k] = torch.cat(
16 | [tenHorizontal, tenVertical], 1).to(device)
17 |
18 | tenFlow = torch.cat([tenFlow[:, 0:1, :, :] / ((tenInput.shape[3] - 1.0) / 2.0),
19 | tenFlow[:, 1:2, :, :] / ((tenInput.shape[2] - 1.0) / 2.0)], 1)
20 |
21 | g = (backwarp_tenGrid[k] + tenFlow).permute(0, 2, 3, 1)
22 | return torch.nn.functional.grid_sample(input=tenInput, grid=g, mode='bilinear', padding_mode='border', align_corners=True)
--------------------------------------------------------------------------------
/models/Expv8_large/test_flops.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import sys
3 | import os
4 | sys.path.append(os.getcwd())
5 | from thop import profile
6 | from models.Expv8_large.runExpv8_large import Expv8_large
7 | from params.GOPRO_release.params_trainOurs_mix import trainGOPRO_Ours
8 | from easydict import EasyDict as ED
9 | import time
10 |
11 | args = ED()
12 | args.model_name = 'Expv8_large'
13 | args.extension = ''
14 | args.clear_previous = None
15 | args.model_pretrained = None
16 | args.calc_flops = True
17 |
18 | params = trainGOPRO_Ours(args)
19 | records = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), f'{args.model_name}_flops_and_macs.txt'), 'a+')
20 | # params.training_config.crop_size = 64
21 |
22 |
23 | params.training_config.interp_ratio = 16
24 | params.real_interp = 16
25 | # params.real_interp = 4
26 | params.save_flow = False
27 | params.save_images = False
28 |
29 | params.debug = False
30 | datashape_h, datashape_w = 608, 768
31 | # datashape_h, datashape_w = params.training_config.crop_size, params.training_config.crop_size
32 |
33 | net = Expv8_large(params).cuda()
34 | left_frame = torch.randn(1, 3, datashape_h, datashape_w).float().cuda()
35 | right_frame = torch.randn(1, 3, datashape_h, datashape_w).float().cuda()
36 | events = torch.randn(1, 128, datashape_h, datashape_w).float().cuda()
37 |
38 | macs, model_params = 0, 0
39 |
40 | outprofile = profile(net, inputs=(left_frame, right_frame, events, 16))
41 | macs += outprofile[0]
42 | model_params += outprofile[1]
43 | content = f'[MODEL NAME] {args.model_name} '\
44 | f'[INPUT INFO] {datashape_h}x{datashape_w}x{params.training_config.interp_ratio} '\
45 | f'[MACs] {macs/1e9:.3f} GMACs [AVERAGE MACs]: {macs/1e9/(params.real_interp-1):.3f} GMACs'\
46 | f'[PARAMs] {model_params/1e9:.3f} G'
47 | print('-'*20)
48 | print(content)
49 |
50 | with torch.no_grad():
51 | res = net(left_frame, right_frame, events, params.training_config.interp_ratio)
52 | t = time.time()
53 | for i in range(10):
54 | res = net(left_frame, right_frame, events, params.training_config.interp_ratio)
55 | print((time.time()-t)/10/(params.real_interp-1))
56 |
57 | records.write(content+'\n')
58 |
59 |
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__init__.py:
--------------------------------------------------------------------------------
1 | from .file_client import FileClient
2 | from .img_util import crop_border, imfrombytes, img2tensor, imwrite, tensor2img, padding, voxel2voxeltensor
3 | from .logger import (MessageLogger, get_env_info, get_root_logger,
4 | init_tb_logger, init_wandb_logger)
5 | from .misc import (check_resume, get_time_str, make_exp_dirs, mkdir_and_rename,
6 | scandir, scandir_SIDD, set_random_seed, sizeof_fmt)
7 | from .create_lmdb import (create_lmdb_for_reds, create_lmdb_for_gopro, create_lmdb_for_rain13k)
8 | from .timer_util import CudaTimer, Timer
9 |
10 | __all__ = [
11 | # file_client.py
12 | 'FileClient',
13 | # img_util.py
14 | 'img2tensor',
15 | 'voxel2voxeltensor',
16 | 'tensor2img',
17 | 'imfrombytes',
18 | 'imwrite',
19 | 'crop_border',
20 | # logger.py
21 | 'MessageLogger',
22 | 'init_tb_logger',
23 | 'init_wandb_logger',
24 | 'get_root_logger',
25 | 'get_env_info',
26 | # misc.py
27 | 'set_random_seed',
28 | 'get_time_str',
29 | 'mkdir_and_rename',
30 | 'make_exp_dirs',
31 | 'scandir',
32 | 'check_resume',
33 | 'sizeof_fmt',
34 | 'padding',
35 | 'create_lmdb_for_reds',
36 | 'create_lmdb_for_gopro',
37 | 'create_lmdb_for_rain13k',
38 | # timer_util.py
39 | 'CudaTimer',
40 | 'Timer',
41 | ]
42 |
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/create_lmdb.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/create_lmdb.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/dist_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/dist_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/file_client.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/file_client.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/img_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/img_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/logger.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/logger.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/misc.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/misc.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/__pycache__/timer_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/__pycache__/timer_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/Expv8_large/utils/download_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/download_util.py
--------------------------------------------------------------------------------
/models/Expv8_large/utils/face_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/face_util.py
--------------------------------------------------------------------------------
/models/Expv8_large/utils/flow_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/flow_util.py
--------------------------------------------------------------------------------
/models/Expv8_large/utils/lmdb_util.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/lmdb_util.py
--------------------------------------------------------------------------------
/models/Expv8_large/utils/options.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/Expv8_large/utils/options.py
--------------------------------------------------------------------------------
/models/Expv8_large/utils/timer_util.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import time
3 | import numpy as np
4 | import atexit
5 |
6 | cuda_timers = {}
7 | timers = {}
8 |
9 |
10 | class CudaTimer:
11 | def __init__(self, timer_name=''):
12 | self.timer_name = timer_name
13 | if self.timer_name not in cuda_timers:
14 | cuda_timers[self.timer_name] = []
15 |
16 | self.start = torch.cuda.Event(enable_timing=True)
17 | self.end = torch.cuda.Event(enable_timing=True)
18 |
19 | def __enter__(self):
20 | self.start.record()
21 | return self
22 |
23 | def __exit__(self, *args):
24 | self.end.record()
25 | torch.cuda.synchronize()
26 | cuda_timers[self.timer_name].append(self.start.elapsed_time(self.end))
27 |
28 |
29 | class Timer:
30 | def __init__(self, timer_name=''):
31 | self.timer_name = timer_name
32 | if self.timer_name not in timers:
33 | timers[self.timer_name] = []
34 |
35 | def __enter__(self):
36 | self.start = time.time()
37 | return self
38 |
39 | def __exit__(self, *args):
40 | self.end = time.time()
41 | self.interval = self.end - self.start # measured in seconds
42 | self.interval *= 1000.0 # convert to milliseconds
43 | timers[self.timer_name].append(self.interval)
44 |
45 |
46 | def print_timing_info():
47 | print('== Timing statistics ==')
48 | for timer_name, timing_values in [*cuda_timers.items(), *timers.items()]:
49 | timing_value = np.mean(np.array(timing_values))
50 | if timing_value < 1000.0:
51 | print('{}: {:.2f} ms'.format(timer_name, timing_value))
52 | else:
53 | print('{}: {:.2f} s'.format(timer_name, timing_value / 1000.0))
54 |
55 |
56 | # this will print all the timer values upon termination of any program that imported this file
57 | # atexit.register(print_timing_info)
58 |
--------------------------------------------------------------------------------
/models/QVI/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/QVI/__init__.py
--------------------------------------------------------------------------------
/models/QVI/configs/test_config.py:
--------------------------------------------------------------------------------
1 | testset_root = './datasets/example'
2 | test_size = (854, 480)
3 | test_crop_size = (854, 480)
4 |
5 | mean = [0.429, 0.431, 0.397]
6 | std = [1, 1, 1]
7 |
8 | inter_frames = 3
9 |
10 |
11 | model = 'QVI'
12 | pwc_path = './utils/pwc-checkpoint.pt'
13 |
14 |
15 | store_path = 'outputs/example/'
16 | checkpoint = 'qvi_release/model.pt'
17 |
18 |
19 |
--------------------------------------------------------------------------------
/models/QVI/configs/train_config.py:
--------------------------------------------------------------------------------
1 | exp_name = 'qvi'
2 | record_dir = 'records/{}'.format(exp_name)
3 | checkpoint_dir = 'checkpoints/{}'.format(exp_name)
4 | trainset = 'QVI960'
5 | trainset_root = './datasets/QVI-960'
6 | train_size = (640, 360)
7 | train_crop_size = (355, 355)
8 |
9 | validationset = 'Adobe240all'
10 | validationset_root = './datasets/Adobe240_validation'
11 | validation_size = (640, 360)
12 | validation_crop_size = (640, 360)
13 |
14 | train_batch_size = 25
15 |
16 | train_continue = False
17 | epochs = 250
18 | progress_iter = 200
19 | checkpoint_epoch = 5
20 |
21 |
22 | mean = [0.429, 0.431, 0.397]
23 | std = [1, 1, 1]
24 |
25 | model = 'QVI'
26 | pwc_path = './utils/pwc-checkpoint.pt'
27 |
28 | init_learning_rate = 1e-4
29 | milestones = [100, 150]
30 |
31 |
--------------------------------------------------------------------------------
/models/QVI/datas/__init__.py:
--------------------------------------------------------------------------------
1 | from .Adobe240all import Adobe240all
2 | from .QVI960 import QVI960
3 | from .AIMSequence import AIMSequence
4 |
5 |
6 | __all__ = ['Adobe240all', 'QVI960', 'AIMSequence',]
7 |
--------------------------------------------------------------------------------
/models/QVI/models/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | from .QVI import QVI
3 |
4 | __all__ = [ 'QVI']
5 |
--------------------------------------------------------------------------------
/models/QVI/models/acceleration.py:
--------------------------------------------------------------------------------
1 | # This file implements acceleration/velocity calculation
2 |
3 | import torch
4 | import torch.nn as nn
5 |
6 |
7 | class AcFusionLayer(nn.Module):
8 | """docstring for AcFusionLayer"""
9 | def __init__(self, ):
10 | super(AcFusionLayer, self).__init__()
11 |
12 | def forward(self, flo10, flo12, flo21, flo23, t=0.5):
13 | """
14 | -- input: four flows
15 | -- output: center shift
16 | """
17 |
18 | return 0.5 * ((t + t**2)*flo12 - (t - t**2)*flo10), 0.5 * (((1 - t) + (1 - t)**2)*flo21 - ((1 - t) - (1 - t)**2)*flo23)
19 |
20 |
--------------------------------------------------------------------------------
/models/REFID/.ipynb_checkpoints/test_flops-checkpoint.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import sys
3 | import os
4 | sys.path.append(os.getcwd())
5 | from thop import profile
6 | from models.REFID.REFID_twosharpInterp import REFID
7 | from params.GOPROv2eIMX636.params_trainGOPROVFI import trainGOPROVFI
8 | from easydict import EasyDict as ED
9 | import time
10 |
11 | args = ED()
12 | args.model_name = 'REFID'
13 | args.extension = ''
14 | args.clear_previous = None
15 | args.model_pretrained = None
16 | args.calc_flops = True
17 |
18 | params = trainGOPROVFI(args)
19 | records = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), f'{args.model_name}_flops_and_macs.txt'), 'a+')
20 | params.training_config.crop_size = 64
21 |
22 |
23 | params.training_config.interp_ratio = 16
24 |
25 | params.debug = False
26 | datashape_h, datashape_w = 720//32*32, 1280//32*32
27 |
28 | net = REFID(params).cuda()
29 | left_frame = torch.randn(1, 3, datashape_h, datashape_w).float().cuda()
30 | right_frame = torch.randn(1, 3, datashape_h, datashape_w).float().cuda()
31 | events = torch.randn(1, 15, 2, datashape_h, datashape_w).float().cuda()
32 |
33 | macs, model_params = 0, 0
34 |
35 | outprofile = profile(net, inputs=(left_frame, right_frame, events))
36 | macs += outprofile[0]
37 | model_params += outprofile[1]
38 | content = f'[MODEL NAME] {args.model_name} '\
39 | f'[INPUT INFO] {datashape_h}x{datashape_w}x{params.training_config.interp_ratio} '\
40 | f'[MACs] {macs/1e9:.3f} GMACs [AVERAGE MACs]: {macs/1e9/(params.training_config.interp_ratio-1):.3f} GMACs'\
41 | f'[PARAMs] {model_params/1e9:.3f} G'
42 | print('-'*20)
43 | print(content)
44 |
45 | with torch.no_grad():
46 | res = net(left_frame, right_frame, events)
47 | t = time.time()
48 | for i in range(10):
49 | res = net(left_frame, right_frame, events)
50 | print((time.time()-t)/10/15)
51 | records.write(content+'\n')
52 |
53 |
--------------------------------------------------------------------------------
/models/REFID/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/__init__.py
--------------------------------------------------------------------------------
/models/REFID/__pycache__/REFID_twosharpInterp.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/__pycache__/REFID_twosharpInterp.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__init__.py:
--------------------------------------------------------------------------------
1 | import importlib
2 | from os import path as osp
3 |
4 | from models.REFID.utils import scandir
5 |
6 | # automatically scan and import arch modules
7 | # scan all the files under the 'archs' folder and collect files ending with
8 | # '_arch.py'
9 | arch_folder = osp.dirname(osp.abspath(__file__))
10 | arch_filenames = [
11 | osp.splitext(osp.basename(v))[0] for v in scandir(arch_folder)
12 | if v.endswith('_arch.py')
13 | ]
14 | # import all the arch modules
15 | _arch_modules = [
16 | importlib.import_module(f'models.REFID.archs.{file_name}')
17 | for file_name in arch_filenames
18 | ]
19 |
20 |
21 | def dynamic_instantiation(modules, cls_type, opt):
22 | """Dynamically instantiate class.
23 |
24 | Args:
25 | modules (list[importlib modules]): List of modules from importlib
26 | files.
27 | cls_type (str): Class type.
28 | opt (dict): Class initialization kwargs.
29 |
30 | Returns:
31 | class: Instantiated class.
32 | """
33 |
34 | for module in modules:
35 | cls_ = getattr(module, cls_type, None)
36 | if cls_ is not None:
37 | break
38 | if cls_ is None:
39 | raise ValueError(f'{cls_type} is not found.')
40 | return cls_(**opt)
41 |
42 |
43 | def define_network(opt):
44 | network_type = opt.pop('type')
45 | net = dynamic_instantiation(_arch_modules, network_type, opt)
46 | return net
47 |
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_bidirection_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_bidirection_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_allbidirection_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_allbidirection_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_bidirection_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_bidirection_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_bidirection_attenfusion_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_bidirection_attenfusion_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_siamese_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_siamese_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_siamese_noatten_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_decoder_recurrent_siamese_noatten_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_final_attenfusion_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_final_attenfusion_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/XXNet_ps_decoder_recurrent_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/XXNet_ps_decoder_recurrent_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/arch_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/arch_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/dcn_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/dcn_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/fusion_modules.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/fusion_modules.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/recurrent_sub_modules.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/recurrent_sub_modules.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/archs/__pycache__/single_multiconnect_evhinet_arch.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/archs/__pycache__/single_multiconnect_evhinet_arch.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/test_flops.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import sys
3 | import os
4 | sys.path.append(os.getcwd())
5 | from thop import profile
6 | from models.REFID.REFID_twosharpInterp import REFID
7 | from params.GOPROv2eIMX636.params_trainGOPROVFI import trainGOPROVFI
8 | from easydict import EasyDict as ED
9 | import time
10 |
11 | args = ED()
12 | args.model_name = 'REFID'
13 | args.extension = ''
14 | args.clear_previous = None
15 | args.model_pretrained = None
16 | args.calc_flops = True
17 |
18 | params = trainGOPROVFI(args)
19 | records = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), f'{args.model_name}_flops_and_macs.txt'), 'a+')
20 | params.training_config.crop_size = 64
21 |
22 |
23 | params.training_config.interp_ratio = 16
24 |
25 | params.debug = False
26 | datashape_h, datashape_w = 720//32*32, 1280//32*32
27 |
28 | net = REFID(params).cuda()
29 | left_frame = torch.randn(1, 3, datashape_h, datashape_w).float().cuda()
30 | right_frame = torch.randn(1, 3, datashape_h, datashape_w).float().cuda()
31 | events = torch.randn(1, 15, 2, datashape_h, datashape_w).float().cuda()
32 |
33 | macs, model_params = 0, 0
34 |
35 | outprofile = profile(net, inputs=(left_frame, right_frame, events))
36 | macs += outprofile[0]
37 | model_params += outprofile[1]
38 | content = f'[MODEL NAME] {args.model_name} '\
39 | f'[INPUT INFO] {datashape_h}x{datashape_w}x{params.training_config.interp_ratio} '\
40 | f'[MACs] {macs/1e9:.3f} GMACs [AVERAGE MACs]: {macs/1e9/(params.training_config.interp_ratio-1):.3f} GMACs'\
41 | f'[PARAMs] {model_params/1e9:.3f} G'
42 | print('-'*20)
43 | print(content)
44 |
45 | with torch.no_grad():
46 | res = net(left_frame, right_frame, events)
47 | t = time.time()
48 | for i in range(10):
49 | res = net(left_frame, right_frame, events)
50 | print((time.time()-t)/10/15)
51 | records.write(content+'\n')
52 |
53 |
--------------------------------------------------------------------------------
/models/REFID/utils/__init__.py:
--------------------------------------------------------------------------------
1 | from .file_client import FileClient
2 | from .img_util import crop_border, imfrombytes, img2tensor, imwrite, tensor2img, padding, voxel2voxeltensor
3 | from .logger import (MessageLogger, get_env_info, get_root_logger,
4 | init_tb_logger, init_wandb_logger)
5 | from .misc import (check_resume, get_time_str, make_exp_dirs, mkdir_and_rename,
6 | scandir, scandir_SIDD, set_random_seed, sizeof_fmt)
7 | from .create_lmdb import (create_lmdb_for_reds, create_lmdb_for_gopro, create_lmdb_for_rain13k)
8 | from .timer_util import CudaTimer, Timer
9 |
10 | __all__ = [
11 | # file_client.py
12 | 'FileClient',
13 | # img_util.py
14 | 'img2tensor',
15 | 'voxel2voxeltensor',
16 | 'tensor2img',
17 | 'imfrombytes',
18 | 'imwrite',
19 | 'crop_border',
20 | # logger.py
21 | 'MessageLogger',
22 | 'init_tb_logger',
23 | 'init_wandb_logger',
24 | 'get_root_logger',
25 | 'get_env_info',
26 | # misc.py
27 | 'set_random_seed',
28 | 'get_time_str',
29 | 'mkdir_and_rename',
30 | 'make_exp_dirs',
31 | 'scandir',
32 | 'check_resume',
33 | 'sizeof_fmt',
34 | 'padding',
35 | 'create_lmdb_for_reds',
36 | 'create_lmdb_for_gopro',
37 | 'create_lmdb_for_rain13k',
38 | # timer_util.py
39 | 'CudaTimer',
40 | 'Timer',
41 | ]
42 |
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/create_lmdb.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/create_lmdb.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/dist_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/dist_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/file_client.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/file_client.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/img_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/img_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/lmdb_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/lmdb_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/logger.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/logger.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/misc.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/misc.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/__pycache__/timer_util.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/REFID/utils/__pycache__/timer_util.cpython-312.pyc
--------------------------------------------------------------------------------
/models/REFID/utils/timer_util.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import time
3 | import numpy as np
4 | import atexit
5 |
6 | cuda_timers = {}
7 | timers = {}
8 |
9 |
10 | class CudaTimer:
11 | def __init__(self, timer_name=''):
12 | self.timer_name = timer_name
13 | if self.timer_name not in cuda_timers:
14 | cuda_timers[self.timer_name] = []
15 |
16 | self.start = torch.cuda.Event(enable_timing=True)
17 | self.end = torch.cuda.Event(enable_timing=True)
18 |
19 | def __enter__(self):
20 | self.start.record()
21 | return self
22 |
23 | def __exit__(self, *args):
24 | self.end.record()
25 | torch.cuda.synchronize()
26 | cuda_timers[self.timer_name].append(self.start.elapsed_time(self.end))
27 |
28 |
29 | class Timer:
30 | def __init__(self, timer_name=''):
31 | self.timer_name = timer_name
32 | if self.timer_name not in timers:
33 | timers[self.timer_name] = []
34 |
35 | def __enter__(self):
36 | self.start = time.time()
37 | return self
38 |
39 | def __exit__(self, *args):
40 | self.end = time.time()
41 | self.interval = self.end - self.start # measured in seconds
42 | self.interval *= 1000.0 # convert to milliseconds
43 | timers[self.timer_name].append(self.interval)
44 |
45 |
46 | def print_timing_info():
47 | print('== Timing statistics ==')
48 | for timer_name, timing_values in [*cuda_timers.items(), *timers.items()]:
49 | timing_value = np.mean(np.array(timing_values))
50 | if timing_value < 1000.0:
51 | print('{}: {:.2f} ms'.format(timer_name, timing_value))
52 | else:
53 | print('{}: {:.2f} s'.format(timer_name, timing_value / 1000.0))
54 |
55 |
56 | # this will print all the timer values upon termination of any program that imported this file
57 | # atexit.register(print_timing_info)
58 |
--------------------------------------------------------------------------------
/models/RIFE/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | import sys
2 | sys.path.append('models/RIFE/')
--------------------------------------------------------------------------------
/models/RIFE/__init__.py:
--------------------------------------------------------------------------------
1 | import sys
2 | sys.path.append('models/RIFE/')
--------------------------------------------------------------------------------
/models/RIFE/benchmark/.ipynb_checkpoints/Vimeo90K-checkpoint.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | sys.path.append('.')
4 | import cv2
5 | import math
6 | import torch
7 | import argparse
8 | import numpy as np
9 | from torch.nn import functional as F
10 | from model.pytorch_msssim import ssim_matlab
11 | from model.RIFE import Model
12 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13 |
14 | model = Model()
15 | model.load_model('train_log')
16 | model.eval()
17 | model.device()
18 |
19 | path = 'vimeo_interp_test/'
20 | f = open(path + 'tri_testlist.txt', 'r')
21 | psnr_list = []
22 | ssim_list = []
23 | for i in f:
24 | name = str(i).strip()
25 | if(len(name) <= 1):
26 | continue
27 | print(path + 'target/' + name + '/im1.png')
28 | I0 = cv2.imread(path + 'target/' + name + '/im1.png')
29 | I1 = cv2.imread(path + 'target/' + name + '/im2.png')
30 | I2 = cv2.imread(path + 'target/' + name + '/im3.png')
31 | I0 = (torch.tensor(I0.transpose(2, 0, 1)).to(device) / 255.).unsqueeze(0)
32 | I2 = (torch.tensor(I2.transpose(2, 0, 1)).to(device) / 255.).unsqueeze(0)
33 | mid = model.inference(I0, I2)[0]
34 | ssim = ssim_matlab(torch.tensor(I1.transpose(2, 0, 1)).to(device).unsqueeze(0) / 255., torch.round(mid * 255).unsqueeze(0) / 255.).detach().cpu().numpy()
35 | mid = np.round((mid * 255).detach().cpu().numpy()).astype('uint8').transpose(1, 2, 0) / 255.
36 | I1 = I1 / 255.
37 | psnr = -10 * math.log10(((I1 - mid) * (I1 - mid)).mean())
38 | psnr_list.append(psnr)
39 | ssim_list.append(ssim)
40 | print("Avg PSNR: {} SSIM: {}".format(np.mean(psnr_list), np.mean(ssim_list)))
41 |
--------------------------------------------------------------------------------
/models/RIFE/benchmark/ATD12K.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | sys.path.append('.')
4 | import cv2
5 | import math
6 | import torch
7 | import argparse
8 | import numpy as np
9 | from torch.nn import functional as F
10 | from model.pytorch_msssim import ssim_matlab
11 | from model.RIFE import Model
12 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13 |
14 | model = Model()
15 | model.load_model('train_log')
16 | model.eval()
17 | model.device()
18 |
19 | path = 'datasets/test_2k_540p/'
20 | dirs = os.listdir(path)
21 | psnr_list = []
22 | ssim_list = []
23 | print(len(dirs))
24 | for d in dirs:
25 | img0 = (path + d + '/frame1.png')
26 | img1 = (path + d + '/frame3.png')
27 | gt = (path + d + '/frame2.png')
28 | img0 = (torch.tensor(cv2.imread(img0).transpose(2, 0, 1) / 255.)).to(device).float().unsqueeze(0)
29 | img1 = (torch.tensor(cv2.imread(img1).transpose(2, 0, 1) / 255.)).to(device).float().unsqueeze(0)
30 | gt = (torch.tensor(cv2.imread(gt).transpose(2, 0, 1) / 255.)).to(device).float().unsqueeze(0)
31 | pader = torch.nn.ReplicationPad2d([0, 0, 2, 2])
32 | img0 = pader(img0)
33 | img1 = pader(img1)
34 | pred = model.inference(img0, img1)[0][:, 2:-2]
35 | ssim = ssim_matlab(gt, torch.round(pred * 255).unsqueeze(0) / 255.).detach().cpu().numpy()
36 | out = pred.detach().cpu().numpy().transpose(1, 2, 0)
37 | out = np.round(out * 255) / 255.
38 | gt = gt[0].cpu().numpy().transpose(1, 2, 0)
39 | psnr = -10 * math.log10(((gt - out) * (gt - out)).mean())
40 | psnr_list.append(psnr)
41 | ssim_list.append(ssim)
42 | print("Avg PSNR: {} SSIM: {}".format(np.mean(psnr_list), np.mean(ssim_list)))
43 |
--------------------------------------------------------------------------------
/models/RIFE/benchmark/MiddleBury_Other.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | sys.path.append('.')
4 | import cv2
5 | import math
6 | import torch
7 | import argparse
8 | import numpy as np
9 | from torch.nn import functional as F
10 | from model.pytorch_msssim import ssim_matlab
11 | from model.RIFE import Model
12 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13 |
14 | model = Model()
15 | model.load_model('train_log')
16 | model.eval()
17 | model.device()
18 |
19 | name = ['Beanbags', 'Dimetrodon', 'DogDance', 'Grove2', 'Grove3', 'Hydrangea', 'MiniCooper', 'RubberWhale', 'Urban2', 'Urban3', 'Venus', 'Walking']
20 | IE_list = []
21 | for i in name:
22 | i0 = cv2.imread('other-data/{}/frame10.png'.format(i)).transpose(2, 0, 1) / 255.
23 | i1 = cv2.imread('other-data/{}/frame11.png'.format(i)).transpose(2, 0, 1) / 255.
24 | gt = cv2.imread('other-gt-interp/{}/frame10i11.png'.format(i))
25 | h, w = i0.shape[1], i0.shape[2]
26 | imgs = torch.zeros([1, 6, 480, 640]).to(device)
27 | ph = (480 - h) // 2
28 | pw = (640 - w) // 2
29 | imgs[:, :3, :h, :w] = torch.from_numpy(i0).unsqueeze(0).float().to(device)
30 | imgs[:, 3:, :h, :w] = torch.from_numpy(i1).unsqueeze(0).float().to(device)
31 | I0 = imgs[:, :3]
32 | I2 = imgs[:, 3:]
33 | pred = model.inference(I0, I2)
34 | out = pred[0].detach().cpu().numpy().transpose(1, 2, 0)
35 | out = np.round(out[:h, :w] * 255)
36 | IE_list.append(np.abs((out - gt * 1.0)).mean())
37 | print(np.mean(IE_list))
38 |
--------------------------------------------------------------------------------
/models/RIFE/benchmark/UCF101.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | sys.path.append('.')
4 | import cv2
5 | import math
6 | import torch
7 | import argparse
8 | import numpy as np
9 | from torch.nn import functional as F
10 | from model.pytorch_msssim import ssim_matlab
11 | from model.RIFE import Model
12 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13 |
14 | model = Model()
15 | model.load_model('train_log')
16 | model.eval()
17 | model.device()
18 |
19 | path = 'UCF101/ucf101_interp_ours/'
20 | dirs = os.listdir(path)
21 | psnr_list = []
22 | ssim_list = []
23 | print(len(dirs))
24 | for d in dirs:
25 | img0 = (path + d + '/frame_00.png')
26 | img1 = (path + d + '/frame_02.png')
27 | gt = (path + d + '/frame_01_gt.png')
28 | img0 = (torch.tensor(cv2.imread(img0).transpose(2, 0, 1) / 255.)).to(device).float().unsqueeze(0)
29 | img1 = (torch.tensor(cv2.imread(img1).transpose(2, 0, 1) / 255.)).to(device).float().unsqueeze(0)
30 | gt = (torch.tensor(cv2.imread(gt).transpose(2, 0, 1) / 255.)).to(device).float().unsqueeze(0)
31 | pred = model.inference(img0, img1)[0]
32 | ssim = ssim_matlab(gt, torch.round(pred * 255).unsqueeze(0) / 255.).detach().cpu().numpy()
33 | out = pred.detach().cpu().numpy().transpose(1, 2, 0)
34 | out = np.round(out * 255) / 255.
35 | gt = gt[0].cpu().numpy().transpose(1, 2, 0)
36 | psnr = -10 * math.log10(((gt - out) * (gt - out)).mean())
37 | psnr_list.append(psnr)
38 | ssim_list.append(ssim)
39 | print("Avg PSNR: {} SSIM: {}".format(np.mean(psnr_list), np.mean(ssim_list)))
40 |
--------------------------------------------------------------------------------
/models/RIFE/benchmark/Vimeo90K.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | sys.path.append('.')
4 | import cv2
5 | import math
6 | import torch
7 | import argparse
8 | import numpy as np
9 | from torch.nn import functional as F
10 | from model.pytorch_msssim import ssim_matlab
11 | from model.RIFE import Model
12 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13 |
14 | model = Model()
15 | model.load_model('train_log')
16 | model.eval()
17 | model.device()
18 |
19 | path = 'vimeo_interp_test/'
20 | f = open(path + 'tri_testlist.txt', 'r')
21 | psnr_list = []
22 | ssim_list = []
23 | for i in f:
24 | name = str(i).strip()
25 | if(len(name) <= 1):
26 | continue
27 | print(path + 'target/' + name + '/im1.png')
28 | I0 = cv2.imread(path + 'target/' + name + '/im1.png')
29 | I1 = cv2.imread(path + 'target/' + name + '/im2.png')
30 | I2 = cv2.imread(path + 'target/' + name + '/im3.png')
31 | I0 = (torch.tensor(I0.transpose(2, 0, 1)).to(device) / 255.).unsqueeze(0)
32 | I2 = (torch.tensor(I2.transpose(2, 0, 1)).to(device) / 255.).unsqueeze(0)
33 | mid = model.inference(I0, I2)[0]
34 | ssim = ssim_matlab(torch.tensor(I1.transpose(2, 0, 1)).to(device).unsqueeze(0) / 255., torch.round(mid * 255).unsqueeze(0) / 255.).detach().cpu().numpy()
35 | mid = np.round((mid * 255).detach().cpu().numpy()).astype('uint8').transpose(1, 2, 0) / 255.
36 | I1 = I1 / 255.
37 | psnr = -10 * math.log10(((I1 - mid) * (I1 - mid)).mean())
38 | psnr_list.append(psnr)
39 | ssim_list.append(ssim)
40 | print("Avg PSNR: {} SSIM: {}".format(np.mean(psnr_list), np.mean(ssim_list)))
41 |
--------------------------------------------------------------------------------
/models/RIFE/benchmark/testtime.py:
--------------------------------------------------------------------------------
1 | import cv2
2 | import sys
3 | sys.path.append('.')
4 | import time
5 | import torch
6 | import torch.nn as nn
7 | from model.RIFE import Model
8 |
9 | model = Model()
10 | model.eval()
11 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
12 | torch.set_grad_enabled(False)
13 | if torch.cuda.is_available():
14 | torch.backends.cudnn.enabled = True
15 | torch.backends.cudnn.benchmark = True
16 |
17 | I0 = torch.rand(1, 3, 480, 640).to(device)
18 | I1 = torch.rand(1, 3, 480, 640).to(device)
19 | with torch.no_grad():
20 | for i in range(100):
21 | pred = model.inference(I0, I1)
22 | if torch.cuda.is_available():
23 | torch.cuda.synchronize()
24 | time_stamp = time.time()
25 | for i in range(100):
26 | pred = model.inference(I0, I1)
27 | if torch.cuda.is_available():
28 | torch.cuda.synchronize()
29 | print((time.time() - time_stamp) / 100)
30 |
--------------------------------------------------------------------------------
/models/RIFE/demo/I0_slomo_clipped.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/RIFE/demo/I0_slomo_clipped.gif
--------------------------------------------------------------------------------
/models/RIFE/demo/I1_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/RIFE/demo/I1_0.png
--------------------------------------------------------------------------------
/models/RIFE/demo/I1_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/RIFE/demo/I1_1.png
--------------------------------------------------------------------------------
/models/RIFE/demo/I2_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/RIFE/demo/I2_0.png
--------------------------------------------------------------------------------
/models/RIFE/demo/I2_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/RIFE/demo/I2_1.png
--------------------------------------------------------------------------------
/models/RIFE/demo/I2_slomo_clipped.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/RIFE/demo/I2_slomo_clipped.gif
--------------------------------------------------------------------------------
/models/RIFE/demo/intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/RIFE/demo/intro.png
--------------------------------------------------------------------------------
/models/RIFE/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM python:3.8-slim
2 |
3 | # install deps
4 | RUN apt-get update && apt-get -y install \
5 | bash ffmpeg
6 |
7 | # setup RIFE
8 | WORKDIR /rife
9 | COPY . .
10 | RUN pip3 install -r requirements.txt
11 |
12 | ADD docker/inference_img /usr/local/bin/inference_img
13 | RUN chmod +x /usr/local/bin/inference_img
14 | ADD docker/inference_video /usr/local/bin/inference_video
15 | RUN chmod +x /usr/local/bin/inference_video
16 |
17 | # add pre-trained models
18 | COPY train_log /rife/train_log
19 |
20 | WORKDIR /host
21 | ENTRYPOINT ["/bin/bash"]
22 |
23 | ENV NVIDIA_DRIVER_CAPABILITIES all
--------------------------------------------------------------------------------
/models/RIFE/docker/inference_img:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | python3 /rife/inference_img.py $@
3 |
--------------------------------------------------------------------------------
/models/RIFE/docker/inference_video:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | python3 /rife/inference_video.py $@
3 |
--------------------------------------------------------------------------------
/models/RIFE/model/warplayer.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 |
4 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
5 | backwarp_tenGrid = {}
6 |
7 |
8 | def warp(tenInput, tenFlow):
9 | k = (str(tenFlow.device), str(tenFlow.size()))
10 | if k not in backwarp_tenGrid:
11 | tenHorizontal = torch.linspace(-1.0, 1.0, tenFlow.shape[3], device=device).view(
12 | 1, 1, 1, tenFlow.shape[3]).expand(tenFlow.shape[0], -1, tenFlow.shape[2], -1)
13 | tenVertical = torch.linspace(-1.0, 1.0, tenFlow.shape[2], device=device).view(
14 | 1, 1, tenFlow.shape[2], 1).expand(tenFlow.shape[0], -1, -1, tenFlow.shape[3])
15 | backwarp_tenGrid[k] = torch.cat(
16 | [tenHorizontal, tenVertical], 1).to(device)
17 |
18 | tenFlow = torch.cat([tenFlow[:, 0:1, :, :] / ((tenInput.shape[3] - 1.0) / 2.0),
19 | tenFlow[:, 1:2, :, :] / ((tenInput.shape[2] - 1.0) / 2.0)], 1)
20 |
21 | g = (backwarp_tenGrid[k] + tenFlow).permute(0, 2, 3, 1)
22 | return torch.nn.functional.grid_sample(input=tenInput, grid=g, mode='bilinear', padding_mode='border', align_corners=True)
23 |
--------------------------------------------------------------------------------
/models/RIFE/run_vimeo.py:
--------------------------------------------------------------------------------
1 | import os
2 | from natsort import natsorted as sorted
3 |
4 |
5 | path = '/mnt/workspace/mayongrui/dataset/vimeo_septuplet/sequences/'
6 | target_path = '/mnt/workspace/mayongrui/dataset/vimeo_septuplet/interpx8sequences/'
7 | os.makedirs(target_path, exist_ok=True)
8 | folders = os.listdir(path)
9 | fl = len(folders)
10 | for folder in folders[fl*3//4:]:
11 | subpath = os.path.join(path, folder)
12 | subtargetpath = os.path.join(target_path, folder)
13 | os.makedirs(subtargetpath, exist_ok=True)
14 | print(f"Processing: {folder}")
15 | cmd = f"CUDA_VISIBLE_DEVICES=0 python inference_folderims.py --folder {subpath} --exp 3 --output {subtargetpath}"
16 | print(cmd)
17 | os.system(cmd)
18 |
--------------------------------------------------------------------------------
/models/SuperSlomo/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nvidia/cuda:10.2-cudnn7-devel
2 | RUN apt update
3 | RUN apt install python3 python3-pip ffmpeg -y
4 | RUN pip3 install torch torchvision
5 | RUN pip3 install numpy tqdm opencv-python
6 | RUN ln -s /usr/bin/python3 /usr/bin/python
7 | RUN ln -s /usr/bin/pip3 /usr/bin/pip
8 |
--------------------------------------------------------------------------------
/models/SuperSlomo/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Avinash Paliwal
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/models/SuperSlomo/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/SuperSlomo/__init__.py
--------------------------------------------------------------------------------
/models/SuperSlomo/__pycache__/SuperSlomo.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/SuperSlomo/__pycache__/SuperSlomo.cpython-312.pyc
--------------------------------------------------------------------------------
/models/SuperSlomo/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/SuperSlomo/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/SuperSlomo/__pycache__/model.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/SuperSlomo/__pycache__/model.cpython-312.pyc
--------------------------------------------------------------------------------
/models/SuperSlomo/__pycache__/runSuperSlomo.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/SuperSlomo/__pycache__/runSuperSlomo.cpython-312.pyc
--------------------------------------------------------------------------------
/models/SuperSlomo/misc/original.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/SuperSlomo/misc/original.gif
--------------------------------------------------------------------------------
/models/SuperSlomo/misc/slomo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/SuperSlomo/misc/slomo.gif
--------------------------------------------------------------------------------
/models/__init__.py:
--------------------------------------------------------------------------------
1 | # from .E_TRFNetv0 import E_TRFNetv0
2 | from .EVDI import EVDI
3 | from .REFID.REFID_twosharpInterp import REFID
4 |
5 | # RGB method
6 | from .SuperSlomo.runSuperSlomo import SuperSlomo
7 | from models.Expv8_large.runExpv8_large import Expv8_large
8 |
9 | # For peer comparisons
10 | from models.timelens.runtimelens import TimeLens
11 | from models.timelens_flow.runtimelens import TimeLens_flow
12 | from models.Expv8_Lights3.runExpv8_Lights3 import Expv8_Lights3
13 |
14 | from models.CBMNet.runmycbmnet import myCBMNet
15 | from models.RGBGT.runRGBGT import RGBGT
--------------------------------------------------------------------------------
/models/__pycache__/BaseModel.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/__pycache__/BaseModel.cpython-312.pyc
--------------------------------------------------------------------------------
/models/__pycache__/Forward_warp.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/__pycache__/Forward_warp.cpython-312.pyc
--------------------------------------------------------------------------------
/models/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/raft/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | sys.path.insert(0, os.path.join(os.getcwd(), "models/raft/RAFT-master/core"))
4 | print(sys.path)
5 | import torch
6 | from torch import nn
7 | from raft import RAFT
8 | from easydict import EasyDict as ED
9 |
10 |
11 | class raft(nn.Module):
12 | def __init__(self):
13 | super().__init__()
14 | args = ED()
15 | args.model = './models/raft/raft-things.pth'
16 | args.mixed_precision = False
17 | args.alternate_corr = False
18 | args.small = False
19 | self.iters = 10
20 | model = RAFT(args)
21 | weights = torch.load(args.model)
22 | keys = weights.keys()
23 | for k in list(keys):
24 | new_key = f"model.{k.split('module.')[1]}"
25 | weights[new_key] = weights[k]
26 | weights.pop(k)
27 | self.model = model
28 | self.load_state_dict(weights)
29 |
30 |
31 | def forward(self, im0, im1):
32 | flow = self.model(im0, im1, iters=self.iters, test_mode=True)
33 | return flow
34 |
35 | sys.path.pop(0)
36 |
--------------------------------------------------------------------------------
/models/raft/RAFT-master/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *.egg-info
3 | dist
4 | datasets
5 | pytorch_env
6 | models
7 | build
8 | correlation.egg-info
9 |
--------------------------------------------------------------------------------
/models/raft/RAFT-master/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/.ipynb_checkpoints/__init__-checkpoint.py
--------------------------------------------------------------------------------
/models/raft/RAFT-master/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2020, princeton-vl
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | * Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
--------------------------------------------------------------------------------
/models/raft/RAFT-master/RAFT.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/RAFT.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/__init__.py
--------------------------------------------------------------------------------
/models/raft/RAFT-master/alt_cuda_corr/correlation.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | // CUDA forward declarations
5 | std::vector corr_cuda_forward(
6 | torch::Tensor fmap1,
7 | torch::Tensor fmap2,
8 | torch::Tensor coords,
9 | int radius);
10 |
11 | std::vector corr_cuda_backward(
12 | torch::Tensor fmap1,
13 | torch::Tensor fmap2,
14 | torch::Tensor coords,
15 | torch::Tensor corr_grad,
16 | int radius);
17 |
18 | // C++ interface
19 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
20 | #define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x " must be contiguous")
21 | #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
22 |
23 | std::vector corr_forward(
24 | torch::Tensor fmap1,
25 | torch::Tensor fmap2,
26 | torch::Tensor coords,
27 | int radius) {
28 | CHECK_INPUT(fmap1);
29 | CHECK_INPUT(fmap2);
30 | CHECK_INPUT(coords);
31 |
32 | return corr_cuda_forward(fmap1, fmap2, coords, radius);
33 | }
34 |
35 |
36 | std::vector corr_backward(
37 | torch::Tensor fmap1,
38 | torch::Tensor fmap2,
39 | torch::Tensor coords,
40 | torch::Tensor corr_grad,
41 | int radius) {
42 | CHECK_INPUT(fmap1);
43 | CHECK_INPUT(fmap2);
44 | CHECK_INPUT(coords);
45 | CHECK_INPUT(corr_grad);
46 |
47 | return corr_cuda_backward(fmap1, fmap2, coords, corr_grad, radius);
48 | }
49 |
50 |
51 | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
52 | m.def("forward", &corr_forward, "CORR forward");
53 | m.def("backward", &corr_backward, "CORR backward");
54 | }
--------------------------------------------------------------------------------
/models/raft/RAFT-master/alt_cuda_corr/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup
2 | from torch.utils.cpp_extension import BuildExtension, CUDAExtension
3 |
4 |
5 | setup(
6 | name='correlation',
7 | ext_modules=[
8 | CUDAExtension('alt_cuda_corr',
9 | sources=['correlation.cpp', 'correlation_kernel.cu'],
10 | extra_compile_args={'cxx': [], 'nvcc': ['-O3']}),
11 | ],
12 | cmdclass={
13 | 'build_ext': BuildExtension
14 | })
15 |
16 |
--------------------------------------------------------------------------------
/models/raft/RAFT-master/core/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/core/.ipynb_checkpoints/__init__-checkpoint.py
--------------------------------------------------------------------------------
/models/raft/RAFT-master/core/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/core/__init__.py
--------------------------------------------------------------------------------
/models/raft/RAFT-master/core/utils/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/core/utils/.ipynb_checkpoints/__init__-checkpoint.py
--------------------------------------------------------------------------------
/models/raft/RAFT-master/core/utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/core/utils/__init__.py
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0016.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0016.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0017.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0017.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0018.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0018.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0019.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0019.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0020.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0020.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0021.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0021.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0022.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0022.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0023.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0023.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0024.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/demo-frames/frame_0025.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/RAFT-master/demo-frames/frame_0025.png
--------------------------------------------------------------------------------
/models/raft/RAFT-master/download_models.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | wget https://dl.dropboxusercontent.com/s/4j4z58wuv8o0mfz/models.zip
3 | unzip models.zip
4 |
--------------------------------------------------------------------------------
/models/raft/RAFT-master/train_mixed.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | mkdir -p checkpoints
3 | python -u train.py --name raft-chairs --stage chairs --validation chairs --gpus 0 --num_steps 120000 --batch_size 8 --lr 0.00025 --image_size 368 496 --wdecay 0.0001 --mixed_precision
4 | python -u train.py --name raft-things --stage things --validation sintel --restore_ckpt checkpoints/raft-chairs.pth --gpus 0 --num_steps 120000 --batch_size 5 --lr 0.0001 --image_size 400 720 --wdecay 0.0001 --mixed_precision
5 | python -u train.py --name raft-sintel --stage sintel --validation sintel --restore_ckpt checkpoints/raft-things.pth --gpus 0 --num_steps 120000 --batch_size 5 --lr 0.0001 --image_size 368 768 --wdecay 0.00001 --gamma=0.85 --mixed_precision
6 | python -u train.py --name raft-kitti --stage kitti --validation kitti --restore_ckpt checkpoints/raft-sintel.pth --gpus 0 --num_steps 50000 --batch_size 5 --lr 0.0001 --image_size 288 960 --wdecay 0.00001 --gamma=0.85 --mixed_precision
7 |
--------------------------------------------------------------------------------
/models/raft/RAFT-master/train_standard.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | mkdir -p checkpoints
3 | python -u train.py --name raft-chairs --stage chairs --validation chairs --gpus 0 1 --num_steps 100000 --batch_size 10 --lr 0.0004 --image_size 368 496 --wdecay 0.0001
4 | python -u train.py --name raft-things --stage things --validation sintel --restore_ckpt checkpoints/raft-chairs.pth --gpus 0 1 --num_steps 100000 --batch_size 6 --lr 0.000125 --image_size 400 720 --wdecay 0.0001
5 | python -u train.py --name raft-sintel --stage sintel --validation sintel --restore_ckpt checkpoints/raft-things.pth --gpus 0 1 --num_steps 100000 --batch_size 6 --lr 0.000125 --image_size 368 768 --wdecay 0.00001 --gamma=0.85
6 | python -u train.py --name raft-kitti --stage kitti --validation kitti --restore_ckpt checkpoints/raft-sintel.pth --gpus 0 1 --num_steps 50000 --batch_size 6 --lr 0.0001 --image_size 288 960 --wdecay 0.00001 --gamma=0.85
7 |
--------------------------------------------------------------------------------
/models/raft/__init__.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | sys.path.insert(0, os.path.join(os.getcwd(), "models/raft/RAFT-master/core"))
4 | print(sys.path)
5 | import torch
6 | from torch import nn
7 | from raft import RAFT
8 | from easydict import EasyDict as ED
9 |
10 |
11 | class raft(nn.Module):
12 | def __init__(self):
13 | super().__init__()
14 | args = ED()
15 | args.model = './models/raft/raft-things.pth'
16 | args.mixed_precision = False
17 | args.alternate_corr = False
18 | args.small = False
19 | self.iters = 10
20 | model = RAFT(args)
21 | weights = torch.load(args.model)
22 | keys = weights.keys()
23 | for k in list(keys):
24 | new_key = f"model.{k.split('module.')[1]}"
25 | weights[new_key] = weights[k]
26 | weights.pop(k)
27 | self.model = model
28 | self.load_state_dict(weights)
29 |
30 |
31 | def forward(self, im0, im1):
32 | flow = self.model(im0, im1, iters=self.iters, test_mode=True)
33 | return flow
34 |
35 | sys.path.pop(0)
36 |
--------------------------------------------------------------------------------
/models/raft/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/raft/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/timelens/.gitignore:
--------------------------------------------------------------------------------
1 | timelens/__pycache__/
2 | timelens/common/__pycache__/
3 |
--------------------------------------------------------------------------------
/models/timelens/.ipynb_checkpoints/test_loader-checkpoint.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | from os.path import join
3 | import numpy as np
4 | import cv2
5 | import matplotlib.pyplot as plt
6 |
7 |
8 | def render(events, image):
9 | H, W, _ = image.shape
10 | x = events['x'].astype("int")
11 | y = events['y'].astype("int")
12 | p = events['p']
13 |
14 | mask = (x <= W-1) & (y <= H-1) & (x >= 0) & (y >= 0)
15 | x_ = x[mask]
16 | y_ = y[mask]
17 | p_ = p[mask]
18 |
19 | image[y_,x_,:] = 0
20 | image[y_,x_,p_] = 255
21 |
22 | return image
23 |
24 | if __name__ == "__main__":
25 | parser = argparse.ArgumentParser("Example Loader for a sample")
26 | parser.add_argument("--dataset_root", default="")
27 | parser.add_argument("--dataset_type", default="close")
28 | parser.add_argument("--sequence", default="fountain_schaffhauserplatz_02")
29 | parser.add_argument("--sample_index", type=int, default=200)
30 |
31 | args = parser.parse_args()
32 | event_file = join(args.dataset_root, "%s/test/%s/events_aligned/%06d.npz" % (args.dataset_type, args.sequence, args.sample_index))
33 | image_file = join(args.dataset_root, "%s/test/%s/images_corrected/%06d.png" % (args.dataset_type, args.sequence, args.sample_index))
34 |
35 | image = cv2.imread(image_file)[...,::-1]
36 | events = np.load(event_file)
37 |
38 | rendered_image = render(events, image)
39 |
40 | plt.imshow(rendered_image)
41 | plt.show()
42 |
43 |
44 |
--------------------------------------------------------------------------------
/models/timelens/__pycache__/runtimelens.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/timelens/__pycache__/runtimelens.cpython-312.pyc
--------------------------------------------------------------------------------
/models/timelens/test_loader.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | from os.path import join
3 | import numpy as np
4 | import cv2
5 | import matplotlib.pyplot as plt
6 |
7 |
8 | def render(events, image):
9 | H, W, _ = image.shape
10 | x = events['x'].astype("int")
11 | y = events['y'].astype("int")
12 | p = events['p']
13 |
14 | mask = (x <= W-1) & (y <= H-1) & (x >= 0) & (y >= 0)
15 | x_ = x[mask]
16 | y_ = y[mask]
17 | p_ = p[mask]
18 |
19 | image[y_,x_,:] = 0
20 | image[y_,x_,p_] = 255
21 |
22 | return image
23 |
24 | if __name__ == "__main__":
25 | parser = argparse.ArgumentParser("Example Loader for a sample")
26 | parser.add_argument("--dataset_root", default="")
27 | parser.add_argument("--dataset_type", default="close")
28 | parser.add_argument("--sequence", default="fountain_schaffhauserplatz_02")
29 | parser.add_argument("--sample_index", type=int, default=200)
30 |
31 | args = parser.parse_args()
32 | event_file = join(args.dataset_root, "%s/test/%s/events_aligned/%06d.npz" % (args.dataset_type, args.sequence, args.sample_index))
33 | image_file = join(args.dataset_root, "%s/test/%s/images_corrected/%06d.png" % (args.dataset_type, args.sequence, args.sample_index))
34 |
35 | image = cv2.imread(image_file)[...,::-1]
36 | events = np.load(event_file)
37 |
38 | rendered_image = render(events, image)
39 |
40 | plt.imshow(rendered_image)
41 | plt.show()
42 |
43 |
44 |
--------------------------------------------------------------------------------
/models/timelens/timelens/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/timelens/timelens/__init__.py
--------------------------------------------------------------------------------
/models/timelens/timelens/common/__init__.py:
--------------------------------------------------------------------------------
1 | from . import warp
--------------------------------------------------------------------------------
/models/timelens/timelens/common/iterator_modifiers.py:
--------------------------------------------------------------------------------
1 | def make_skip_iterator(iterator, number_of_skips):
2 | """Returns iterator that skips elements form the original iterator.
3 |
4 | E.g. if original iterator return 1, 2, 3, 4, the modified iterator
5 | with "number_of_skips"=2 will return 1, 3.
6 | """
7 | for item in iterator:
8 | yield item
9 | for _ in range(number_of_skips):
10 | next(iterator, None)
11 |
12 | def make_iterator_over_groups(iterator, group_size):
13 | """Returns iterator, that returns groups of values from the original iterator.
14 |
15 | For example, if original iterator returns 1, 2, 3, 4, 5, "group_size"=3 and
16 | output iterator returns (1,2,3), (2,3,4).
17 | """
18 | group = []
19 | for item in iterator:
20 | group.append(item)
21 | if len(group) == group_size:
22 | yield tuple(group)
23 | group = group[1:]
24 |
25 | def make_iterator_with_repeats(iterator, number_of_repeats):
26 | """Returns iterator where each item is repeated."""
27 | for item in iterator:
28 | for _ in range(number_of_repeats):
29 | yield item
30 |
31 | def make_skip_and_repeat_iterator(iterator, number_of_skips, number_of_insertions):
32 | return make_iterator_with_repeats(make_skip_iterator(iterator, number_of_skips),
33 | number_of_insertions)
--------------------------------------------------------------------------------
/models/timelens/timelens/common/size_adapter.py:
--------------------------------------------------------------------------------
1 | import math
2 |
3 | from torch import nn
4 |
5 |
6 | def closest_larger_multiple_of_minimum_size(size, minimum_size):
7 | return int(math.ceil(size / minimum_size) * minimum_size)
8 |
9 | class SizeAdapter(object):
10 | """Converts size of input to standard size.
11 | Practical deep network works only with input images
12 | which height and width are multiples of a minimum size.
13 | This class allows to pass to the network images of arbitrary
14 | size, by padding the input to the closest multiple
15 | and unpadding the network's output to the original size.
16 | """
17 |
18 | def __init__(self, minimum_size=64):
19 | self._minimum_size = minimum_size
20 | self._pixels_pad_to_width = None
21 | self._pixels_pad_to_height = None
22 |
23 | def _closest_larger_multiple_of_minimum_size(self, size):
24 | return closest_larger_multiple_of_minimum_size(size, self._minimum_size)
25 |
26 | def pad(self, network_input):
27 | """Returns "network_input" paded with zeros to the "standard" size.
28 | The "standard" size correspond to the height and width that
29 | are closest multiples of "minimum_size". The method pads
30 | height and width and and saves padded values. These
31 | values are then used by "unpad_output" method.
32 | """
33 | height, width = network_input.size()[-2:]
34 | self._pixels_pad_to_height = (self._closest_larger_multiple_of_minimum_size(height) - height)
35 | self._pixels_pad_to_width = (self._closest_larger_multiple_of_minimum_size(width) - width)
36 | return nn.ZeroPad2d((self._pixels_pad_to_width, 0, self._pixels_pad_to_height, 0))(network_input)
37 |
38 | def unpad(self, network_output):
39 | """Returns "network_output" cropped to the original size.
40 | The cropping is performed using values save by the "pad_input"
41 | method.
42 | """
43 | return network_output[..., self._pixels_pad_to_height:, self._pixels_pad_to_width:]
44 |
--------------------------------------------------------------------------------
/models/timelens/timelens/fusion_network.py:
--------------------------------------------------------------------------------
1 | import torch as th
2 | from timelens.superslomo import unet
3 | from torch import nn
4 |
5 | def _pack(example):
6 | return th.cat([example['before']['voxel_grid'],
7 | example['before']['rgb_image_tensor'],
8 | example['after']['voxel_grid'],
9 | example['after']['rgb_image_tensor']], dim=1)
10 |
11 |
12 | class Fusion(nn.Module):
13 | def __init__(self):
14 | super(Fusion, self).__init__()
15 | self.fusion_network = unet.UNet(2 * 3 + 2 * 5, 3, False)
16 |
17 | def run_fusion(self, example):
18 | return self.fusion_network(_pack(example))
19 |
20 | def from_legacy_checkpoint(self, checkpoint_filename):
21 | checkpoint = th.load(checkpoint_filename)
22 | self.load_state_dict(checkpoint["networks"])
23 |
24 | def run_and_pack_to_example(self, example):
25 | example['middle']['fusion'] = self.run_fusion(example)
26 |
27 | def forward(self, example):
28 | return self.run_fusion(example)
29 |
--------------------------------------------------------------------------------
/models/timelens/timelens/superslomo/__pycache__/unet.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/timelens/timelens/superslomo/__pycache__/unet.cpython-312.pyc
--------------------------------------------------------------------------------
/models/timelens_flow/.gitignore:
--------------------------------------------------------------------------------
1 | timelens/__pycache__/
2 | timelens/common/__pycache__/
3 |
--------------------------------------------------------------------------------
/models/timelens_flow/.ipynb_checkpoints/test_loader-checkpoint.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | from os.path import join
3 | import numpy as np
4 | import cv2
5 | import matplotlib.pyplot as plt
6 |
7 |
8 | def render(events, image):
9 | H, W, _ = image.shape
10 | x = events['x'].astype("int")
11 | y = events['y'].astype("int")
12 | p = events['p']
13 |
14 | mask = (x <= W-1) & (y <= H-1) & (x >= 0) & (y >= 0)
15 | x_ = x[mask]
16 | y_ = y[mask]
17 | p_ = p[mask]
18 |
19 | image[y_,x_,:] = 0
20 | image[y_,x_,p_] = 255
21 |
22 | return image
23 |
24 | if __name__ == "__main__":
25 | parser = argparse.ArgumentParser("Example Loader for a sample")
26 | parser.add_argument("--dataset_root", default="")
27 | parser.add_argument("--dataset_type", default="close")
28 | parser.add_argument("--sequence", default="fountain_schaffhauserplatz_02")
29 | parser.add_argument("--sample_index", type=int, default=200)
30 |
31 | args = parser.parse_args()
32 | event_file = join(args.dataset_root, "%s/test/%s/events_aligned/%06d.npz" % (args.dataset_type, args.sequence, args.sample_index))
33 | image_file = join(args.dataset_root, "%s/test/%s/images_corrected/%06d.png" % (args.dataset_type, args.sequence, args.sample_index))
34 |
35 | image = cv2.imread(image_file)[...,::-1]
36 | events = np.load(event_file)
37 |
38 | rendered_image = render(events, image)
39 |
40 | plt.imshow(rendered_image)
41 | plt.show()
42 |
43 |
44 |
--------------------------------------------------------------------------------
/models/timelens_flow/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/timelens_flow/__init__.py
--------------------------------------------------------------------------------
/models/timelens_flow/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/timelens_flow/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/models/timelens_flow/__pycache__/runtimelens.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/timelens_flow/__pycache__/runtimelens.cpython-312.pyc
--------------------------------------------------------------------------------
/models/timelens_flow/test_loader.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | from os.path import join
3 | import numpy as np
4 | import cv2
5 | import matplotlib.pyplot as plt
6 |
7 |
8 | def render(events, image):
9 | H, W, _ = image.shape
10 | x = events['x'].astype("int")
11 | y = events['y'].astype("int")
12 | p = events['p']
13 |
14 | mask = (x <= W-1) & (y <= H-1) & (x >= 0) & (y >= 0)
15 | x_ = x[mask]
16 | y_ = y[mask]
17 | p_ = p[mask]
18 |
19 | image[y_,x_,:] = 0
20 | image[y_,x_,p_] = 255
21 |
22 | return image
23 |
24 | if __name__ == "__main__":
25 | parser = argparse.ArgumentParser("Example Loader for a sample")
26 | parser.add_argument("--dataset_root", default="")
27 | parser.add_argument("--dataset_type", default="close")
28 | parser.add_argument("--sequence", default="fountain_schaffhauserplatz_02")
29 | parser.add_argument("--sample_index", type=int, default=200)
30 |
31 | args = parser.parse_args()
32 | event_file = join(args.dataset_root, "%s/test/%s/events_aligned/%06d.npz" % (args.dataset_type, args.sequence, args.sample_index))
33 | image_file = join(args.dataset_root, "%s/test/%s/images_corrected/%06d.png" % (args.dataset_type, args.sequence, args.sample_index))
34 |
35 | image = cv2.imread(image_file)[...,::-1]
36 | events = np.load(event_file)
37 |
38 | rendered_image = render(events, image)
39 |
40 | plt.imshow(rendered_image)
41 | plt.show()
42 |
43 |
44 |
--------------------------------------------------------------------------------
/models/timelens_flow/timelens/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/models/timelens_flow/timelens/__init__.py
--------------------------------------------------------------------------------
/models/timelens_flow/timelens/common/__init__.py:
--------------------------------------------------------------------------------
1 | from . import warp
--------------------------------------------------------------------------------
/models/timelens_flow/timelens/common/iterator_modifiers.py:
--------------------------------------------------------------------------------
1 | def make_skip_iterator(iterator, number_of_skips):
2 | """Returns iterator that skips elements form the original iterator.
3 |
4 | E.g. if original iterator return 1, 2, 3, 4, the modified iterator
5 | with "number_of_skips"=2 will return 1, 3.
6 | """
7 | for item in iterator:
8 | yield item
9 | for _ in range(number_of_skips):
10 | next(iterator, None)
11 |
12 | def make_iterator_over_groups(iterator, group_size):
13 | """Returns iterator, that returns groups of values from the original iterator.
14 |
15 | For example, if original iterator returns 1, 2, 3, 4, 5, "group_size"=3 and
16 | output iterator returns (1,2,3), (2,3,4).
17 | """
18 | group = []
19 | for item in iterator:
20 | group.append(item)
21 | if len(group) == group_size:
22 | yield tuple(group)
23 | group = group[1:]
24 |
25 | def make_iterator_with_repeats(iterator, number_of_repeats):
26 | """Returns iterator where each item is repeated."""
27 | for item in iterator:
28 | for _ in range(number_of_repeats):
29 | yield item
30 |
31 | def make_skip_and_repeat_iterator(iterator, number_of_skips, number_of_insertions):
32 | return make_iterator_with_repeats(make_skip_iterator(iterator, number_of_skips),
33 | number_of_insertions)
--------------------------------------------------------------------------------
/models/timelens_flow/timelens/common/size_adapter.py:
--------------------------------------------------------------------------------
1 | import math
2 |
3 | from torch import nn
4 |
5 |
6 | def closest_larger_multiple_of_minimum_size(size, minimum_size):
7 | return int(math.ceil(size / minimum_size) * minimum_size)
8 |
9 | class SizeAdapter(object):
10 | """Converts size of input to standard size.
11 | Practical deep network works only with input images
12 | which height and width are multiples of a minimum size.
13 | This class allows to pass to the network images of arbitrary
14 | size, by padding the input to the closest multiple
15 | and unpadding the network's output to the original size.
16 | """
17 |
18 | def __init__(self, minimum_size=64):
19 | self._minimum_size = minimum_size
20 | self._pixels_pad_to_width = None
21 | self._pixels_pad_to_height = None
22 |
23 | def _closest_larger_multiple_of_minimum_size(self, size):
24 | return closest_larger_multiple_of_minimum_size(size, self._minimum_size)
25 |
26 | def pad(self, network_input):
27 | """Returns "network_input" paded with zeros to the "standard" size.
28 | The "standard" size correspond to the height and width that
29 | are closest multiples of "minimum_size". The method pads
30 | height and width and and saves padded values. These
31 | values are then used by "unpad_output" method.
32 | """
33 | height, width = network_input.size()[-2:]
34 | self._pixels_pad_to_height = (self._closest_larger_multiple_of_minimum_size(height) - height)
35 | self._pixels_pad_to_width = (self._closest_larger_multiple_of_minimum_size(width) - width)
36 | return nn.ZeroPad2d((self._pixels_pad_to_width, 0, self._pixels_pad_to_height, 0))(network_input)
37 |
38 | def unpad(self, network_output):
39 | """Returns "network_output" cropped to the original size.
40 | The cropping is performed using values save by the "pad_input"
41 | method.
42 | """
43 | return network_output[..., self._pixels_pad_to_height:, self._pixels_pad_to_width:]
44 |
--------------------------------------------------------------------------------
/models/timelens_flow/timelens/fusion_network.py:
--------------------------------------------------------------------------------
1 | import torch as th
2 | from timelens.superslomo import unet
3 | from torch import nn
4 |
5 | def _pack(example):
6 | return th.cat([example['before']['voxel_grid'],
7 | example['before']['rgb_image_tensor'],
8 | example['after']['voxel_grid'],
9 | example['after']['rgb_image_tensor']], dim=1)
10 |
11 |
12 | class Fusion(nn.Module):
13 | def __init__(self):
14 | super(Fusion, self).__init__()
15 | self.fusion_network = unet.UNet(2 * 3 + 2 * 5, 3, False)
16 |
17 | def run_fusion(self, example):
18 | return self.fusion_network(_pack(example))
19 |
20 | def from_legacy_checkpoint(self, checkpoint_filename):
21 | checkpoint = th.load(checkpoint_filename)
22 | self.load_state_dict(checkpoint["networks"])
23 |
24 | def run_and_pack_to_example(self, example):
25 | example['middle']['fusion'] = self.run_fusion(example)
26 |
27 | def forward(self, example):
28 | return self.run_fusion(example)
29 |
--------------------------------------------------------------------------------
/models/timelens_flow/timelens/masknet.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from torch import nn
3 | import numpy as np
4 | from torch.nn import functional as F
5 |
6 |
7 | class ResBlock(nn.Module):
8 | def __init__(self, in_channel, base_channel):
9 | super().__init__()
10 | self.conv_in = nn.Sequential(
11 | nn.Conv2d(in_channel, base_channel, 3, 1, 1, bias=True),
12 | nn.LeakyReLU(0.2)
13 | )
14 | self.conv_block = nn.Sequential(
15 | nn.Conv2d(in_channel, base_channel, 3, 1, 1, bias=True),
16 | nn.LeakyReLU(0.2),
17 | nn.Conv2d(base_channel, base_channel, 3, 1, 1, bias=True),
18 | nn.LeakyReLU(0.2),
19 | nn.Conv2d(base_channel, base_channel, 3, 1, 1, bias=True)
20 | )
21 |
22 | def forward(self, x):
23 | x_ = self.conv_in(x)
24 | x_res = self.conv_block(x)
25 | return x_res+x_
26 |
27 |
28 | class MaskNet(nn.Module):
29 | def __init__(self, in_channel, base_channel):
30 | super().__init__()
31 | self.block = ResBlock(in_channel, base_channel)
32 | self.out_conv = nn.Conv2d(base_channel, 1, 3, 1, 1, bias=True)
33 | self.sig = nn.Sigmoid()
34 | # self.backward_warp = BackwardWarp()
35 |
36 | def forward(self, im0, im1, i0tf, i1tf, t, f_t0, f_t1):
37 | h, w= im0.shape[2:]
38 | t = t.repeat(1, 1, h, w).float()
39 | # flow_in = F.interpolate(torch.cat((f_t0, f_t1), 1), scale_factor=0.25, mode='bilinear')
40 | data_in = torch.cat((im0, im1, i0tf, i1tf, t, f_t0, f_t1), 1)
41 | data_in_q = F.interpolate(data_in, scale_factor=0.25, mode='bilinear')
42 | # data_in_q = torch.cat((data_in_q, forward_feat, backward_feat), 1)
43 | masknet_out_q = self.out_conv(self.block(data_in_q))
44 |
45 | mask_f = F.interpolate(masknet_out_q, scale_factor=4, mode='bilinear')
46 | mask_full = mask_f[:, :1]
47 | # mask = self.sig(F.interpolate(mask+init_mask, scale_factor=4, mode='bilinear'))
48 | mask = self.sig(mask_full)
49 | return i0tf*(1-mask)+mask*i1tf
--------------------------------------------------------------------------------
/params/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | import params.GOPROv2eREFID
2 | import params.GOPROv2eIMX636
3 | import params.hsergb
4 | import params.bsergb
5 | import params.bsergb_half
6 | import params.GOPRO_release
7 | import params.Adobe
8 | import params.challenges
--------------------------------------------------------------------------------
/params/Adobe/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('params_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'params.Adobe.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testCBMNetx16.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testCBMNetx16.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testCBMNetx32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testCBMNetx32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testCBMNetx8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testCBMNetx8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testOurs_mix16.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testOurs_mix16.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testOurs_mix32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testOurs_mix32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testOurs_mix8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testOurs_mix8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testRGBx16.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testRGBx16.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testRGBx32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testRGBx32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testRGBx8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testRGBx8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testTimeLensx16.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testTimeLensx16.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testTimeLensx32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testTimeLensx32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_testTimeLensx8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_testTimeLensx8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_trainREFID_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_trainREFID_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Adobe/__pycache__/params_trainREFID_mix32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Adobe/__pycache__/params_trainREFID_mix32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('params_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'params.GOPRO_release.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/params/GOPRO_release/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('params_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'params.GOPRO_release.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_testCBMNet_x32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_testCBMNet_x32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_testCBMNet_x8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_testCBMNet_x8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_testOurs_mix32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_testOurs_mix32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_testOurs_mix8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_testOurs_mix8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_testTimeLensx32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_testTimeLensx32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_testTimeLensx8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_testTimeLensx8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainCBMNet_flow.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainCBMNet_flow.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainCBMNet_flow_tune.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainCBMNet_flow_tune.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainCBMNet_joint.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainCBMNet_joint.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainCBMNet_joint_tune.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainCBMNet_joint_tune.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainCBMNet_tuning.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainCBMNet_tuning.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainCBMNet_tuningGC.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainCBMNet_tuningGC.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainOurs_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainOurs_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainOurs_mix_rerun.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainOurs_mix_rerun.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainREFID_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainREFID_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainREFID_mix32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainREFID_mix32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainREFID_mix8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainREFID_mix8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainREFIDadam_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainREFIDadam_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainREFIDx16.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainREFIDx16.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainREFIDx32.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainREFIDx32.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainREFIDx8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainREFIDx8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainTimeLens_attention.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainTimeLens_attention.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainTimeLens_flow.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainTimeLens_flow.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainTimeLens_fusion.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainTimeLens_fusion.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainTimeLens_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainTimeLens_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/GOPRO_release/__pycache__/params_trainTimeLens_refine.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/GOPRO_release/__pycache__/params_trainTimeLens_refine.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('params_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'params.HQEVFI.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_cbmnet_adam_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_cbmnet_adam_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_cbmnet_adam_mix4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_cbmnet_adam_mix4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_cbmnet_adam_mix8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_cbmnet_adam_mix8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_timelens_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_timelens_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_timelens_mix4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_timelens_mix4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_timelens_mix8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_timelens_mix8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_traintest_quick_adam_withlpips_mix.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_traintest_quick_adam_withlpips_mix.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_traintest_quick_adam_withlpips_mix4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_traintest_quick_adam_withlpips_mix4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/HQEVFI/__pycache__/params_traintest_quick_adam_withlpips_mix8.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/HQEVFI/__pycache__/params_traintest_quick_adam_withlpips_mix8.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Paths/.ipynb_checkpoints/Adobe240-checkpoint.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 |
12 | hostname = 'server' if 'PC' not in socket.gethostname() else 'local'
13 |
14 | Adobe = ED()
15 | Adobe.train = ED()
16 | # BSERGB.train.rgb = '/mnt/workspace/mayongrui/dataset/Adobe240/3_TRAINING/'
17 | # BSERGB.train.evs = '/mnt/workspace/mayongrui/dataset/bs_ergb/3_TRAINING/'
18 |
19 |
20 | Adobe.test = ED()
21 | Adobe.test.rgb = r'E:\Research\EVS\Dataset\bs_ergb\1_TEST' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/Adobe240FPS/RGB_dense'
22 | Adobe.test.evs = r'E:\Research\EVS\Dataset\bs_ergb\1_TEST' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/Adobe240FPS/EVS_x8interpolatedct25v006/EVS'
23 |
--------------------------------------------------------------------------------
/params/Paths/.ipynb_checkpoints/CBMNet-checkpoint.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 |
12 | hostname = 'server' if 'PC' not in socket.gethostname() else 'local'
13 |
14 | CBMNet = ED()
15 | CBMNet.train = ED()
16 | CBMNet.train.rgb = '/home/PJLAB/mayongrui/Documents/Events/Dataset/videos/GOPRO_Large_all/RGB/train' if hostname == 'local' else '/mnt/data/sail_3090/mayongrui/dataset/CBMNet/train'
17 | CBMNet.train.evs = r'E:\Research\EVS\Dataset\Events_v2eIMX636v230809\train_x8interpolated' if hostname == 'local' else '/mnt/data/sail_3090/mayongrui/dataset/CBMNet/train_eventsvoxel'
18 |
19 | CBMNet.test = ED()
20 | CBMNet.test.rgb = '/home/PJLAB/mayongrui/Documents/Events/Dataset/videos/GOPRO_Large_all/RGB/test' if hostname == 'local' else '/mnt/data/sail_3090/mayongrui/dataset/CBMNet/test'
21 | CBMNet.test.evs = r'E:\Research\EVS\Dataset\Events_v2eIMX636v230809\test_x8interpolated' if hostname == 'local' else '/mnt/data/sail_3090/mayongrui/dataset/CBMNet/test_eventsvoxel'
22 |
23 |
24 |
--------------------------------------------------------------------------------
/params/Paths/.ipynb_checkpoints/HSERGB-checkpoint.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 |
12 | hostname = 'server' if 'PC' not in socket.gethostname() else 'local'
13 |
14 | HSERGB = ED()
15 |
16 | HSERGB.test = ED()
17 | HSERGB.test.rgb = r'E:\Research\EVS\Dataset\hsergb' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/hsergb/'
18 | HSERGB.test.evs = r'E:\Research\EVS\Dataset\hsergb' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/hsergb/'
19 |
--------------------------------------------------------------------------------
/params/Paths/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | from .GOPRO import GOPRO
2 | from .CBMNet import CBMNet
--------------------------------------------------------------------------------
/params/Paths/Adobe240.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 |
12 | hostname = 'server' if 'PC' not in socket.gethostname() else 'local'
13 |
14 | Adobe = ED()
15 | Adobe.train = ED()
16 | # BSERGB.train.rgb = '/mnt/workspace/mayongrui/dataset/Adobe240/3_TRAINING/'
17 | # BSERGB.train.evs = '/mnt/workspace/mayongrui/dataset/bs_ergb/3_TRAINING/'
18 |
19 |
20 | Adobe.test = ED()
21 | Adobe.test.rgb = r'E:\Research\EVS\Dataset\bs_ergb\1_TEST' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/Adobe240FPS/RGB_dense'
22 | Adobe.test.evs = r'E:\Research\EVS\Dataset\bs_ergb\1_TEST' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/Adobe240FPS/EVS_x8interpolatedct25v006/EVS'
23 |
--------------------------------------------------------------------------------
/params/Paths/BSERGB.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 |
12 | # hostname = 'server' if 'PC' not in socket.gethostname() else 'local'
13 | hostname = 'yongrui'
14 | BSERGB = ED()
15 | BSERGB.train = ED()
16 | # BSERGB.train.rgb = r'E:\Research\EVS\Dataset\bs_ergb\3_TRAINING' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/bs_ergb/3_TRAINING/'
17 | # BSERGB.train.evs = r'E:\Research\EVS\Dataset\bs_ergb\3_TRAINING' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/bs_ergb/3_TRAINING/'
18 | BSERGB.train.rgb = '/media/mayongrui/DataSet/bs_ergb/3_TRAINING'
19 | BSERGB.train.evs = '/media/mayongrui/DataSet/bs_ergb/3_TRAINING'
20 |
21 |
22 | BSERGB.test = ED()
23 | # BSERGB.test.rgb = r'E:\Research\EVS\Dataset\bs_ergb\1_TEST' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/bs_ergb/1_TEST/'
24 | # BSERGB.test.evs = r'E:\Research\EVS\Dataset\bs_ergb\1_TEST' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/bs_ergb/1_TEST/'
25 | BSERGB.test.rgb = '/media/mayongrui/DataSet/bs_ergb/1_TEST'
26 | BSERGB.test.evs = '/media/mayongrui/DataSet/bs_ergb/1_TEST'
27 |
28 |
--------------------------------------------------------------------------------
/params/Paths/CBMNet.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 |
12 | hostname = 'server' if 'PC' not in socket.gethostname() else 'local'
13 |
14 | CBMNet = ED()
15 | CBMNet.train = ED()
16 | CBMNet.train.rgb = r'E:\Research\EVS\Dataset\CBMNet\train' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/CBMNet/train'
17 | CBMNet.train.evs = r'E:\Research\EVS\Dataset\Events_v2eIMX636v230809\train_x8interpolated' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/CBMNet/train_eventsvoxel'
18 |
19 | CBMNet.test = ED()
20 | CBMNet.test.rgb = r'E:\Research\EVS\Dataset\CBMNet\train' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/CBMNet/test'
21 | CBMNet.test.evs = r'E:\Research\EVS\Dataset\Events_v2eIMX636v230809\test_x8interpolated' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/CBMNet/test_eventsvoxel'
22 |
23 | CBMNet.train.evs_raw = r'E:\Research\EVS\Dataset\CBMNet\train' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/CBMNet/train'
24 | CBMNet.test.evs_raw = r'E:\Research\EVS\Dataset\CBMNet\train' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/CBMNet/test'
25 |
--------------------------------------------------------------------------------
/params/Paths/HSERGB.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 |
12 | hostname = 'server' if 'PC' not in socket.gethostname() else 'local'
13 |
14 | HSERGB = ED()
15 |
16 | HSERGB.test = ED()
17 | HSERGB.test.rgb = r'E:\Research\EVS\Dataset\hsergb' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/hsergb/'
18 | HSERGB.test.evs = r'E:\Research\EVS\Dataset\hsergb' if hostname == 'local' else '/mnt/workspace/mayongrui/dataset/hsergb/'
19 |
--------------------------------------------------------------------------------
/params/Paths/RealCaptured.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os.path import join, split, splitext
3 | from tools import parse_path
4 | import socket
5 | from easydict import EasyDict as ED
6 | import datetime
7 |
8 |
9 | mkdir = lambda x:os.makedirs(x, exist_ok=True)
10 |
11 | hostname = 'yongrui'
12 | RC = ED()
13 | RC.train = ED()
14 | RC.train.rgb = '/media/mayongrui/DataSet/HQ-EVFI'
15 | RC.train.evs = '/media/mayongrui/DataSet/HQ-EVFI'
16 |
17 | RC.test = ED()
18 | RC.test.rgb = '/media/mayongrui/DataSet/HQ-EVFI'
19 | RC.test.evs = '/media/mayongrui/DataSet/HQ-EVFI'
20 |
--------------------------------------------------------------------------------
/params/Paths/__init__.py:
--------------------------------------------------------------------------------
1 | from .GOPRO import GOPRO
2 | from .CBMNet import CBMNet
--------------------------------------------------------------------------------
/params/Paths/__pycache__/Adobe240.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Paths/__pycache__/Adobe240.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Paths/__pycache__/BSERGB.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Paths/__pycache__/BSERGB.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Paths/__pycache__/CBMNet.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Paths/__pycache__/CBMNet.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Paths/__pycache__/GOPRO.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Paths/__pycache__/GOPRO.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Paths/__pycache__/HSERGB.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Paths/__pycache__/HSERGB.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Paths/__pycache__/RealCaptured.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Paths/__pycache__/RealCaptured.cpython-312.pyc
--------------------------------------------------------------------------------
/params/Paths/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/Paths/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/params/__init__.py:
--------------------------------------------------------------------------------
1 | import params.bsergb
2 | import params.GOPRO_release
3 | import params.Adobe
4 | import params.HQEVFI
--------------------------------------------------------------------------------
/params/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/params/__pycache__/models.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/__pycache__/models.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__init__.py:
--------------------------------------------------------------------------------
1 | from os import path as osp
2 | from os import scandir
3 | import importlib
4 |
5 |
6 | # automatically scan and import dataset modules for registry
7 | # scan all the files under the data folder with '_dataset' in file names
8 | data_folder = osp.dirname(osp.abspath(__file__))
9 | data_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.name.startswith('params_')]
10 | # import all the dataset modules
11 | _data_modules = [importlib.import_module(f'params.bsergb.{file_name}') for file_name in data_filenames]
12 |
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_CBMNet_flow_x4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_CBMNet_flow_x4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_CBMNet_tuning.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_CBMNet_tuning.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_CBMNet_tuning_x4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_CBMNet_tuning_x4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_CBMNet_tuning_x4_adam.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_CBMNet_tuning_x4_adam.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_testRGBx2.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_testRGBx2.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_testRGBx4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_testRGBx4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_trainTimeLens_flowx4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_trainTimeLens_flowx4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_trainTimeLens_tuning.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_trainTimeLens_tuning.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_trainTimeLens_tuning_x4.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_trainTimeLens_tuning_x4.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_traintest_quick_adam_withlpips_x4iter.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_traintest_quick_adam_withlpips_x4iter.cpython-312.pyc
--------------------------------------------------------------------------------
/params/bsergb/__pycache__/params_traintest_x4AdamwithLPIPS.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/params/bsergb/__pycache__/params_traintest_x4AdamwithLPIPS.cpython-312.pyc
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | absl-py==2.1.0
2 | accelerate==0.32.1
3 | addict==2.4.0
4 | antlr4-python3-runtime==4.9.3
5 | appdirs==1.4.4
6 | atomicwrites==1.4.0
7 | bitsandbytes==0.43.1
8 | datasets==2.20.0
9 | decord==0.6.0
10 | diffusers==0.29.2
11 | DISTS-pytorch==0.1
12 | docker-pycreds==0.4.0
13 | easydict==1.13
14 | einops==0.8.0
15 | facexlib==0.3.0
16 | filterpy==1.4.5
17 | flow-vis==0.1
18 | fqdn==1.5.1
19 | ftfy==6.2.0
20 | future==1.0.0
21 | gdown==5.2.0
22 | grpcio==1.64.1
23 | huggingface-hub==0.23.4
24 | icecream==2.1.3
25 | imgaug==0.4.0
26 | isoduration==20.11.0
27 | jsonpointer==2.1
28 | lightning-utilities==0.11.8
29 | modelcards==0.1.6
30 | multiprocess==0.70.16
31 | natsort==8.4.0
32 | nvidia-cublas-cu12==12.1.3.1
33 | nvidia-cuda-cupti-cu12==12.1.105
34 | nvidia-cuda-nvrtc-cu12==12.1.105
35 | nvidia-cuda-runtime-cu12==12.1.105
36 | nvidia-cudnn-cu12==8.9.2.26
37 | nvidia-cufft-cu12==11.0.2.54
38 | nvidia-curand-cu12==10.3.2.106
39 | nvidia-cusolver-cu12==11.4.5.107
40 | nvidia-cusparse-cu12==12.1.0.106
41 | nvidia-nccl-cu12==2.20.5
42 | nvidia-nvjitlink-cu12==12.5.82
43 | nvidia-nvtx-cu12==12.1.105
44 | omegaconf==2.3.0
45 | openai-clip==1.0.1
46 | opencv-python==4.10.0.84
47 | pyarrow==16.1.0
48 | pyarrow-hotfix==0.6
49 | pyasn1-modules==0.2.8
50 | pycryptodomex==3.20.0
51 | pyiqa==0.1.11
52 | pyls-spyder==0.4.0
53 | safetensors==0.4.3
54 | timm==1.0.7
55 | tokenizers==0.15.2
56 | torch==2.3.1
57 | torchmetrics==1.5.1
58 | torchvision==0.18.1
59 | transformers==4.37.2
60 | triton==3.0.0
61 | uri-template==1.3.0
62 | wandb==0.17.4
63 | wcwidth==0.2.13
64 | webcolors==24.6.0
65 | websockets==12.0
66 | wheel==0.43.0
67 | xformers==0.0.27
68 | xxhash==3.4.1
69 |
--------------------------------------------------------------------------------
/tools/.ipynb_checkpoints/__init__-checkpoint.py:
--------------------------------------------------------------------------------
1 | from .file_path_index import parse_path, parse_path_common
--------------------------------------------------------------------------------
/tools/.ipynb_checkpoints/ffmpeg_v2f-checkpoint.py:
--------------------------------------------------------------------------------
1 | import shutil
2 | import os
3 | import argparse
4 | import sys
5 |
6 | parser = argparse.ArgumentParser()
7 | parser.add_argument("--video", type=str, help='path of source video ')
8 | parser.add_argument("--dest", type=str, help='path of dest video ')
9 | parser.add_argument("--depth", type=int, default=1, help='folder depth')
10 | parser.add_argument("--ds", type=int, default=1, help='times of down sample')
11 | args = parser.parse_args()
12 | # srun --partition=Pixel python ffmpeg_v2f.py --video=datasets/oppo-OSD1-v --dest=datasets/oppo-OSD1 --ds=1
13 | #path to ffmpeg.exe
14 | ffmpeg_dir=''
15 | #video type
16 | vtype = '.mp4'
17 | if not os.path.exists(args.dest):
18 | os.mkdir(args.dest)
19 | # else:
20 | # shutil.rmtree(args.dest)
21 | # os.mkdir(args.dest)
22 |
23 | def extract_frames(video, outDir):
24 | error = ""
25 | print('{} -i {} -vsync 0 -qscale:v 2 {}/%06d.jpg'.format(os.path.join(ffmpeg_dir, "ffmpeg"), video, outDir))
26 | retn = os.system('{} -v quiet -i {} -vsync 0 -qscale:v 2 {}/%06d.jpg'.format(os.path.join(ffmpeg_dir, "ffmpeg"), video, outDir))
27 | if retn:
28 | error = "Error converting file:{}. Exiting.".format(video)
29 | sys.exit(error)
30 | counter = -1
31 | if args.ds is not 1:
32 | for i in sorted(os.listdir(outDir)):
33 | counter += 1
34 | if counter % args.ds == 0:
35 | continue
36 | os.remove(os.path.join(outDir, i))
37 | return error
38 |
39 |
40 | if args.depth == 1:
41 | for i in os.listdir(args.video):
42 | print(i)
43 | extractionPath = os.path.join(args.dest,i.split('.')[0])
44 | if not os.path.exists(extractionPath):
45 | os.mkdir(extractionPath)
46 | extract_frames(os.path.join(args.video,i),extractionPath)
47 | else:
48 | if not os.path.exists(os.path.join(args.dest,args.video.split('.')[0])):
49 | os.mkdir(os.path.join(args.dest,args.video.split('.')[0]))
50 | extract_frames(args.video, os.path.join(args.dest,args.video.split('.')[0]))
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/tools/.ipynb_checkpoints/interface_deparse-checkpoint.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | import torch
3 | import numpy as np
4 | import params
5 | from .registery import PARAM_REGISTRY
6 | from datetime import datetime
7 | import os
8 |
9 | def keyword_parse():
10 | parser = argparse.ArgumentParser(description='')
11 | parser.add_argument("--param_name", type=str, default="trainGOPROVFI", help="model saving path")
12 | parser.add_argument("--model_name", type=str, default="E_TRFNetv0", help="model name")
13 | parser.add_argument("--seed", type=int, default=1226, help="random seed")
14 | parser.add_argument("--model_pretrained", type=str, default=None, help="model saving name")
15 | parser.add_argument("--init_step", type=int, default=None, help="initialize training steps")
16 | parser.add_argument("--skip_training", action="store_true", help="Whether or not enable training")
17 | parser.add_argument("--clear_previous", action="store_true", help="Delete previous results")
18 | parser.add_argument("--extension", type=str, default='', help="extension of save folder")
19 | parser.add_argument("--calc_flops", action="store_true")
20 |
21 | args = parser.parse_args()
22 | torch.manual_seed(args.seed)
23 | torch.cuda.manual_seed_all(args.seed)
24 | np.random.seed(args.seed)
25 | params = PARAM_REGISTRY.get(args.param_name)(args)
26 | params.args = args
27 | # params.use_cuda = args.use_cuda
28 | params.gpu_ids = range(torch.cuda.device_count())
29 | params.enable_training = not args.skip_training
30 | params.init_step = args.init_step
31 |
32 | print('Training and testing using parameters: ', args.param_name)
33 | print('Model: ', params.model_config.name)
34 | print(f"GPU ids: {params.gpu_ids}")
35 | return params
36 |
--------------------------------------------------------------------------------
/tools/TimeTracker.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | class Ttracker():
4 | def __init__(self, track=False, count_step=10):
5 | self.if_track = track
6 | self.count = 0
7 | self.count_step = count_step
8 | self.record = {str(self.count):{}}
9 | self.last_time = time.time()
10 | self.count_start = None
11 |
12 | def count_plus(self):
13 | self.record[str(self.count)]['start'] = [time.time()-self.count_start]
14 | self.count += 1
15 | if self.count % self.count_step == 0 and self.if_track:
16 | self.print()
17 | self.record.update({str(self.count):{}})
18 |
19 | def print(self):
20 | with open('time_analysis.txt', 'a+') as f:
21 | f.write(f'From {self.count-self.count_step} to {self.count-1}\n')
22 | keys = self.record[str(self.count-1)].keys()
23 | for k in keys:
24 | time_ana = 0.
25 | for count in self.record.keys():
26 | time_ana += self.record[count][k][0]
27 | f.write(f"{k}, avg: {time_ana/self.count_step*1000:.4f} ms\n")
28 | self.record = {}
29 |
30 | def time_init(self):
31 | self.last_time= time.time()
32 |
33 | def time_init_count(self):
34 | self.count_start = time.time()
35 |
36 |
37 |
38 | def track(self, record):
39 | if not self.if_track:
40 | return
41 | self.record[str(self.count)].update({
42 | str(record):[time.time()-self.last_time]
43 | })
44 | self.time_init()
45 | return
46 |
--------------------------------------------------------------------------------
/tools/__init__.py:
--------------------------------------------------------------------------------
1 | from .file_path_index import parse_path, parse_path_common
2 | from torchvision.transforms import ToPILImage, ToTensor
3 |
4 | toim, totensor = ToPILImage(), ToTensor()
--------------------------------------------------------------------------------
/tools/__pycache__/TimeTracker.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/tools/__pycache__/TimeTracker.cpython-312.pyc
--------------------------------------------------------------------------------
/tools/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/tools/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/tools/__pycache__/file_path_index.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/tools/__pycache__/file_path_index.cpython-312.pyc
--------------------------------------------------------------------------------
/tools/__pycache__/initOptimScheduler.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/tools/__pycache__/initOptimScheduler.cpython-312.pyc
--------------------------------------------------------------------------------
/tools/__pycache__/interface_deparse.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/tools/__pycache__/interface_deparse.cpython-312.pyc
--------------------------------------------------------------------------------
/tools/__pycache__/model_deparse.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/tools/__pycache__/model_deparse.cpython-312.pyc
--------------------------------------------------------------------------------
/tools/__pycache__/registery.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenImagingLab/TimeLens-XL/414bc65fa6f1b8a45836c3233b37f7b4753cf3e9/tools/__pycache__/registery.cpython-312.pyc
--------------------------------------------------------------------------------
/tools/ffmpeg_v2f.py:
--------------------------------------------------------------------------------
1 | import shutil
2 | import os
3 | import argparse
4 | import sys
5 |
6 | parser = argparse.ArgumentParser()
7 | parser.add_argument("--video", type=str, help='path of source video ')
8 | parser.add_argument("--dest", type=str, help='path of dest video ')
9 | parser.add_argument("--depth", type=int, default=1, help='folder depth')
10 | parser.add_argument("--ds", type=int, default=1, help='times of down sample')
11 | args = parser.parse_args()
12 | # srun --partition=Pixel python ffmpeg_v2f.py --video=datasets/oppo-OSD1-v --dest=datasets/oppo-OSD1 --ds=1
13 | #path to ffmpeg.exe
14 | ffmpeg_dir=''
15 | #video type
16 | vtype = '.mp4'
17 | if not os.path.exists(args.dest):
18 | os.mkdir(args.dest)
19 | # else:
20 | # shutil.rmtree(args.dest)
21 | # os.mkdir(args.dest)
22 |
23 | def extract_frames(video, outDir):
24 | error = ""
25 | print('{} -i {} -vsync 0 -qscale:v 2 {}/%06d.jpg'.format(os.path.join(ffmpeg_dir, "ffmpeg"), video, outDir))
26 | retn = os.system('{} -v quiet -i {} -vsync 0 -qscale:v 2 {}/%06d.jpg'.format(os.path.join(ffmpeg_dir, "ffmpeg"), video, outDir))
27 | if retn:
28 | error = "Error converting file:{}. Exiting.".format(video)
29 | sys.exit(error)
30 | counter = -1
31 | if args.ds is not 1:
32 | for i in sorted(os.listdir(outDir)):
33 | counter += 1
34 | if counter % args.ds == 0:
35 | continue
36 | os.remove(os.path.join(outDir, i))
37 | return error
38 |
39 |
40 | if args.depth == 1:
41 | for i in os.listdir(args.video):
42 | print(i)
43 | extractionPath = os.path.join(args.dest,i.split('.')[0])
44 | if not os.path.exists(extractionPath):
45 | os.mkdir(extractionPath)
46 | extract_frames(os.path.join(args.video,i),extractionPath)
47 | else:
48 | if not os.path.exists(os.path.join(args.dest,args.video.split('.')[0])):
49 | os.mkdir(os.path.join(args.dest,args.video.split('.')[0]))
50 | extract_frames(args.video, os.path.join(args.dest,args.video.split('.')[0]))
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/tools/modelsize_estimate.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 | import numpy as np
4 |
5 |
6 | def modelsize(model, input, type_size=4):
7 | para = sum([np.prod(list(p.size())) for p in model.parameters()])
8 | # print('Model {} : Number of params: {}'.format(model._get_name(), para))
9 | print('Model {} : params: {:4f}M'.format(model._get_name(), para * type_size / 1000 / 1000))
10 |
11 | input_ = input.clone()
12 | input_.requires_grad_(requires_grad=False)
13 |
14 | mods = list(model.modules())
15 | out_sizes = []
16 |
17 | for i in range(1, len(mods)):
18 | m = mods[i]
19 | if isinstance(m, nn.ReLU):
20 | if m.inplace:
21 | continue
22 | out = m(input_)
23 | out_sizes.append(np.array(out.size()))
24 | input_ = out
25 |
26 | total_nums = 0
27 | for i in range(len(out_sizes)):
28 | s = out_sizes[i]
29 | nums = np.prod(np.array(s))
30 | total_nums += nums
31 |
32 | # print('Model {} : Number of intermedite variables without backward: {}'.format(model._get_name(), total_nums))
33 | # print('Model {} : Number of intermedite variables with backward: {}'.format(model._get_name(), total_nums*2))
34 | print('Model {} : intermedite variables: {:3f} M (without backward)'
35 | .format(model._get_name(), total_nums * type_size / 1000 / 1000))
36 | print('Model {} : intermedite variables: {:3f} M (with backward)'
37 | .format(model._get_name(), total_nums * type_size*2 / 1000 / 1000))
38 |
39 |
--------------------------------------------------------------------------------
/tools/print_grad.py:
--------------------------------------------------------------------------------
1 | import torch
2 |
3 |
4 | def print_grad(net):
5 | for p in net.named_parameters():
6 | name, variable = p[0], p[1]
7 | if variable.requires_grad and variable.grad is not None:
8 | print('+'*20, name, variable.requires_grad, variable.grad.max().item(), variable.grad.min().item())
9 | else:
10 | print('!'*20, name, variable.requires_grad)
11 |
--------------------------------------------------------------------------------
/tools/tools_for_debugging.py:
--------------------------------------------------------------------------------
1 | from matplotlib.pyplot import imshow, show, figure
2 | from torchvision.transforms import ToPILImage, ToTensor
3 | import torch
4 |
5 |
6 | toim = ToPILImage()
7 | totensor = ToTensor()
8 |
9 | def align_and_vis_images(im0, im1, res, gts):
10 | res = torch.cat(res[0].split(1), 2)
11 | gts = torch.cat(gts[0].split(1), 2)
12 | im = torch.cat((im0, im1), 2)[0]
13 | outim = torch.cat((im, torch.cat((res, gts), 2)[0]))
14 | return toim(outim)
--------------------------------------------------------------------------------