463465810cz commited on
Commit
4163a01
·
1 Parent(s): bd2f6a4
README.md CHANGED
@@ -16,9 +16,9 @@ python setup.py develop
16
 
17
  ## Test
18
 
19
- - Download the pre-trained [models](https://ufile.io/4u0ms0h5) and place them in `experiments/pretrained_models/`.
20
 
21
- We provide all models: DAT, DAT-L, and DAT-2 (x2, x3, x4).
22
 
23
  - Download [testing](https://ufile.io/6ek67nf8) (Set5, Set14, BSD100, Urban100, Manga109) datasets, place them in `datasets/`.
24
 
@@ -32,18 +32,8 @@ python setup.py develop
32
  python basicsr/test.py -opt options/Test/test_DAT_x2.yml
33
  python basicsr/test.py -opt options/Test/test_DAT_x3.yml
34
  python basicsr/test.py -opt options/Test/test_DAT_x3.yml
35
-
36
- # DAT-L, reproduces results in Table 2 of the main paper
37
- python basicsr/test.py -opt options/Test/test_DAT_L_x2.yml
38
- python basicsr/test.py -opt options/Test/test_DAT_L_x3.yml
39
- python basicsr/test.py -opt options/Test/test_DAT_L_x3.yml
40
-
41
- # DAT-L, reproduces results in Table 1 of the supplementary material
42
- python basicsr/test.py -opt options/Test/test_DAT_2_x2.yml
43
- python basicsr/test.py -opt options/Test/test_DAT_2_x3.yml
44
- python basicsr/test.py -opt options/Test/test_DAT_2_x3.yml
45
  ```
46
-
47
  - The output is in `results`.
48
 
49
  ## Acknowledgements
 
16
 
17
  ## Test
18
 
19
+ - Download the pre-trained [models](https://ufile.io/rf58x0s9) and place them in `experiments/pretrained_models/`.
20
 
21
+ We provide DAT with scale factors: x2, x3, x4.
22
 
23
  - Download [testing](https://ufile.io/6ek67nf8) (Set5, Set14, BSD100, Urban100, Manga109) datasets, place them in `datasets/`.
24
 
 
32
  python basicsr/test.py -opt options/Test/test_DAT_x2.yml
33
  python basicsr/test.py -opt options/Test/test_DAT_x3.yml
34
  python basicsr/test.py -opt options/Test/test_DAT_x3.yml
 
 
 
 
 
 
 
 
 
 
35
  ```
36
+
37
  - The output is in `results`.
38
 
39
  ## Acknowledgements
experiments/README.md CHANGED
@@ -1,2 +1,2 @@
1
- Dwonload the pre-trained [models](https://ufile.io/4u0ms0h5) and place them in `pretrained_models`.
2
 
 
1
+ Dwonload the pre-trained [models](https://ufile.io/rf58x0s9) and place them in `pretrained_models`.
2
 
options/Test/test_DAT_2_x2.yml DELETED
@@ -1,93 +0,0 @@
1
- # general settings
2
- name: test_DAT_2_x2
3
- model_type: SRModel
4
- scale: 2
5
- num_gpu: 1
6
- manual_seed: 10
7
-
8
- datasets:
9
- test_1: # the 1st test dataset
10
- task: SR
11
- name: Set5
12
- type: PairedImageDataset
13
- dataroot_gt: datasets/benchmark/Set5/HR
14
- dataroot_lq: datasets/benchmark/Set5/LR_bicubic/X2
15
- filename_tmpl: '{}x2'
16
- io_backend:
17
- type: disk
18
-
19
- test_2: # the 2st test dataset
20
- task: SR
21
- name: Set14
22
- type: PairedImageDataset
23
- dataroot_gt: datasets/benchmark/Set14/HR
24
- dataroot_lq: datasets/benchmark/Set14/LR_bicubic/X2
25
- filename_tmpl: '{}x2'
26
- io_backend:
27
- type: disk
28
-
29
- test_3: # the 3st test dataset
30
- task: SR
31
- name: B100
32
- type: PairedImageDataset
33
- dataroot_gt: datasets/benchmark/B100/HR
34
- dataroot_lq: datasets/benchmark/B100/LR_bicubic/X2
35
- filename_tmpl: '{}x2'
36
- io_backend:
37
- type: disk
38
-
39
- test_4: # the 4st test dataset
40
- task: SR
41
- name: Urban100
42
- type: PairedImageDataset
43
- dataroot_gt: datasets/benchmark/Urban100/HR
44
- dataroot_lq: datasets/benchmark/Urban100/LR_bicubic/X2
45
- filename_tmpl: '{}x2'
46
- io_backend:
47
- type: disk
48
-
49
- test_5: # the 5st test dataset
50
- task: SR
51
- name: Manga109
52
- type: PairedImageDataset
53
- dataroot_gt: datasets/benchmark/Manga109/HR
54
- dataroot_lq: datasets/benchmark/Manga109/LR_bicubic/X2
55
- filename_tmpl: '{}_LRBI_x2'
56
- io_backend:
57
- type: disk
58
-
59
-
60
- # network structures
61
- network_g:
62
- type: DAT
63
- upscale: 2
64
- in_chans: 3
65
- img_size: 64
66
- img_range: 1.
67
- split_size: [8,32]
68
- depth: [6,6,6,6,6,6]
69
- embed_dim: 180
70
- num_heads: [6,6,6,6,6,6]
71
- expansion_factor: 2
72
- resi_connection: '1conv'
73
-
74
- # path
75
- path:
76
- pretrain_network_g: experiments/pretrained_models/DAT/DAT_2_x2.pth
77
- strict_load_g: True
78
-
79
- # validation settings
80
- val:
81
- save_img: False
82
- suffix: ~ # add suffix to saved images, if None, use exp name
83
- use_chop: False
84
-
85
- metrics:
86
- psnr: # metric name, can be arbitrary
87
- type: calculate_psnr
88
- crop_border: 2
89
- test_y_channel: True
90
- ssim:
91
- type: calculate_ssim
92
- crop_border: 2
93
- test_y_channel: True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
options/Test/test_DAT_2_x3.yml DELETED
@@ -1,92 +0,0 @@
1
- # general settings
2
- name: test_DAT_2_x3
3
- model_type: SRModel
4
- scale: 3
5
- num_gpu: 1
6
- manual_seed: 10
7
-
8
- datasets:
9
- test_1: # the 1st test dataset
10
- task: SR
11
- name: Set5
12
- type: PairedImageDataset
13
- dataroot_gt: datasets/benchmark/Set5/HR
14
- dataroot_lq: datasets/benchmark/Set5/LR_bicubic/X3
15
- filename_tmpl: '{}x3'
16
- io_backend:
17
- type: disk
18
-
19
- test_2: # the 2st test dataset
20
- task: SR
21
- name: Set14
22
- type: PairedImageDataset
23
- dataroot_gt: datasets/benchmark/Set14/HR
24
- dataroot_lq: datasets/benchmark/Set14/LR_bicubic/X3
25
- filename_tmpl: '{}x3'
26
- io_backend:
27
- type: disk
28
-
29
- test_3: # the 3st test dataset
30
- task: SR
31
- name: B100
32
- type: PairedImageDataset
33
- dataroot_gt: datasets/benchmark/B100/HR
34
- dataroot_lq: datasets/benchmark/B100/LR_bicubic/X3
35
- filename_tmpl: '{}x3'
36
- io_backend:
37
- type: disk
38
-
39
- test_4: # the 4st test dataset
40
- task: SR
41
- name: Urban100
42
- type: PairedImageDataset
43
- dataroot_gt: datasets/benchmark/Urban100/HR
44
- dataroot_lq: datasets/benchmark/Urban100/LR_bicubic/X3
45
- filename_tmpl: '{}x3'
46
- io_backend:
47
- type: disk
48
-
49
- test_5: # the 5st test dataset
50
- task: SR
51
- name: Manga109
52
- type: PairedImageDataset
53
- dataroot_gt: datasets/benchmark/Manga109/HR
54
- dataroot_lq: datasets/benchmark/Manga109/LR_bicubic/X3
55
- filename_tmpl: '{}_LRBI_x3'
56
- io_backend:
57
- type: disk
58
-
59
- # network structures
60
- network_g:
61
- type: DAT
62
- upscale: 3
63
- in_chans: 3
64
- img_size: 64
65
- img_range: 1.
66
- split_size: [8,32]
67
- depth: [6,6,6,6,6,6]
68
- embed_dim: 180
69
- num_heads: [6,6,6,6,6,6]
70
- expansion_factor: 2
71
- resi_connection: '1conv'
72
-
73
- # path
74
- path:
75
- pretrain_network_g: experiments/pretrained_models/DAT/DAT_2_x3.pth
76
- strict_load_g: True
77
-
78
- # validation settings
79
- val:
80
- save_img: False
81
- suffix: ~ # add suffix to saved images, if None, use exp name
82
- use_chop: False
83
-
84
- metrics:
85
- psnr: # metric name, can be arbitrary
86
- type: calculate_psnr
87
- crop_border: 3
88
- test_y_channel: True
89
- ssim:
90
- type: calculate_ssim
91
- crop_border: 3
92
- test_y_channel: True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
options/Test/test_DAT_2_x4.yml DELETED
@@ -1,93 +0,0 @@
1
- # general settings
2
- name: test_DAT_2_x4
3
- model_type: SRModel
4
- scale: 4
5
- num_gpu: 1
6
- manual_seed: 10
7
-
8
- datasets:
9
- test_1: # the 1st test dataset
10
- task: SR
11
- name: Set5
12
- type: PairedImageDataset
13
- dataroot_gt: datasets/benchmark/Set5/HR
14
- dataroot_lq: datasets/benchmark/Set5/LR_bicubic/X4
15
- filename_tmpl: '{}x4'
16
- io_backend:
17
- type: disk
18
-
19
- test_2: # the 2st test dataset
20
- task: SR
21
- name: Set14
22
- type: PairedImageDataset
23
- dataroot_gt: datasets/benchmark/Set14/HR
24
- dataroot_lq: datasets/benchmark/Set14/LR_bicubic/X4
25
- filename_tmpl: '{}x4'
26
- io_backend:
27
- type: disk
28
-
29
- test_3: # the 3st test dataset
30
- task: SR
31
- name: B100
32
- type: PairedImageDataset
33
- dataroot_gt: datasets/benchmark/B100/HR
34
- dataroot_lq: datasets/benchmark/B100/LR_bicubic/X4
35
- filename_tmpl: '{}x4'
36
- io_backend:
37
- type: disk
38
-
39
- test_4: # the 4st test dataset
40
- task: SR
41
- name: Urban100
42
- type: PairedImageDataset
43
- dataroot_gt: datasets/benchmark/Urban100/HR
44
- dataroot_lq: datasets/benchmark/Urban100/LR_bicubic/X4
45
- filename_tmpl: '{}x4'
46
- io_backend:
47
- type: disk
48
-
49
- test_5: # the 5st test dataset
50
- task: SR
51
- name: Manga109
52
- type: PairedImageDataset
53
- dataroot_gt: datasets/benchmark/Manga109/HR
54
- dataroot_lq: datasets/benchmark/Manga109/LR_bicubic/X4
55
- filename_tmpl: '{}_LRBI_x4'
56
- io_backend:
57
- type: disk
58
-
59
-
60
- # network structures
61
- network_g:
62
- type: DAT
63
- upscale: 4
64
- in_chans: 3
65
- img_size: 64
66
- img_range: 1.
67
- split_size: [8,32]
68
- depth: [6,6,6,6,6,6]
69
- embed_dim: 180
70
- num_heads: [6,6,6,6,6,6]
71
- expansion_factor: 2
72
- resi_connection: '1conv'
73
-
74
- # path
75
- path:
76
- pretrain_network_g: experiments/pretrained_models/DAT/DAT_2_x4.pth
77
- strict_load_g: True
78
-
79
- # validation settings
80
- val:
81
- save_img: False
82
- suffix: ~ # add suffix to saved images, if None, use exp name
83
- use_chop: False
84
-
85
- metrics:
86
- psnr: # metric name, can be arbitrary
87
- type: calculate_psnr
88
- crop_border: 4
89
- test_y_channel: True
90
- ssim:
91
- type: calculate_ssim
92
- crop_border: 4
93
- test_y_channel: True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
options/Test/test_DAT_L_x2.yml DELETED
@@ -1,93 +0,0 @@
1
- # general settings
2
- name: test_DAT_L_x2
3
- model_type: SRModel
4
- scale: 2
5
- num_gpu: 1
6
- manual_seed: 10
7
-
8
- datasets:
9
- test_1: # the 1st test dataset
10
- task: SR
11
- name: Set5
12
- type: PairedImageDataset
13
- dataroot_gt: datasets/benchmark/Set5/HR
14
- dataroot_lq: datasets/benchmark/Set5/LR_bicubic/X2
15
- filename_tmpl: '{}x2'
16
- io_backend:
17
- type: disk
18
-
19
- test_2: # the 2st test dataset
20
- task: SR
21
- name: Set14
22
- type: PairedImageDataset
23
- dataroot_gt: datasets/benchmark/Set14/HR
24
- dataroot_lq: datasets/benchmark/Set14/LR_bicubic/X2
25
- filename_tmpl: '{}x2'
26
- io_backend:
27
- type: disk
28
-
29
- test_3: # the 3st test dataset
30
- task: SR
31
- name: B100
32
- type: PairedImageDataset
33
- dataroot_gt: datasets/benchmark/B100/HR
34
- dataroot_lq: datasets/benchmark/B100/LR_bicubic/X2
35
- filename_tmpl: '{}x2'
36
- io_backend:
37
- type: disk
38
-
39
- test_4: # the 4st test dataset
40
- task: SR
41
- name: Urban100
42
- type: PairedImageDataset
43
- dataroot_gt: datasets/benchmark/Urban100/HR
44
- dataroot_lq: datasets/benchmark/Urban100/LR_bicubic/X2
45
- filename_tmpl: '{}x2'
46
- io_backend:
47
- type: disk
48
-
49
- test_5: # the 5st test dataset
50
- task: SR
51
- name: Manga109
52
- type: PairedImageDataset
53
- dataroot_gt: datasets/benchmark/Manga109/HR
54
- dataroot_lq: datasets/benchmark/Manga109/LR_bicubic/X2
55
- filename_tmpl: '{}_LRBI_x2'
56
- io_backend:
57
- type: disk
58
-
59
-
60
- # network structures
61
- network_g:
62
- type: DAT
63
- upscale: 2
64
- in_chans: 3
65
- img_size: 64
66
- img_range: 1.
67
- split_size: [8,32]
68
- depth: [6,6,6,6,6,6]
69
- embed_dim: 180
70
- num_heads: [6,6,6,6,6,6]
71
- expansion_factor: 4
72
- resi_connection: '1conv'
73
-
74
- # path
75
- path:
76
- pretrain_network_g: experiments/pretrained_models/DAT/DAT_L_x2.pth
77
- strict_load_g: True
78
-
79
- # validation settings
80
- val:
81
- save_img: False
82
- suffix: ~ # add suffix to saved images, if None, use exp name
83
- use_chop: False
84
-
85
- metrics:
86
- psnr: # metric name, can be arbitrary
87
- type: calculate_psnr
88
- crop_border: 2
89
- test_y_channel: True
90
- ssim:
91
- type: calculate_ssim
92
- crop_border: 2
93
- test_y_channel: True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
options/Test/test_DAT_L_x3.yml DELETED
@@ -1,92 +0,0 @@
1
- # general settings
2
- name: test_DAT_L_x3
3
- model_type: SRModel
4
- scale: 3
5
- num_gpu: 1
6
- manual_seed: 10
7
-
8
- datasets:
9
- test_1: # the 1st test dataset
10
- task: SR
11
- name: Set5
12
- type: PairedImageDataset
13
- dataroot_gt: datasets/benchmark/Set5/HR
14
- dataroot_lq: datasets/benchmark/Set5/LR_bicubic/X3
15
- filename_tmpl: '{}x3'
16
- io_backend:
17
- type: disk
18
-
19
- test_2: # the 2st test dataset
20
- task: SR
21
- name: Set14
22
- type: PairedImageDataset
23
- dataroot_gt: datasets/benchmark/Set14/HR
24
- dataroot_lq: datasets/benchmark/Set14/LR_bicubic/X3
25
- filename_tmpl: '{}x3'
26
- io_backend:
27
- type: disk
28
-
29
- test_3: # the 3st test dataset
30
- task: SR
31
- name: B100
32
- type: PairedImageDataset
33
- dataroot_gt: datasets/benchmark/B100/HR
34
- dataroot_lq: datasets/benchmark/B100/LR_bicubic/X3
35
- filename_tmpl: '{}x3'
36
- io_backend:
37
- type: disk
38
-
39
- test_4: # the 4st test dataset
40
- task: SR
41
- name: Urban100
42
- type: PairedImageDataset
43
- dataroot_gt: datasets/benchmark/Urban100/HR
44
- dataroot_lq: datasets/benchmark/Urban100/LR_bicubic/X3
45
- filename_tmpl: '{}x3'
46
- io_backend:
47
- type: disk
48
-
49
- test_5: # the 5st test dataset
50
- task: SR
51
- name: Manga109
52
- type: PairedImageDataset
53
- dataroot_gt: datasets/benchmark/Manga109/HR
54
- dataroot_lq: datasets/benchmark/Manga109/LR_bicubic/X3
55
- filename_tmpl: '{}_LRBI_x3'
56
- io_backend:
57
- type: disk
58
-
59
- # network structures
60
- network_g:
61
- type: DAT
62
- upscale: 3
63
- in_chans: 3
64
- img_size: 64
65
- img_range: 1.
66
- split_size: [8,32]
67
- depth: [6,6,6,6,6,6]
68
- embed_dim: 180
69
- num_heads: [6,6,6,6,6,6]
70
- expansion_factor: 4
71
- resi_connection: '1conv'
72
-
73
- # path
74
- path:
75
- pretrain_network_g: experiments/pretrained_models/DAT/DAT_L_x3.pth
76
- strict_load_g: True
77
-
78
- # validation settings
79
- val:
80
- save_img: False
81
- suffix: ~ # add suffix to saved images, if None, use exp name
82
- use_chop: False
83
-
84
- metrics:
85
- psnr: # metric name, can be arbitrary
86
- type: calculate_psnr
87
- crop_border: 3
88
- test_y_channel: True
89
- ssim:
90
- type: calculate_ssim
91
- crop_border: 3
92
- test_y_channel: True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
options/Test/test_DAT_L_x4.yml DELETED
@@ -1,93 +0,0 @@
1
- # general settings
2
- name: test_DAT_L_x4
3
- model_type: SRModel
4
- scale: 4
5
- num_gpu: 1
6
- manual_seed: 10
7
-
8
- datasets:
9
- test_1: # the 1st test dataset
10
- task: SR
11
- name: Set5
12
- type: PairedImageDataset
13
- dataroot_gt: datasets/benchmark/Set5/HR
14
- dataroot_lq: datasets/benchmark/Set5/LR_bicubic/X4
15
- filename_tmpl: '{}x4'
16
- io_backend:
17
- type: disk
18
-
19
- test_2: # the 2st test dataset
20
- task: SR
21
- name: Set14
22
- type: PairedImageDataset
23
- dataroot_gt: datasets/benchmark/Set14/HR
24
- dataroot_lq: datasets/benchmark/Set14/LR_bicubic/X4
25
- filename_tmpl: '{}x4'
26
- io_backend:
27
- type: disk
28
-
29
- test_3: # the 3st test dataset
30
- task: SR
31
- name: B100
32
- type: PairedImageDataset
33
- dataroot_gt: datasets/benchmark/B100/HR
34
- dataroot_lq: datasets/benchmark/B100/LR_bicubic/X4
35
- filename_tmpl: '{}x4'
36
- io_backend:
37
- type: disk
38
-
39
- test_4: # the 4st test dataset
40
- task: SR
41
- name: Urban100
42
- type: PairedImageDataset
43
- dataroot_gt: datasets/benchmark/Urban100/HR
44
- dataroot_lq: datasets/benchmark/Urban100/LR_bicubic/X4
45
- filename_tmpl: '{}x4'
46
- io_backend:
47
- type: disk
48
-
49
- test_5: # the 5st test dataset
50
- task: SR
51
- name: Manga109
52
- type: PairedImageDataset
53
- dataroot_gt: datasets/benchmark/Manga109/HR
54
- dataroot_lq: datasets/benchmark/Manga109/LR_bicubic/X4
55
- filename_tmpl: '{}_LRBI_x4'
56
- io_backend:
57
- type: disk
58
-
59
-
60
- # network structures
61
- network_g:
62
- type: DAT
63
- upscale: 4
64
- in_chans: 3
65
- img_size: 64
66
- img_range: 1.
67
- split_size: [8,32]
68
- depth: [6,6,6,6,6,6]
69
- embed_dim: 180
70
- num_heads: [6,6,6,6,6,6]
71
- expansion_factor: 4
72
- resi_connection: '1conv'
73
-
74
- # path
75
- path:
76
- pretrain_network_g: experiments/pretrained_models/DAT/DAT_L_x4.pth
77
- strict_load_g: True
78
-
79
- # validation settings
80
- val:
81
- save_img: False
82
- suffix: ~ # add suffix to saved images, if None, use exp name
83
- use_chop: False
84
-
85
- metrics:
86
- psnr: # metric name, can be arbitrary
87
- type: calculate_psnr
88
- crop_border: 4
89
- test_y_channel: True
90
- ssim:
91
- type: calculate_ssim
92
- crop_border: 4
93
- test_y_channel: True