Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
deng b93fd0cb9b | 1 year ago | |
---|---|---|
ascend310_infer | 2 years ago | |
infer | 2 years ago | |
modelarts | 2 years ago | |
script | 2 years ago | |
src | 2 years ago | |
README.md | 1 year ago | |
eval.py | 2 years ago | |
export.py | 2 years ago | |
postprocess.py | 2 years ago | |
preprocess.py | 2 years ago | |
train.py | 2 years ago |
目录
WDSR于2018年提出的 WDSR用于提高深度超分辨率网络的精度,它在 NTIRE 2018 单幅图像超分辨率挑战赛中获得了所有三个真实赛道的第一名。
论文1:Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee, "Enhanced Deep Residual Networks for Single Image Super-Resolution," *2nd NTIRE: New Trends in Image Restoration and Enhancement workshop and challenge on image super-resolution in conjunction with CVPR 2017.论文2: Jiahui Yu, Yuchen Fan, Jianchao Yang, Ning Xu, Zhaowen Wang, Xinchao Wang, Thomas Huang, "Wide Activation for Efficient and Accurate Image Super-Resolution", arXiv preprint arXiv:1808.08718.
WDSR网络主要由几个基本模块(包括卷积层和池化层)组成。通过更广泛的激活和线性低秩卷积,并引入权重归一化实现更高精度的单幅图像超分辨率。这里的基本模块主要包括以下基本操作: 1 × 1 卷积和3 × 3 卷积。
经过1次卷积层,再串联32个残差模块,再经过1次卷积层,最后上采样并卷积。
使用的数据集:DIV2K
数据集大小:7.11G,
数据格式:png文件
DIV2K
├── DIV2K_test_LR_bicubic
│ ├── X2
│ │ ├── 0901x2.png
│ │ ├─ ...
│ │ └── 1000x2.png
│ ├── X3
│ │ ├── 0901x3.png
│ │ ├─ ...
│ │ └── 1000x3.png
│ └── X4
│ ├── 0901x4.png
│ ├─ ...
│ └── 1000x4.png
├── DIV2K_test_LR_unknown
│ ├── X2
│ │ ├── 0901x2.png
│ │ ├─ ...
│ │ └── 1000x2.png
│ ├── X3
│ │ ├── 0901x3.png
│ │ ├─ ...
│ │ └── 1000x3.png
│ └── X4
│ ├── 0901x4.png
│ ├─ ...
│ └── 1000x4.png
├── DIV2K_train_HR
│ ├── 0001.png
│ ├─ ...
│ └── 0900.png
├── DIV2K_train_LR_bicubic
│ ├── X2
│ │ ├── 0001x2.png
│ │ ├─ ...
│ │ └── 0900x2.png
│ ├── X3
│ │ ├── 0001x3.png
│ │ ├─ ...
│ │ └── 0900x3.png
│ └── X4
│ ├── 0001x4.png
│ ├─ ...
│ └── 0900x4.png
└── DIV2K_train_LR_unknown
├── X2
│ ├── 0001x2.png
│ ├─ ...
│ └── 0900x2.png
├── X3
│ ├── 0001x3.png
│ ├─ ...
│ └── 0900x3.png
└── X4
├── 0001x4.png
├─ ...
└── 0900x4.png
通过官方网站安装MindSpore后,您可以按照如下步骤进行训练和评估:
# 单卡训练
# Ascend
sh run_ascend_standalone.sh [TRAIN_DATA_DIR]
# GPU
bash run_gpu_standalone.sh [TRAIN_DATA_DIR]
# 分布式训练
# Ascend
sh run_ascend_distribute.sh [RANK_TABLE_FILE] [TRAIN_DATA_DIR]
# GPU
bash run_gpu_distribute.sh [TRAIN_DATA_DIR] [DEVICE_NUM]
#评估
bash run_eval.sh [TEST_DATA_DIR] [CHECKPOINT_PATH] [DATASET_TYPE]
WDSR
├── README_CN.md //自述文件
├── script
│ ├── run_ascend_distribute.sh //Ascend分布式训练shell脚本
│ ├── run_ascend_standalone.sh //Ascend单卡训练shell脚本
│ ├── run_gpu_distribute.sh //GPU分布式训练shell脚本
│ ├── run_gpu_standalone.sh //GPU单卡训练shell脚本
│ └── run_eval.sh //eval验证shell脚本
├── src
│ ├── args.py //超参数
│ ├── common.py //公共网络模块
│ ├── data
│ │ ├── common.py //公共数据集
│ │ ├── div2k.py //div2k数据集
│ │ └── srdata.py //所有数据集
│ ├── metrics.py //PSNR和SSIM计算器
│ ├── model.py //WDSR网络
│ └── utils.py //辅助函数
├── train.py //训练脚本
├── eval.py //评估脚本
└── export.py
主要参数如下:
-h, --help show this help message and exit
--dir_data DIR_DATA dataset directory
--data_train DATA_TRAIN train dataset name
--data_test DATA_TEST test dataset name
--data_range DATA_RANGE train/test data range
--ext EXT dataset file extension
--scale SCALE super-resolution scale
--patch_size PATCH_SIZE output patch size
--rgb_range RGB_RANGE maximum value of RGB
--n_colors N_COLORS number of color channels to use
--no_augment do not use data augmentation
--model MODEL model name
--n_resblocks N_RESBLOCKS number of residual blocks
--n_feats N_FEATS number of feature maps
--res_scale RES_SCALE residual scaling
--test_every TEST_EVERY do test per every N batches
--epochs EPOCHS number of epochs to train
--batch_size BATCH_SIZE input batch size for training
--test_only set this option to test the model
--lr LR learning rate
--ckpt_path CKPT_PATH path of saved ckpt
--ckpt_save_path CKPT_SAVE_PATH path to save ckpt
--ckpt_save_interval CKPT_SAVE_INTERVAL save ckpt frequency, unit is epoch
--ckpt_save_max CKPT_SAVE_MAX max number of saved ckpt
--task_id TASK_ID
Ascend处理器环境运行
sh run_ascend_standalone.sh [TRAIN_DATA_DIR]
GPU环境运行
sh run_gpu_standalone.sh [TRAIN_DATA_DIR]
上述python命令将在后台运行,您可以通过train.log文件查看结果。
Ascend处理器环境运行
sh run_ascend_distribute.sh [RANK_TABLE_FILE] [TRAIN_DATA_DIR]
GPU环境运行
sh run_gpu_distribute.sh [TRAIN_DATA_DIR] [DEVICE_NUM]
TRAIN_DATA_DIR = "~DATA/"。
在运行以下命令之前,请检查用于评估的检查点路径。
sh run_eval.sh [TEST_DATA_DIR] [CHECKPOINT_PATH] DIV2K
TEST_DATA_DIR = "~DATA/"。
您可以通过eval.log文件查看结果。
sh run_infer_310.sh [MINDIR_PATH] [DATA_PATH] [DATASET_TYPE] [SCALE] [DEVICE_ID]
run_infer.log
文件查看结果。python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT]
FILE_FORMAT 可选 ['MINDIR', 'AIR', 'ONNX'], 默认['MINDIR']。
参数 | Ascend | GPU |
---|---|---|
资源 | Ascend 910 | NVIDIA GeForce RTX 3090 |
上传日期 | 2021-7-4 | 2021-11-22 |
MindSpore版本 | 1.2.0 | 1.5.0 |
数据集 | DIV2K | DIV2K |
训练参数 | epoch=1000, steps=100, batch_size =16, lr=0.0001 | epoch=300, batch_size=16, lr=0.0005 |
优化器 | Adam | Adam |
损失函数 | L1 | L1 |
输出 | 超分辨率图片 | 超分辨率图片 |
损失 | 3.5 | 3.3 |
速度 | 8卡:约130毫秒/步 | 8卡:约140毫秒/步 |
总时长 | 8卡:0.5小时 | 8卡:1.5小时 |
微调检查点 | 35 MB(.ckpt文件) | 14 MB(.ckpt文件) |
脚本 | WDSR | WDSR |
参数 | Ascend | GPU |
---|---|---|
资源 | Ascend 910 | NVIDIA GeForce RTX 3090 |
上传日期 | 2021-7-4 | 2021-11-22 |
MindSpore版本 | 1.2.0 | 1.5.0 |
数据集 | DIV2K | DIV2K |
batch_size | 1 | 1 |
输出 | 超分辨率图片 | 超分辨率图片 |
PSNR | DIV2K 34.7780 | DIV2K 35.9735 |
参数 | Ascend |
---|---|
资源 | Ascend 310 |
上传日期 | 2021-10-4 |
MindSpore版本 | 1.3.0 |
数据集 | DIV2K |
batch_size | 1 |
输出 | 超分辨率图片 |
PSNR | DIV2K 33.5745 |
在train.py中,我们设置了“train_net”函数内的种子。
请浏览官网主页。
WDSR是于2018年提出的深度图像超分辨率算法,网络的精度较高,它在 NTIRE 2018 单幅图像超分辨率挑战赛中获得了所有三个真实赛道的第一名。
Python C++ Shell Text
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》