zhengchen1999 / CAT

PyTorch code for our NeurIPS 2022 paper "Cross Aggregation Transformer for Image Restoration"
Apache License 2.0
116 stars 8 forks source link

No photos in "visualization/" folder #3

Closed hyz1433376288 closed 1 year ago

hyz1433376288 commented 1 year ago

It seems I have run the test cases python basicsr/test.py -opt options/test/test_CAT_R_sr_x2.yml successfully, and the log file has been printed, but no any photos produced in visualization/ folder, please tell me what did I ignore?

2023-01-26 13:58:56,778 INFO: Dataset [PairedImageDataset] - Set5 is built. 2023-01-26 13:58:56,778 INFO: Number of test images in Set5: 5 2023-01-26 13:58:56,779 INFO: Dataset [PairedImageDataset] - Set14 is built. 2023-01-26 13:58:56,779 INFO: Number of test images in Set14: 14 2023-01-26 13:58:56,784 INFO: Dataset [PairedImageDataset] - B100 is built. 2023-01-26 13:58:56,784 INFO: Number of test images in B100: 100 2023-01-26 13:58:56,788 INFO: Dataset [PairedImageDataset] - Urban100 is built. 2023-01-26 13:58:56,788 INFO: Number of test images in Urban100: 100 2023-01-26 13:58:56,792 INFO: Dataset [PairedImageDataset] - Manga109 is built. 2023-01-26 13:58:56,793 INFO: Number of test images in Manga109: 109 2023-01-26 13:59:05,069 INFO: Network [CAT] is created. 2023-01-26 13:59:06,139 INFO: Network: CAT, with parameters: 16,456,103 2023-01-26 13:59:06,139 INFO: CAT( (conv_first): Conv2d(3, 180, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (before_RG): Sequential( (0): Rearrange('b c h w -> b (h w) c') (1): LayerNorm((180,), eps=1e-05, elementwise_affine=True) ) (layers): ModuleList( (0): ResidualGroup( (blocks): ModuleList( (0): CATB_regular( (qkv): Linear(in_features=180, out_features=540, bias=True) (norm1): LayerNorm((180,), eps=1e-05, elementwise_affine=True) (proj): Linear(in_features=180, out_features=180, bias=True) (proj_drop): Dropout(p=0.0, inplace=False) (attns): ModuleList( (0): Attention_regular( (pos): DynamicPosBias( (pos_proj): Linear(in_features=2, out_features=5, bias=True) (pos1): Sequential( (0): LayerNorm((5,), eps=1e-05, elementwise_affine=True) (1): ReLU(inplace=True) (2): Linear(in_features=5, out_features=5, bias=True) ) (pos2): Sequential( (0): LayerNorm((5,), eps=1e-05, elementwise_affine=True) (1): ReLU(inplace=True) (2): Linear(in_features=5, out_features=5, bias=True) ) (pos3): Sequential( (0): LayerNorm((5,), eps=1e-05, elementwise_affine=True) (1): ReLU(inplace=True) (2): Linear(in_features=5, out_features=3, bias=True) ) ) (attn_drop): Dropout(p=0.0, inplace=False) )

balabala

2023-01-26 13:59:06,253 INFO: Loading CAT model from experiments/pretrained_models/CAT-R/SR_CAT_R_x2.pth, with param key: [params]. 2023-01-26 13:59:06,760 INFO: Model [CATModle] is created. 2023-01-26 13:59:06,760 INFO: Testing Set5... 2023-01-26 13:59:12,266 INFO: Validation Set5

psnr: 38.4842 Best: 38.4842 @ test_SR_CAT_R_x2 iter

ssim: 0.9625 Best: 0.9625 @ test_SR_CAT_R_x2 iter

2023-01-26 13:59:12,266 INFO: Testing Set14... 2023-01-26 13:59:49,710 INFO: Validation Set14

psnr: 34.5318 Best: 34.5318 @ test_SR_CAT_R_x2 iter

ssim: 0.9251 Best: 0.9251 @ test_SR_CAT_R_x2 iter

2023-01-26 13:59:49,711 INFO: Testing B100... 2023-01-26 14:12:33,141 INFO: Validation B100

psnr: 32.5637 Best: 32.5637 @ test_SR_CAT_R_x2 iter

ssim: 0.9045 Best: 0.9045 @ test_SR_CAT_R_x2 iter

2023-01-26 14:12:33,142 INFO: Testing Urban100... 2023-01-26 14:33:04,764 INFO: Validation Urban100

psnr: 34.0840 Best: 34.0840 @ test_SR_CAT_R_x2 iter

ssim: 0.9443 Best: 0.9443 @ test_SR_CAT_R_x2 iter

2023-01-26 14:33:04,765 INFO: Testing Manga109... 2023-01-26 14:47:55,729 INFO: Validation Manga109

psnr: 40.0888 Best: 40.0888 @ test_SR_CAT_R_x2 iter

ssim: 0.9804 Best: 0.9804 @ test_SR_CAT_R_x2 iter

zhengchen1999 commented 1 year ago

Hi. If you want to save the resulting images, you need to modify the corresponding testing YML save_img as True:

val:
  save_img: True # False
  suffix: ~  # add suffix to saved images, if None, use exp name
  use_chop: False

If you have any other problem, please let us know. Thanks.

hyz1433376288 commented 1 year ago

Hi. If you want to save the resulting images, you need to modify the corresponding testing YML save_img as True:

val:
  save_img: True # False
  suffix: ~  # add suffix to saved images, if None, use exp name
  use_chop: False

If you have any other problem, please let us know. Thanks.

Thanks to your timely prompt, I have got the output images, nice performance. Thank you!