├── .gitignore ├── LICENSE ├── README.md ├── augmentation.py ├── data ├── BSD100 │ ├── img_001.png │ ├── img_002.png │ ├── img_003.png │ ├── img_004.png │ ├── img_005.png │ ├── img_006.png │ ├── img_007.png │ ├── img_008.png │ ├── img_009.png │ ├── img_010.png │ ├── img_011.png │ ├── img_012.png │ ├── img_013.png │ ├── img_014.png │ ├── img_015.png │ ├── img_016.png │ ├── img_017.png │ ├── img_018.png │ ├── img_019.png │ ├── img_020.png │ ├── img_021.png │ ├── img_022.png │ ├── img_023.png │ ├── img_024.png │ ├── img_025.png │ ├── img_026.png │ ├── img_027.png │ ├── img_028.png │ ├── img_029.png │ ├── img_030.png │ ├── img_031.png │ ├── img_032.png │ ├── img_033.png │ ├── img_034.png │ ├── img_035.png │ ├── img_036.png │ ├── img_037.png │ ├── img_038.png │ ├── img_039.png │ ├── img_040.png │ ├── img_041.png │ ├── img_042.png │ ├── img_043.png │ ├── img_044.png │ ├── img_045.png │ ├── img_046.png │ ├── img_047.png │ ├── img_048.png │ ├── img_049.png │ ├── img_050.png │ ├── img_051.png │ ├── img_052.png │ ├── img_053.png │ ├── img_054.png │ ├── img_055.png │ ├── img_056.png │ ├── img_057.png │ ├── img_058.png │ ├── img_059.png │ ├── img_060.png │ ├── img_061.png │ ├── img_062.png │ ├── img_063.png │ ├── img_064.png │ ├── img_065.png │ ├── img_066.png │ ├── img_067.png │ ├── img_068.png │ ├── img_069.png │ ├── img_070.png │ ├── img_071.png │ ├── img_072.png │ ├── img_073.png │ ├── img_074.png │ ├── img_075.png │ ├── img_076.png │ ├── img_077.png │ ├── img_078.png │ ├── img_079.png │ ├── img_080.png │ ├── img_081.png │ ├── img_082.png │ ├── img_083.png │ ├── img_084.png │ ├── img_085.png │ ├── img_086.png │ ├── img_087.png │ ├── img_088.png │ ├── img_089.png │ ├── img_090.png │ ├── img_091.png │ ├── img_092.png │ ├── img_093.png │ ├── img_094.png │ ├── img_095.png │ ├── img_096.png │ ├── img_097.png │ ├── img_098.png │ ├── img_099.png │ └── img_100.png ├── ScSR │ ├── t1.bmp │ ├── t10.bmp │ ├── t11.bmp │ ├── t12.bmp │ ├── t13.bmp │ ├── t14.bmp │ ├── t15.bmp │ ├── t16.bmp │ ├── t17.bmp │ ├── t18.bmp │ ├── t19.bmp │ ├── t2.bmp │ ├── t20.bmp │ ├── t21.bmp │ ├── t22.bmp │ ├── t23.bmp │ ├── t24.bmp │ ├── t25.bmp │ ├── t26.bmp │ ├── t27.bmp │ ├── t28.bmp │ ├── t29.bmp │ ├── t3.bmp │ ├── t30.bmp │ ├── t31.bmp │ ├── t32.bmp │ ├── t33.bmp │ ├── t34.bmp │ ├── t35.bmp │ ├── t36.bmp │ ├── t37.bmp │ ├── t38.bmp │ ├── t39.bmp │ ├── t4.bmp │ ├── t40.bmp │ ├── t42.bmp │ ├── t43.bmp │ ├── t44.bmp │ ├── t45.bmp │ ├── t46.bmp │ ├── t47.bmp │ ├── t48.bmp │ ├── t49.bmp │ ├── t5.bmp │ ├── t50.bmp │ ├── t51.bmp │ ├── t52.bmp │ ├── t53.bmp │ ├── t54.bmp │ ├── t55.bmp │ ├── t56.bmp │ ├── t57.bmp │ ├── t58.bmp │ ├── t59.bmp │ ├── t6.bmp │ ├── t60.bmp │ ├── t61.bmp │ ├── t62.bmp │ ├── t63.bmp │ ├── t64.bmp │ ├── t65.bmp │ ├── t66.bmp │ ├── t7.bmp │ ├── t8.bmp │ ├── t9.bmp │ ├── tt1.bmp │ ├── tt10.bmp │ ├── tt12.bmp │ ├── tt13.bmp │ ├── tt14.bmp │ ├── tt15.bmp │ ├── tt16.bmp │ ├── tt17.bmp │ ├── tt18.bmp │ ├── tt19.bmp │ ├── tt2.bmp │ ├── tt20.bmp │ ├── tt21.bmp │ ├── tt22.bmp │ ├── tt23.bmp │ ├── tt24.bmp │ ├── tt25.bmp │ ├── tt26.bmp │ ├── tt27.bmp │ ├── tt3.bmp │ ├── tt4.bmp │ ├── tt5.bmp │ ├── tt6.bmp │ ├── tt7.bmp │ ├── tt8.bmp │ └── tt9.bmp ├── Set14 │ ├── img_001.png │ ├── img_002.png │ ├── img_003.png │ ├── img_004.png │ ├── img_005.png │ ├── img_006.png │ ├── img_007.png │ ├── img_008.png │ ├── img_009.png │ ├── img_010.png │ ├── img_011.png │ ├── img_012.png │ ├── img_013.png │ └── img_014.png ├── Set5 │ ├── img_001.png │ ├── img_002.png │ ├── img_003.png │ ├── img_004.png │ └── img_005.png └── Urban100 │ ├── img_001.png │ ├── img_002.png │ ├── img_003.png │ ├── img_004.png │ ├── img_005.png │ ├── img_006.png │ ├── img_007.png │ ├── img_008.png │ ├── img_009.png │ ├── img_010.png │ ├── img_011.png │ ├── img_012.png │ ├── img_013.png │ ├── img_014.png │ ├── img_015.png │ ├── img_016.png │ ├── img_017.png │ ├── img_018.png │ ├── img_019.png │ ├── img_020.png │ ├── img_021.png │ ├── img_022.png │ ├── img_023.png │ ├── img_024.png │ ├── img_025.png │ ├── img_026.png │ ├── img_027.png │ ├── img_028.png │ ├── img_029.png │ ├── img_030.png │ ├── img_031.png │ ├── img_032.png │ ├── img_033.png │ ├── img_034.png │ ├── img_035.png │ ├── img_036.png │ ├── img_037.png │ ├── img_038.png │ ├── img_039.png │ ├── img_040.png │ ├── img_041.png │ ├── img_042.png │ ├── img_043.png │ ├── img_044.png │ ├── img_045.png │ ├── img_046.png │ ├── img_047.png │ ├── img_048.png │ ├── img_049.png │ ├── img_050.png │ ├── img_051.png │ ├── img_052.png │ ├── img_053.png │ ├── img_054.png │ ├── img_055.png │ ├── img_056.png │ ├── img_057.png │ ├── img_058.png │ ├── img_059.png │ ├── img_060.png │ ├── img_061.png │ ├── img_062.png │ ├── img_063.png │ ├── img_064.png │ ├── img_065.png │ ├── img_066.png │ ├── img_067.png │ ├── img_068.png │ ├── img_069.png │ ├── img_070.png │ ├── img_071.png │ ├── img_072.png │ ├── img_073.png │ ├── img_074.png │ ├── img_075.png │ ├── img_076.png │ ├── img_077.png │ ├── img_078.png │ ├── img_079.png │ ├── img_080.png │ ├── img_081.png │ ├── img_082.png │ ├── img_083.png │ ├── img_084.png │ ├── img_085.png │ ├── img_086.png │ ├── img_087.png │ ├── img_088.png │ ├── img_089.png │ ├── img_090.png │ ├── img_091.png │ ├── img_092.png │ ├── img_093.png │ ├── img_094.png │ ├── img_095.png │ ├── img_096.png │ ├── img_097.png │ ├── img_098.png │ ├── img_099.png │ └── img_100.png ├── documents ├── comp.png ├── figure1.png ├── figure3.png ├── img1.png ├── img2.png ├── img_013_SRF_2_HR.png ├── img_013_SRF_2_SRCNN.png ├── img_013_SRF_2_bicubic.png ├── img_013_SRF_2_nearest.png ├── model.png └── network_graph2.png ├── main.py ├── model ├── model_F96_D9_LR0.001000.ckpt.data-00000-of-00001 ├── model_F96_D9_LR0.001000.ckpt.index └── model_F96_D9_LR0.001000.ckpt.meta ├── super_resolution.py ├── super_resolution_utilty.py └── test.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | **/.DS_Store 3 | output/ 4 | cache/ 5 | tf_log/ 6 | data/ScSR2/ 7 | data/yang_general/ 8 | data/yang_general4/ 9 | \.idea/ 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # deeply-recursive-cnn-tf 2 | 3 | ## overview 4 | This project is a test implementation of ["Deeply-Recursive Convolutional Network for Image Super-Resolution", CVPR2016](http://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Kim_Deeply-Recursive_Convolutional_Network_CVPR_2016_paper.pdf) using tensorflow 5 | 6 | 7 | Paper: ["Deeply-Recursive Convolutional Network for Image Super-Resolution"] (https://arxiv.org/abs/1511.04491) by Jiwon Kim, Jung Kwon Lee and Kyoung Mu Lee Department of ECE, ASRI, Seoul National University, Korea 8 | 9 | 10 | Training highly deep CNN layers is so hard. However this paper makes it with some tricks like sharing filter weights and using intermediate outputs to suppress divergence in training. The model in the paper contains 20 CNN layers without no any max-pooling layers, I feel it's amazing. 11 | 12 | 13 | 🔴 I also build another SR model. It is faster and has better PSNR results. Please try this project also. [https://github.com/jiny2001/dcscn-super-resolution](https://github.com/jiny2001/dcscn-super-resolution) 🔴 14 | 15 | ## model structure 16 | 17 | Those figures are from the paper. There are 3 different networks which cooperates to make images fine. 18 | 19 | ![alt tag](https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/master/documents/figure1.png) 20 | 21 | ![alt tag](https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/master/documents/figure3.png) 22 | 23 | This model below is made by my code and drawn by tensorboard. 24 | 25 | ![alt tag](https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/master/documents/model.png) 26 | ![alt tag](https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/master/documents/network_graph2.png) 27 | 28 | 29 | ## requirements 30 | 31 | tensorflow, scipy, numpy and pillow 32 | 33 | 34 | ## how to use 35 | 36 | ``` 37 | # train with default parameters and evaluate after training for Set5 (takes some hours to train with moderate-GPU) 38 | python main.py 39 | 40 | # training with simple model (will be good without GPU) 41 | python main.py —-end_lr 1e-4 —-feature_num 32 -—inference_depth 5 42 | 43 | # evaluation for set14 only (after training has done) 44 | # [set5, set14, bsd100, urban100, all] are available. Please specify same model parameter with training. 45 | python main.py -—dataset set14 --is_training False —-feature_num 32 -—inference_depth 5 46 | 47 | # train for x4 scale images 48 | python main.py —scale 4 49 | ``` 50 | 51 | ``` 52 | # build augmented (right-left and up-down flipped) training set on SCSR2 folder 53 | python augmentation.py 54 | 55 | # train with augmented training data (will have a little better PSNR) 56 | python main.py --training_set ScSR2 57 | 58 | # train with your own training data (create directory under "data" and put your data files into it) 59 | python main.py --training_set your_data_directory_name 60 | ``` 61 | 62 | 63 | Network graphs and weights / loss summaries are saved in **tf_log** directory. 64 | 65 | Weights are saved in **model** directory. 66 | 67 | 68 | ## result of my implementation 69 | 70 | I use half num of features (128) to make training faster for those results below. Please check with original (100%) image size. (The results I got have a little less PSNR compared to their paper). 71 | 72 | ![alt tag](https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/master/documents/comp.png) 73 | 74 | | DataSet | Bicubic | SRCN | SelfEx | My Result | DRCN | 75 | |:-------:|:-------:|:----:|:----:|:----:|:----:| 76 | |Set5 x2|33.66|36.66|36.49|37.31|37.63| 77 | |Set14 x2|30.24|32.42|32.22|32.85|33.04| 78 | |BSD100 x2|29.56|31.36|31.18|31.71|31.85| 79 | |Urban100 x2|26.88|29.50|29.54|30.01|30.75| 80 | 81 | I include learned weights for default parameters. 82 | default (features:96, inference layers depth:9) with larger dataset (ynag91+general100)x4 augmented. 83 | 84 | You can output up-converted images to evaluate. Run below and check [output] folder. 85 | 86 | ``` 87 | # evaluating for [set5, set14, bsd100, urban100, all] is available 88 | python main.py -—dataset set14 --is_training False 89 | ``` 90 | 91 | ## apply to your own image 92 | 93 | Put your image file under my project directory and then try those commands below. 94 | Please note if you trained with your own parameters like "python3 main.py --inference_depth 5 --feature_num 64", you should use same parameters for test.py. 95 | 96 | ``` 97 | python test.py --file your_image_filename 98 | 99 | #try with your trained model 100 | python test.py --file your_image_filename --same_args_which_you_used_on_your_training blabla 101 | ``` 102 | 103 | ## datasets 104 | 105 | Some popular dataset images are already set in **data** folder. 106 | 107 | for training: 108 | + ScSR [[ Yang et al. TIP 2010 ]](http://www.ifp.illinois.edu/%7Ejyang29/ScSR.htm) 109 | ( J. Yang, J. Wright, T. S. Huang, and Y. Ma. Image super- resolution via sparse representation. TIP, 2010 ) 110 | 111 | for evaluation: 112 | + Set5 [[ Bevilacqua et al. BMVC 2012 ]] (http://people.rennes.inria.fr/Aline.Roumy/results/SR_BMVC12.html) 113 | + Set14 [[ Zeyde et al. LNCS 2010 ]] (https://sites.google.com/site/romanzeyde/research-interests) 114 | + BSD100 [[ Huang et al. CVPR 2015 ]] (https://sites.google.com/site/jbhuang0604/publications/struct_sr) (only x2 images in this project) 115 | + Urban100 [[ Martin et al. ICCV 2001 ]] (https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/bsds/) (only x2 images in this project) 116 | 117 | 118 | ## disclaimer 119 | 120 | Some details are not shown in the paper and my guesses maybe not enough. My code's PSNR are about 0.5-1.0 lesser than paper's experiments results. 121 | 122 | ## acknowledgments 123 | 124 | Thanks a lot for Assoc. Prof. **Masayuki Tanaka** at Tokyo Institute of Technology and **Shigesumi Kuwashima** at Viewplus inc. 125 | -------------------------------------------------------------------------------- /augmentation.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | # 3 | # super resolution from 4 | # http://www.cv-foundation.org/openaccess/content_cvpr_2016/html/Kim_Deeply-Recursive_Convolutional_Network_CVPR_2016_paper.html 5 | # 6 | 7 | import os 8 | import numpy as np 9 | 10 | 11 | import super_resolution_utilty as util 12 | 13 | print("Data Augmentation For Training Data") 14 | 15 | training_filenames = util.get_files_in_directory("data/ScSR/") 16 | augmented_directory ="data/ScSR2/" 17 | util.make_dir(augmented_directory) 18 | 19 | for file_path in training_filenames: 20 | org_image = util.load_image(file_path) 21 | 22 | _, filename = os.path.split(file_path) 23 | filename, extension = os.path.splitext(filename) 24 | 25 | util.save_image(augmented_directory+filename + extension, org_image) 26 | ud_image = np.flipud(org_image) 27 | util.save_image(augmented_directory+filename + "_v" + extension, ud_image) 28 | lr_image = np.fliplr(org_image) 29 | util.save_image(augmented_directory+filename + "_h" + extension, lr_image) 30 | lrud_image = np.flipud(lr_image) 31 | util.save_image(augmented_directory+filename + "_hv" + extension, lrud_image) 32 | 33 | print("\nFinished.") 34 | -------------------------------------------------------------------------------- /data/BSD100/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_001.png -------------------------------------------------------------------------------- /data/BSD100/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_002.png -------------------------------------------------------------------------------- /data/BSD100/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_003.png -------------------------------------------------------------------------------- /data/BSD100/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_004.png -------------------------------------------------------------------------------- /data/BSD100/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_005.png -------------------------------------------------------------------------------- /data/BSD100/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_006.png -------------------------------------------------------------------------------- /data/BSD100/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_007.png -------------------------------------------------------------------------------- /data/BSD100/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_008.png -------------------------------------------------------------------------------- /data/BSD100/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_009.png -------------------------------------------------------------------------------- /data/BSD100/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_010.png -------------------------------------------------------------------------------- /data/BSD100/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_011.png -------------------------------------------------------------------------------- /data/BSD100/img_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_012.png -------------------------------------------------------------------------------- /data/BSD100/img_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_013.png -------------------------------------------------------------------------------- /data/BSD100/img_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_014.png -------------------------------------------------------------------------------- /data/BSD100/img_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_015.png -------------------------------------------------------------------------------- /data/BSD100/img_016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_016.png -------------------------------------------------------------------------------- /data/BSD100/img_017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_017.png -------------------------------------------------------------------------------- /data/BSD100/img_018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_018.png -------------------------------------------------------------------------------- /data/BSD100/img_019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_019.png -------------------------------------------------------------------------------- /data/BSD100/img_020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_020.png -------------------------------------------------------------------------------- /data/BSD100/img_021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_021.png -------------------------------------------------------------------------------- /data/BSD100/img_022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_022.png -------------------------------------------------------------------------------- /data/BSD100/img_023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_023.png -------------------------------------------------------------------------------- /data/BSD100/img_024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_024.png -------------------------------------------------------------------------------- /data/BSD100/img_025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_025.png -------------------------------------------------------------------------------- /data/BSD100/img_026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_026.png -------------------------------------------------------------------------------- /data/BSD100/img_027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_027.png -------------------------------------------------------------------------------- /data/BSD100/img_028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_028.png -------------------------------------------------------------------------------- /data/BSD100/img_029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_029.png -------------------------------------------------------------------------------- /data/BSD100/img_030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_030.png -------------------------------------------------------------------------------- /data/BSD100/img_031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_031.png -------------------------------------------------------------------------------- /data/BSD100/img_032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_032.png -------------------------------------------------------------------------------- /data/BSD100/img_033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_033.png -------------------------------------------------------------------------------- /data/BSD100/img_034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_034.png -------------------------------------------------------------------------------- /data/BSD100/img_035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_035.png -------------------------------------------------------------------------------- /data/BSD100/img_036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_036.png -------------------------------------------------------------------------------- /data/BSD100/img_037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_037.png -------------------------------------------------------------------------------- /data/BSD100/img_038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_038.png -------------------------------------------------------------------------------- /data/BSD100/img_039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_039.png -------------------------------------------------------------------------------- /data/BSD100/img_040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_040.png -------------------------------------------------------------------------------- /data/BSD100/img_041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_041.png -------------------------------------------------------------------------------- /data/BSD100/img_042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_042.png -------------------------------------------------------------------------------- /data/BSD100/img_043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_043.png -------------------------------------------------------------------------------- /data/BSD100/img_044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_044.png -------------------------------------------------------------------------------- /data/BSD100/img_045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_045.png -------------------------------------------------------------------------------- /data/BSD100/img_046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_046.png -------------------------------------------------------------------------------- /data/BSD100/img_047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_047.png -------------------------------------------------------------------------------- /data/BSD100/img_048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_048.png -------------------------------------------------------------------------------- /data/BSD100/img_049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_049.png -------------------------------------------------------------------------------- /data/BSD100/img_050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_050.png -------------------------------------------------------------------------------- /data/BSD100/img_051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_051.png -------------------------------------------------------------------------------- /data/BSD100/img_052.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_052.png -------------------------------------------------------------------------------- /data/BSD100/img_053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_053.png -------------------------------------------------------------------------------- /data/BSD100/img_054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_054.png -------------------------------------------------------------------------------- /data/BSD100/img_055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_055.png -------------------------------------------------------------------------------- /data/BSD100/img_056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_056.png -------------------------------------------------------------------------------- /data/BSD100/img_057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_057.png -------------------------------------------------------------------------------- /data/BSD100/img_058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_058.png -------------------------------------------------------------------------------- /data/BSD100/img_059.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_059.png -------------------------------------------------------------------------------- /data/BSD100/img_060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_060.png -------------------------------------------------------------------------------- /data/BSD100/img_061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_061.png -------------------------------------------------------------------------------- /data/BSD100/img_062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_062.png -------------------------------------------------------------------------------- /data/BSD100/img_063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_063.png -------------------------------------------------------------------------------- /data/BSD100/img_064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_064.png -------------------------------------------------------------------------------- /data/BSD100/img_065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_065.png -------------------------------------------------------------------------------- /data/BSD100/img_066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_066.png -------------------------------------------------------------------------------- /data/BSD100/img_067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_067.png -------------------------------------------------------------------------------- /data/BSD100/img_068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_068.png -------------------------------------------------------------------------------- /data/BSD100/img_069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_069.png -------------------------------------------------------------------------------- /data/BSD100/img_070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_070.png -------------------------------------------------------------------------------- /data/BSD100/img_071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_071.png -------------------------------------------------------------------------------- /data/BSD100/img_072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_072.png -------------------------------------------------------------------------------- /data/BSD100/img_073.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_073.png -------------------------------------------------------------------------------- /data/BSD100/img_074.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_074.png -------------------------------------------------------------------------------- /data/BSD100/img_075.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_075.png -------------------------------------------------------------------------------- /data/BSD100/img_076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_076.png -------------------------------------------------------------------------------- /data/BSD100/img_077.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_077.png -------------------------------------------------------------------------------- /data/BSD100/img_078.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_078.png -------------------------------------------------------------------------------- /data/BSD100/img_079.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_079.png -------------------------------------------------------------------------------- /data/BSD100/img_080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_080.png -------------------------------------------------------------------------------- /data/BSD100/img_081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_081.png -------------------------------------------------------------------------------- /data/BSD100/img_082.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_082.png -------------------------------------------------------------------------------- /data/BSD100/img_083.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_083.png -------------------------------------------------------------------------------- /data/BSD100/img_084.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_084.png -------------------------------------------------------------------------------- /data/BSD100/img_085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_085.png -------------------------------------------------------------------------------- /data/BSD100/img_086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_086.png -------------------------------------------------------------------------------- /data/BSD100/img_087.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_087.png -------------------------------------------------------------------------------- /data/BSD100/img_088.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_088.png -------------------------------------------------------------------------------- /data/BSD100/img_089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_089.png -------------------------------------------------------------------------------- /data/BSD100/img_090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_090.png -------------------------------------------------------------------------------- /data/BSD100/img_091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_091.png -------------------------------------------------------------------------------- /data/BSD100/img_092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_092.png -------------------------------------------------------------------------------- /data/BSD100/img_093.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_093.png -------------------------------------------------------------------------------- /data/BSD100/img_094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_094.png -------------------------------------------------------------------------------- /data/BSD100/img_095.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_095.png -------------------------------------------------------------------------------- /data/BSD100/img_096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_096.png -------------------------------------------------------------------------------- /data/BSD100/img_097.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_097.png -------------------------------------------------------------------------------- /data/BSD100/img_098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_098.png -------------------------------------------------------------------------------- /data/BSD100/img_099.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_099.png -------------------------------------------------------------------------------- /data/BSD100/img_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/BSD100/img_100.png -------------------------------------------------------------------------------- /data/ScSR/t1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t1.bmp -------------------------------------------------------------------------------- /data/ScSR/t10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t10.bmp -------------------------------------------------------------------------------- /data/ScSR/t11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t11.bmp -------------------------------------------------------------------------------- /data/ScSR/t12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t12.bmp -------------------------------------------------------------------------------- /data/ScSR/t13.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t13.bmp -------------------------------------------------------------------------------- /data/ScSR/t14.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t14.bmp -------------------------------------------------------------------------------- /data/ScSR/t15.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t15.bmp -------------------------------------------------------------------------------- /data/ScSR/t16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t16.bmp -------------------------------------------------------------------------------- /data/ScSR/t17.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t17.bmp -------------------------------------------------------------------------------- /data/ScSR/t18.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t18.bmp -------------------------------------------------------------------------------- /data/ScSR/t19.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t19.bmp -------------------------------------------------------------------------------- /data/ScSR/t2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t2.bmp -------------------------------------------------------------------------------- /data/ScSR/t20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t20.bmp -------------------------------------------------------------------------------- /data/ScSR/t21.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t21.bmp -------------------------------------------------------------------------------- /data/ScSR/t22.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t22.bmp -------------------------------------------------------------------------------- /data/ScSR/t23.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t23.bmp -------------------------------------------------------------------------------- /data/ScSR/t24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t24.bmp -------------------------------------------------------------------------------- /data/ScSR/t25.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t25.bmp -------------------------------------------------------------------------------- /data/ScSR/t26.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t26.bmp -------------------------------------------------------------------------------- /data/ScSR/t27.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t27.bmp -------------------------------------------------------------------------------- /data/ScSR/t28.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t28.bmp -------------------------------------------------------------------------------- /data/ScSR/t29.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t29.bmp -------------------------------------------------------------------------------- /data/ScSR/t3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t3.bmp -------------------------------------------------------------------------------- /data/ScSR/t30.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t30.bmp -------------------------------------------------------------------------------- /data/ScSR/t31.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t31.bmp -------------------------------------------------------------------------------- /data/ScSR/t32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t32.bmp -------------------------------------------------------------------------------- /data/ScSR/t33.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t33.bmp -------------------------------------------------------------------------------- /data/ScSR/t34.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t34.bmp -------------------------------------------------------------------------------- /data/ScSR/t35.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t35.bmp -------------------------------------------------------------------------------- /data/ScSR/t36.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t36.bmp -------------------------------------------------------------------------------- /data/ScSR/t37.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t37.bmp -------------------------------------------------------------------------------- /data/ScSR/t38.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t38.bmp -------------------------------------------------------------------------------- /data/ScSR/t39.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t39.bmp -------------------------------------------------------------------------------- /data/ScSR/t4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t4.bmp -------------------------------------------------------------------------------- /data/ScSR/t40.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t40.bmp -------------------------------------------------------------------------------- /data/ScSR/t42.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t42.bmp -------------------------------------------------------------------------------- /data/ScSR/t43.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t43.bmp -------------------------------------------------------------------------------- /data/ScSR/t44.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t44.bmp -------------------------------------------------------------------------------- /data/ScSR/t45.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t45.bmp -------------------------------------------------------------------------------- /data/ScSR/t46.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t46.bmp -------------------------------------------------------------------------------- /data/ScSR/t47.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t47.bmp -------------------------------------------------------------------------------- /data/ScSR/t48.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t48.bmp -------------------------------------------------------------------------------- /data/ScSR/t49.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t49.bmp -------------------------------------------------------------------------------- /data/ScSR/t5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t5.bmp -------------------------------------------------------------------------------- /data/ScSR/t50.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t50.bmp -------------------------------------------------------------------------------- /data/ScSR/t51.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t51.bmp -------------------------------------------------------------------------------- /data/ScSR/t52.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t52.bmp -------------------------------------------------------------------------------- /data/ScSR/t53.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t53.bmp -------------------------------------------------------------------------------- /data/ScSR/t54.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t54.bmp -------------------------------------------------------------------------------- /data/ScSR/t55.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t55.bmp -------------------------------------------------------------------------------- /data/ScSR/t56.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t56.bmp -------------------------------------------------------------------------------- /data/ScSR/t57.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t57.bmp -------------------------------------------------------------------------------- /data/ScSR/t58.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t58.bmp -------------------------------------------------------------------------------- /data/ScSR/t59.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t59.bmp -------------------------------------------------------------------------------- /data/ScSR/t6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t6.bmp -------------------------------------------------------------------------------- /data/ScSR/t60.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t60.bmp -------------------------------------------------------------------------------- /data/ScSR/t61.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t61.bmp -------------------------------------------------------------------------------- /data/ScSR/t62.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t62.bmp -------------------------------------------------------------------------------- /data/ScSR/t63.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t63.bmp -------------------------------------------------------------------------------- /data/ScSR/t64.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t64.bmp -------------------------------------------------------------------------------- /data/ScSR/t65.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t65.bmp -------------------------------------------------------------------------------- /data/ScSR/t66.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t66.bmp -------------------------------------------------------------------------------- /data/ScSR/t7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t7.bmp -------------------------------------------------------------------------------- /data/ScSR/t8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t8.bmp -------------------------------------------------------------------------------- /data/ScSR/t9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/t9.bmp -------------------------------------------------------------------------------- /data/ScSR/tt1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt1.bmp -------------------------------------------------------------------------------- /data/ScSR/tt10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt10.bmp -------------------------------------------------------------------------------- /data/ScSR/tt12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt12.bmp -------------------------------------------------------------------------------- /data/ScSR/tt13.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt13.bmp -------------------------------------------------------------------------------- /data/ScSR/tt14.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt14.bmp -------------------------------------------------------------------------------- /data/ScSR/tt15.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt15.bmp -------------------------------------------------------------------------------- /data/ScSR/tt16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt16.bmp -------------------------------------------------------------------------------- /data/ScSR/tt17.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt17.bmp -------------------------------------------------------------------------------- /data/ScSR/tt18.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt18.bmp -------------------------------------------------------------------------------- /data/ScSR/tt19.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt19.bmp -------------------------------------------------------------------------------- /data/ScSR/tt2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt2.bmp -------------------------------------------------------------------------------- /data/ScSR/tt20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt20.bmp -------------------------------------------------------------------------------- /data/ScSR/tt21.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt21.bmp -------------------------------------------------------------------------------- /data/ScSR/tt22.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt22.bmp -------------------------------------------------------------------------------- /data/ScSR/tt23.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt23.bmp -------------------------------------------------------------------------------- /data/ScSR/tt24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt24.bmp -------------------------------------------------------------------------------- /data/ScSR/tt25.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt25.bmp -------------------------------------------------------------------------------- /data/ScSR/tt26.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt26.bmp -------------------------------------------------------------------------------- /data/ScSR/tt27.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt27.bmp -------------------------------------------------------------------------------- /data/ScSR/tt3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt3.bmp -------------------------------------------------------------------------------- /data/ScSR/tt4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt4.bmp -------------------------------------------------------------------------------- /data/ScSR/tt5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt5.bmp -------------------------------------------------------------------------------- /data/ScSR/tt6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt6.bmp -------------------------------------------------------------------------------- /data/ScSR/tt7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt7.bmp -------------------------------------------------------------------------------- /data/ScSR/tt8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt8.bmp -------------------------------------------------------------------------------- /data/ScSR/tt9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/ScSR/tt9.bmp -------------------------------------------------------------------------------- /data/Set14/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_001.png -------------------------------------------------------------------------------- /data/Set14/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_002.png -------------------------------------------------------------------------------- /data/Set14/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_003.png -------------------------------------------------------------------------------- /data/Set14/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_004.png -------------------------------------------------------------------------------- /data/Set14/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_005.png -------------------------------------------------------------------------------- /data/Set14/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_006.png -------------------------------------------------------------------------------- /data/Set14/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_007.png -------------------------------------------------------------------------------- /data/Set14/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_008.png -------------------------------------------------------------------------------- /data/Set14/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_009.png -------------------------------------------------------------------------------- /data/Set14/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_010.png -------------------------------------------------------------------------------- /data/Set14/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_011.png -------------------------------------------------------------------------------- /data/Set14/img_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_012.png -------------------------------------------------------------------------------- /data/Set14/img_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_013.png -------------------------------------------------------------------------------- /data/Set14/img_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set14/img_014.png -------------------------------------------------------------------------------- /data/Set5/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set5/img_001.png -------------------------------------------------------------------------------- /data/Set5/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set5/img_002.png -------------------------------------------------------------------------------- /data/Set5/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set5/img_003.png -------------------------------------------------------------------------------- /data/Set5/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set5/img_004.png -------------------------------------------------------------------------------- /data/Set5/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Set5/img_005.png -------------------------------------------------------------------------------- /data/Urban100/img_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_001.png -------------------------------------------------------------------------------- /data/Urban100/img_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_002.png -------------------------------------------------------------------------------- /data/Urban100/img_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_003.png -------------------------------------------------------------------------------- /data/Urban100/img_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_004.png -------------------------------------------------------------------------------- /data/Urban100/img_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_005.png -------------------------------------------------------------------------------- /data/Urban100/img_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_006.png -------------------------------------------------------------------------------- /data/Urban100/img_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_007.png -------------------------------------------------------------------------------- /data/Urban100/img_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_008.png -------------------------------------------------------------------------------- /data/Urban100/img_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_009.png -------------------------------------------------------------------------------- /data/Urban100/img_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_010.png -------------------------------------------------------------------------------- /data/Urban100/img_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_011.png -------------------------------------------------------------------------------- /data/Urban100/img_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_012.png -------------------------------------------------------------------------------- /data/Urban100/img_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_013.png -------------------------------------------------------------------------------- /data/Urban100/img_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_014.png -------------------------------------------------------------------------------- /data/Urban100/img_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_015.png -------------------------------------------------------------------------------- /data/Urban100/img_016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_016.png -------------------------------------------------------------------------------- /data/Urban100/img_017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_017.png -------------------------------------------------------------------------------- /data/Urban100/img_018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_018.png -------------------------------------------------------------------------------- /data/Urban100/img_019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_019.png -------------------------------------------------------------------------------- /data/Urban100/img_020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_020.png -------------------------------------------------------------------------------- /data/Urban100/img_021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_021.png -------------------------------------------------------------------------------- /data/Urban100/img_022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_022.png -------------------------------------------------------------------------------- /data/Urban100/img_023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_023.png -------------------------------------------------------------------------------- /data/Urban100/img_024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_024.png -------------------------------------------------------------------------------- /data/Urban100/img_025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_025.png -------------------------------------------------------------------------------- /data/Urban100/img_026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_026.png -------------------------------------------------------------------------------- /data/Urban100/img_027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_027.png -------------------------------------------------------------------------------- /data/Urban100/img_028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_028.png -------------------------------------------------------------------------------- /data/Urban100/img_029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_029.png -------------------------------------------------------------------------------- /data/Urban100/img_030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_030.png -------------------------------------------------------------------------------- /data/Urban100/img_031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_031.png -------------------------------------------------------------------------------- /data/Urban100/img_032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_032.png -------------------------------------------------------------------------------- /data/Urban100/img_033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_033.png -------------------------------------------------------------------------------- /data/Urban100/img_034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_034.png -------------------------------------------------------------------------------- /data/Urban100/img_035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_035.png -------------------------------------------------------------------------------- /data/Urban100/img_036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_036.png -------------------------------------------------------------------------------- /data/Urban100/img_037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_037.png -------------------------------------------------------------------------------- /data/Urban100/img_038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_038.png -------------------------------------------------------------------------------- /data/Urban100/img_039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_039.png -------------------------------------------------------------------------------- /data/Urban100/img_040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_040.png -------------------------------------------------------------------------------- /data/Urban100/img_041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_041.png -------------------------------------------------------------------------------- /data/Urban100/img_042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_042.png -------------------------------------------------------------------------------- /data/Urban100/img_043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_043.png -------------------------------------------------------------------------------- /data/Urban100/img_044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_044.png -------------------------------------------------------------------------------- /data/Urban100/img_045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_045.png -------------------------------------------------------------------------------- /data/Urban100/img_046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_046.png -------------------------------------------------------------------------------- /data/Urban100/img_047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_047.png -------------------------------------------------------------------------------- /data/Urban100/img_048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_048.png -------------------------------------------------------------------------------- /data/Urban100/img_049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_049.png -------------------------------------------------------------------------------- /data/Urban100/img_050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_050.png -------------------------------------------------------------------------------- /data/Urban100/img_051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_051.png -------------------------------------------------------------------------------- /data/Urban100/img_052.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_052.png -------------------------------------------------------------------------------- /data/Urban100/img_053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_053.png -------------------------------------------------------------------------------- /data/Urban100/img_054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_054.png -------------------------------------------------------------------------------- /data/Urban100/img_055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_055.png -------------------------------------------------------------------------------- /data/Urban100/img_056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_056.png -------------------------------------------------------------------------------- /data/Urban100/img_057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_057.png -------------------------------------------------------------------------------- /data/Urban100/img_058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_058.png -------------------------------------------------------------------------------- /data/Urban100/img_059.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_059.png -------------------------------------------------------------------------------- /data/Urban100/img_060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_060.png -------------------------------------------------------------------------------- /data/Urban100/img_061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_061.png -------------------------------------------------------------------------------- /data/Urban100/img_062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_062.png -------------------------------------------------------------------------------- /data/Urban100/img_063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_063.png -------------------------------------------------------------------------------- /data/Urban100/img_064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_064.png -------------------------------------------------------------------------------- /data/Urban100/img_065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_065.png -------------------------------------------------------------------------------- /data/Urban100/img_066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_066.png -------------------------------------------------------------------------------- /data/Urban100/img_067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_067.png -------------------------------------------------------------------------------- /data/Urban100/img_068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_068.png -------------------------------------------------------------------------------- /data/Urban100/img_069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_069.png -------------------------------------------------------------------------------- /data/Urban100/img_070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_070.png -------------------------------------------------------------------------------- /data/Urban100/img_071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_071.png -------------------------------------------------------------------------------- /data/Urban100/img_072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_072.png -------------------------------------------------------------------------------- /data/Urban100/img_073.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_073.png -------------------------------------------------------------------------------- /data/Urban100/img_074.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_074.png -------------------------------------------------------------------------------- /data/Urban100/img_075.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_075.png -------------------------------------------------------------------------------- /data/Urban100/img_076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_076.png -------------------------------------------------------------------------------- /data/Urban100/img_077.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_077.png -------------------------------------------------------------------------------- /data/Urban100/img_078.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_078.png -------------------------------------------------------------------------------- /data/Urban100/img_079.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_079.png -------------------------------------------------------------------------------- /data/Urban100/img_080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_080.png -------------------------------------------------------------------------------- /data/Urban100/img_081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_081.png -------------------------------------------------------------------------------- /data/Urban100/img_082.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_082.png -------------------------------------------------------------------------------- /data/Urban100/img_083.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_083.png -------------------------------------------------------------------------------- /data/Urban100/img_084.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_084.png -------------------------------------------------------------------------------- /data/Urban100/img_085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_085.png -------------------------------------------------------------------------------- /data/Urban100/img_086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_086.png -------------------------------------------------------------------------------- /data/Urban100/img_087.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_087.png -------------------------------------------------------------------------------- /data/Urban100/img_088.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_088.png -------------------------------------------------------------------------------- /data/Urban100/img_089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_089.png -------------------------------------------------------------------------------- /data/Urban100/img_090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_090.png -------------------------------------------------------------------------------- /data/Urban100/img_091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_091.png -------------------------------------------------------------------------------- /data/Urban100/img_092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_092.png -------------------------------------------------------------------------------- /data/Urban100/img_093.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_093.png -------------------------------------------------------------------------------- /data/Urban100/img_094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_094.png -------------------------------------------------------------------------------- /data/Urban100/img_095.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_095.png -------------------------------------------------------------------------------- /data/Urban100/img_096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_096.png -------------------------------------------------------------------------------- /data/Urban100/img_097.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_097.png -------------------------------------------------------------------------------- /data/Urban100/img_098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_098.png -------------------------------------------------------------------------------- /data/Urban100/img_099.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_099.png -------------------------------------------------------------------------------- /data/Urban100/img_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/data/Urban100/img_100.png -------------------------------------------------------------------------------- /documents/comp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/comp.png -------------------------------------------------------------------------------- /documents/figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/figure1.png -------------------------------------------------------------------------------- /documents/figure3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/figure3.png -------------------------------------------------------------------------------- /documents/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/img1.png -------------------------------------------------------------------------------- /documents/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/img2.png -------------------------------------------------------------------------------- /documents/img_013_SRF_2_HR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/img_013_SRF_2_HR.png -------------------------------------------------------------------------------- /documents/img_013_SRF_2_SRCNN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/img_013_SRF_2_SRCNN.png -------------------------------------------------------------------------------- /documents/img_013_SRF_2_bicubic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/img_013_SRF_2_bicubic.png -------------------------------------------------------------------------------- /documents/img_013_SRF_2_nearest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/img_013_SRF_2_nearest.png -------------------------------------------------------------------------------- /documents/model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/model.png -------------------------------------------------------------------------------- /documents/network_graph2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/documents/network_graph2.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | """ 4 | Deeply-Recursive Convolutional Network for Image Super-Resolution 5 | by Jiwon Kim, Jung Kwon Lee and Kyoung Mu Lee Department of ECE, ASRI, Seoul National University, Korea 6 | 7 | Paper: http://www.cv-foundation.org/openaccess/content_cvpr_2016/html/Kim_Deeply-Recursive_Convolutional_Network_CVPR_2016_paper.html 8 | 9 | Test implementation using TensorFlow library. 10 | 11 | Author: Jin Yamanaka 12 | Many thanks for: Masayuki Tanaka and Shigesumi Kuwashima 13 | Project: https://github.com/jiny2001/deeply-recursive-cnn-tf 14 | """ 15 | 16 | import tensorflow as tf 17 | import super_resolution as sr 18 | import super_resolution_utilty as util 19 | 20 | flags = tf.app.flags 21 | FLAGS = flags.FLAGS 22 | 23 | # Model 24 | flags.DEFINE_float("initial_lr", 0.001, "Initial learning rate") 25 | flags.DEFINE_float("lr_decay", 0.5, "Learning rate decay rate when it does not reduced during specific epoch") 26 | flags.DEFINE_integer("lr_decay_epoch", 4, "Decay learning rate when loss does not decrease") 27 | flags.DEFINE_float("beta1", 0.1, "Beta1 form adam optimizer") 28 | flags.DEFINE_float("beta2", 0.1, "Beta2 form adam optimizer") 29 | flags.DEFINE_float("momentum", 0.9, "Momentum for momentum optimizer and rmsprop optimizer") 30 | flags.DEFINE_integer("feature_num", 96, "Number of CNN Filters") 31 | flags.DEFINE_integer("cnn_size", 3, "Size of CNN filters") 32 | flags.DEFINE_integer("inference_depth", 9, "Number of recurrent CNN filters") 33 | flags.DEFINE_integer("batch_num", 64, "Number of mini-batch images for training") 34 | flags.DEFINE_integer("batch_size", 41, "Image size for mini-batch") 35 | flags.DEFINE_integer("stride_size", 21, "Stride size for mini-batch") 36 | flags.DEFINE_string("optimizer", "adam", "Optimizer: can be [gd, momentum, adadelta, adagrad, adam, rmsprop]") 37 | flags.DEFINE_float("loss_alpha", 1, "Initial loss-alpha value (0-1). Don't use intermediate outputs when 0.") 38 | flags.DEFINE_integer("loss_alpha_zero_epoch", 25, "Decrease loss-alpha to zero by this epoch") 39 | flags.DEFINE_float("loss_beta", 0.0001, "Loss-beta for weight decay") 40 | flags.DEFINE_float("weight_dev", 0.001, "Initial weight stddev") 41 | flags.DEFINE_string("initializer", "he", "Initializer: can be [uniform, stddev, diagonal, xavier, he]") 42 | 43 | # Image Processing 44 | flags.DEFINE_integer("scale", 2, "Scale for Super Resolution (can be 2 or 4)") 45 | flags.DEFINE_float("max_value", 255.0, "For normalize image pixel value") 46 | flags.DEFINE_integer("channels", 1, "Using num of image channels. Use YCbCr when channels=1.") 47 | flags.DEFINE_boolean("jpeg_mode", False, "Using Jpeg mode for converting from rgb to ycbcr") 48 | flags.DEFINE_boolean("residual", False, "Using residual net") 49 | 50 | # Training or Others 51 | flags.DEFINE_boolean("is_training", True, "Train model with 91 standard images") 52 | flags.DEFINE_string("dataset", "set5", "Test dataset. [set5, set14, bsd100, urban100, all, test] are available") 53 | flags.DEFINE_string("training_set", "ScSR", "Training dataset. [ScSR, Set5, Set14, Bsd100, Urban100] are available") 54 | flags.DEFINE_integer("evaluate_step", 20, "steps for evaluation") 55 | flags.DEFINE_integer("save_step", 2000, "steps for saving learned model") 56 | flags.DEFINE_float("end_lr", 1e-5, "Training end learning rate") 57 | flags.DEFINE_string("checkpoint_dir", "model", "Directory for checkpoints") 58 | flags.DEFINE_string("cache_dir", "cache", "Directory for caching image data. If specified, build image cache") 59 | flags.DEFINE_string("data_dir", "data", "Directory for test/train images") 60 | flags.DEFINE_boolean("load_model", False, "Load saved model before start") 61 | flags.DEFINE_string("model_name", "", "model name for save files and tensorboard log") 62 | 63 | # Debugging or Logging 64 | flags.DEFINE_string("output_dir", "output", "Directory for output test images") 65 | flags.DEFINE_string("log_dir", "tf_log", "Directory for tensorboard log") 66 | flags.DEFINE_boolean("debug", False, "Display each calculated MSE and weight variables") 67 | flags.DEFINE_boolean("initialise_log", True, "Clear all tensorboard log before start") 68 | flags.DEFINE_boolean("visualize", True, "Save loss and graph data") 69 | flags.DEFINE_boolean("summary", False, "Save weight and bias") 70 | 71 | 72 | def main(_): 73 | 74 | print("Super Resolution (tensorflow version:%s)" % tf.__version__) 75 | print("%s\n" % util.get_now_date()) 76 | 77 | if FLAGS.model_name is "": 78 | model_name = "model_F%d_D%d_LR%f" % (FLAGS.feature_num, FLAGS.inference_depth, FLAGS.initial_lr) 79 | else: 80 | model_name = "model_%s" % FLAGS.model_name 81 | model = sr.SuperResolution(FLAGS, model_name=model_name) 82 | 83 | test_filenames = util.build_test_filenames(FLAGS.data_dir, FLAGS.dataset, FLAGS.scale) 84 | if FLAGS.is_training: 85 | if FLAGS.dataset == "test": 86 | training_filenames = util.build_test_filenames(FLAGS.data_dir, FLAGS.dataset, FLAGS.scale) 87 | else: 88 | training_filenames = util.get_files_in_directory(FLAGS.data_dir + "/" + FLAGS.training_set + "/") 89 | 90 | print("Loading and building cache images...") 91 | model.load_datasets(FLAGS.cache_dir, training_filenames, test_filenames, FLAGS.batch_size, FLAGS.stride_size) 92 | else: 93 | FLAGS.load_model = True 94 | 95 | model.build_embedding_graph() 96 | model.build_inference_graph() 97 | model.build_reconstruction_graph() 98 | model.build_optimizer() 99 | model.init_all_variables(load_initial_data=FLAGS.load_model) 100 | 101 | if FLAGS.is_training: 102 | train(training_filenames, test_filenames, model) 103 | 104 | psnr = 0 105 | total_mse = 0 106 | for filename in test_filenames: 107 | mse = model.do_super_resolution_for_test(filename, FLAGS.output_dir) 108 | total_mse += mse 109 | psnr += util.get_psnr(mse) 110 | 111 | print ("\n--- summary --- %s" % util.get_now_date()) 112 | model.print_steps_completed() 113 | util.print_num_of_total_parameters() 114 | print("Final MSE:%f, PSNR:%f" % (total_mse / len(test_filenames), psnr / len(test_filenames))) 115 | 116 | 117 | def train(training_filenames, test_filenames, model): 118 | 119 | mse = model.evaluate() 120 | model.print_status(mse) 121 | 122 | while model.lr > FLAGS.end_lr: 123 | 124 | logging = model.step % FLAGS.evaluate_step == 0 125 | model.build_training_batch() 126 | model.train_batch(log_mse=logging) 127 | 128 | if logging: 129 | mse = model.evaluate() 130 | model.print_status(mse) 131 | 132 | if model.step > 0 and model.step % FLAGS.save_step == 0: 133 | model.save_model() 134 | 135 | model.end_train_step() 136 | model.save_all() 137 | 138 | if FLAGS.debug: 139 | model.print_weight_variables() 140 | 141 | 142 | if __name__ == '__main__': 143 | tf.app.run() 144 | -------------------------------------------------------------------------------- /model/model_F96_D9_LR0.001000.ckpt.data-00000-of-00001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/model/model_F96_D9_LR0.001000.ckpt.data-00000-of-00001 -------------------------------------------------------------------------------- /model/model_F96_D9_LR0.001000.ckpt.index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/model/model_F96_D9_LR0.001000.ckpt.index -------------------------------------------------------------------------------- /model/model_F96_D9_LR0.001000.ckpt.meta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiny2001/deeply-recursive-cnn-tf/1dff9edfe06025faca4d978e53f8f60b6279d338/model/model_F96_D9_LR0.001000.ckpt.meta -------------------------------------------------------------------------------- /super_resolution.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | """ 4 | Deeply-Recursive Convolutional Network for Image Super-Resolution 5 | Paper: http://www.cv-foundation.org/openaccess/content_cvpr_2016/html/Kim_Deeply-Recursive_Convolutional_Network_CVPR_2016_paper.html 6 | 7 | Test implementation model 8 | Author: Jin Yamanaka 9 | """ 10 | 11 | import os 12 | import random 13 | import time 14 | 15 | import numpy as np 16 | import tensorflow as tf 17 | 18 | import super_resolution_utilty as util 19 | 20 | 21 | class DataSet: 22 | def __init__(self, cache_dir, filenames, channels=1, scale=1, alignment=0, jpeg_mode=False, max_value=255.0): 23 | 24 | self.count = len(filenames) 25 | self.image = self.count * [None] 26 | 27 | for i in range(self.count): 28 | image = util.load_input_image_with_cache(cache_dir, filenames[i], channels=channels, 29 | scale=scale, alignment=alignment, jpeg_mode=jpeg_mode) 30 | self.image[i] = image 31 | 32 | def convert_to_batch_images(self, window_size, stride, max_value=255.0): 33 | 34 | batch_images = self.count * [None] 35 | batch_images_count = 0 36 | 37 | for i in range(self.count): 38 | image = self.image[i] 39 | if max_value != 255.0: 40 | image = np.multiply(self.image[i], max_value / 255.0) 41 | batch_images[i] = util.get_split_images(image, window_size, stride=stride) 42 | batch_images_count += batch_images[i].shape[0] 43 | 44 | images = batch_images_count * [None] 45 | no = 0 46 | for i in range(self.count): 47 | for j in range(batch_images[i].shape[0]): 48 | images[no] = batch_images[i][j] 49 | no += 1 50 | 51 | self.image = images 52 | self.count = batch_images_count 53 | 54 | print("%d mini-batch images are built." % len(self.image)) 55 | 56 | 57 | class DataSets: 58 | def __init__(self, cache_dir, filenames, scale, batch_size, stride_size, width=0, height=0, channels=1, 59 | jpeg_mode=False, max_value=255.0): 60 | self.input = DataSet(cache_dir, filenames, channels=channels, scale=scale, alignment=scale, jpeg_mode=jpeg_mode) 61 | self.input.convert_to_batch_images(batch_size, stride_size, max_value=max_value) 62 | 63 | self.true = DataSet(cache_dir, filenames, channels=channels, alignment=scale, jpeg_mode=jpeg_mode) 64 | self.true.convert_to_batch_images(batch_size, stride_size, max_value=max_value) 65 | 66 | 67 | class SuperResolution: 68 | def __init__(self, flags, model_name="model"): 69 | 70 | # Model Parameters 71 | self.lr = flags.initial_lr 72 | self.lr_decay = flags.lr_decay 73 | self.lr_decay_epoch = flags.lr_decay_epoch 74 | self.beta1 = flags.beta1 75 | self.beta2 = flags.beta2 76 | self.momentum = flags.momentum 77 | self.feature_num = flags.feature_num 78 | self.cnn_size = flags.cnn_size 79 | self.cnn_stride = 1 80 | self.inference_depth = flags.inference_depth 81 | self.batch_num = flags.batch_num 82 | self.batch_size = flags.batch_size 83 | self.stride_size = flags.stride_size 84 | self.optimizer = flags.optimizer 85 | self.loss_alpha = flags.loss_alpha 86 | self.loss_alpha_decay = flags.loss_alpha / flags.loss_alpha_zero_epoch 87 | self.loss_beta = flags.loss_beta 88 | self.weight_dev = flags.weight_dev 89 | self.initializer = flags.initializer 90 | 91 | # Image Processing Parameters 92 | self.scale = flags.scale 93 | self.max_value = flags.max_value 94 | self.channels = flags.channels 95 | self.jpeg_mode = flags.jpeg_mode 96 | self.residual = flags.residual 97 | 98 | # Training or Other Parameters 99 | self.checkpoint_dir = flags.checkpoint_dir 100 | self.model_name = model_name 101 | 102 | # Debugging or Logging Parameters 103 | self.log_dir = flags.log_dir 104 | self.debug = flags.debug 105 | self.visualize = flags.visualize 106 | self.summary = flags.summary 107 | self.log_weight_image_num = 16 108 | 109 | # initializing variables 110 | config = tf.ConfigProto() 111 | config.gpu_options.allow_growth = False 112 | self.sess = tf.InteractiveSession(config=config) 113 | self.H_conv = (self.inference_depth + 1) * [None] 114 | self.batch_input_images = self.batch_num * [None] 115 | self.batch_true_images = self.batch_num * [None] 116 | 117 | self.index_in_epoch = -1 118 | self.epochs_completed = 0 119 | self.min_validation_mse = -1 120 | self.min_validation_epoch = -1 121 | self.step = 0 122 | self.training_psnr = 0 123 | 124 | self.psnr_graph_epoch = [] 125 | self.psnr_graph_value = [] 126 | 127 | util.make_dir(self.log_dir) 128 | util.make_dir(self.checkpoint_dir) 129 | if flags.initialise_log: 130 | util.clean_dir(self.log_dir) 131 | 132 | print("Features:%d Inference Depth:%d Initial LR:%0.5f [%s]" % \ 133 | (self.feature_num, self.inference_depth, self.lr, self.model_name)) 134 | 135 | def load_datasets(self, cache_dir, training_filenames, test_filenames, batch_size, stride_size): 136 | self.train = DataSets(cache_dir, training_filenames, self.scale, batch_size, stride_size, 137 | channels=self.channels, jpeg_mode=self.jpeg_mode, max_value=self.max_value) 138 | self.test = DataSets(cache_dir, test_filenames, self.scale, batch_size, batch_size, 139 | channels=self.channels, jpeg_mode=self.jpeg_mode, max_value=self.max_value) 140 | 141 | def set_next_epoch(self): 142 | 143 | self.loss_alpha = max(0, self.loss_alpha - self.loss_alpha_decay) 144 | 145 | self.batch_index = random.sample(range(0, self.train.input.count), self.train.input.count) 146 | self.epochs_completed += 1 147 | self.index_in_epoch = 0 148 | 149 | def build_training_batch(self): 150 | 151 | if self.index_in_epoch < 0: 152 | self.batch_index = random.sample(range(0, self.train.input.count), self.train.input.count) 153 | self.index_in_epoch = 0 154 | 155 | for i in range(self.batch_num): 156 | if self.index_in_epoch >= self.train.input.count: 157 | self.set_next_epoch() 158 | 159 | self.batch_input_images[i] = self.train.input.image[self.batch_index[self.index_in_epoch]] 160 | self.batch_true_images[i] = self.train.true.image[self.batch_index[self.index_in_epoch]] 161 | self.index_in_epoch += 1 162 | 163 | def build_embedding_graph(self): 164 | 165 | self.x = tf.placeholder(tf.float32, shape=[None, None, None, self.channels], name="X") 166 | self.y = tf.placeholder(tf.float32, shape=[None, None, None, self.channels], name="Y") 167 | 168 | # H-1 conv 169 | with tf.variable_scope("W-1_conv"): 170 | self.Wm1_conv = util.weight([self.cnn_size, self.cnn_size, self.channels, self.feature_num], 171 | stddev=self.weight_dev, name="conv_W", initializer=self.initializer) 172 | self.Bm1_conv = util.bias([self.feature_num], name="conv_B") 173 | Hm1_conv = util.conv2d_with_bias(self.x, self.Wm1_conv, self.cnn_stride, self.Bm1_conv, add_relu=True, name="H") 174 | 175 | # H0 conv 176 | with tf.variable_scope("W0_conv"): 177 | self.W0_conv = util.weight([self.cnn_size, self.cnn_size, self.feature_num, self.feature_num], 178 | stddev=self.weight_dev, name="conv_W", initializer=self.initializer) 179 | self.B0_conv = util.bias([self.feature_num], name="conv_B") 180 | self.H_conv[0] = util.conv2d_with_bias(Hm1_conv, self.W0_conv, self.cnn_stride, self.B0_conv, add_relu=True, 181 | name="H") 182 | 183 | if self.summary: 184 | # convert to tf.summary.image format [batch_num, height, width, channels] 185 | Wm1_transposed = tf.transpose(self.Wm1_conv, [3, 0, 1, 2]) 186 | tf.summary.image("W-1/" + self.model_name, Wm1_transposed, max_outputs=self.log_weight_image_num) 187 | util.add_summaries("B-1", self.model_name, self.Bm1_conv, mean=True, max=True, min=True) 188 | util.add_summaries("W-1", self.model_name, self.Wm1_conv, mean=True, max=True, min=True) 189 | 190 | util.add_summaries("B0", self.model_name, self.B0_conv, mean=True, max=True, min=True) 191 | util.add_summaries("W0", self.model_name, self.W0_conv, mean=True, max=True, min=True) 192 | 193 | def build_inference_graph(self): 194 | 195 | if self.inference_depth <= 0: 196 | return 197 | 198 | self.W_conv = util.weight([self.cnn_size, self.cnn_size, self.feature_num, self.feature_num], 199 | stddev=self.weight_dev, name="W_conv", initializer="diagonal") 200 | self.B_conv = util.bias([self.feature_num], name="B") 201 | 202 | for i in range(0, self.inference_depth): 203 | with tf.variable_scope("W%d_conv" % (i+1)): 204 | self.H_conv[i + 1] = util.conv2d_with_bias(self.H_conv[i], self.W_conv, 1, self.B_conv, add_relu=True, 205 | name="H%d" % i) 206 | 207 | if self.summary: 208 | util.add_summaries("W", self.model_name, self.W_conv, mean=True, max=True, min=True) 209 | util.add_summaries("B", self.model_name, self.B_conv, mean=True, max=True, min=True) 210 | 211 | def build_reconstruction_graph(self): 212 | 213 | # HD+1 conv 214 | self.WD1_conv = util.weight([self.cnn_size, self.cnn_size, self.feature_num, self.feature_num], 215 | stddev=self.weight_dev, name="WD1_conv", initializer=self.initializer) 216 | self.BD1_conv = util.bias([self.feature_num], name="BD1") 217 | 218 | # HD+2 conv 219 | self.WD2_conv = util.weight([self.cnn_size, self.cnn_size, self.feature_num+1, self.channels], 220 | stddev=self.weight_dev, name="WD2_conv", initializer=self.initializer) 221 | self.BD2_conv = util.bias([1], name="BD2") 222 | 223 | self.Y1_conv = (self.inference_depth) * [None] 224 | self.Y2_conv = (self.inference_depth) * [None] 225 | self.W = tf.Variable( 226 | np.full(fill_value=1.0 / self.inference_depth, shape=[self.inference_depth], dtype=np.float32), 227 | name="LayerWeights") 228 | W_sum = tf.reduce_sum(self.W) 229 | 230 | self.y_outputs = self.inference_depth * [None] 231 | 232 | for i in range(0, self.inference_depth): 233 | with tf.variable_scope("Y%d" % (i+1)): 234 | self.Y1_conv[i] = util.conv2d_with_bias(self.H_conv[i+1], self.WD1_conv, self.cnn_stride, self.BD1_conv, 235 | add_relu=not self.residual, name="conv_1") 236 | y_conv = tf.concat([self.Y1_conv[i], self.x], 3) 237 | self.Y2_conv[i] = util.conv2d_with_bias(y_conv, self.WD2_conv, self.cnn_stride, self.BD2_conv, 238 | add_relu=not self.residual, name="conv_2") 239 | self.y_outputs[i] = self.Y2_conv[i] * self.W[i] / W_sum 240 | 241 | if self.summary: 242 | util.add_summaries("BD1", self.model_name, self.BD1_conv) 243 | util.add_summaries("WD1", self.model_name, self.WD1_conv, mean=True, max=True, min=True) 244 | util.add_summaries("WD2", self.model_name, self.WD2_conv, mean=True, max=True, min=True) 245 | 246 | def build_optimizer(self): 247 | 248 | self.lr_input = tf.placeholder(tf.float32, shape=[], name="LearningRate") 249 | self.loss_alpha_input = tf.placeholder(tf.float32, shape=[], name="Alpha") 250 | 251 | with tf.variable_scope("Loss"): 252 | 253 | self.y_ = tf.add_n(self.y_outputs) 254 | if self.residual: 255 | self.y_ = self.y_ + self.x 256 | 257 | mse = tf.reduce_mean(tf.square(self.y_ - self.y), name="MSE") 258 | 259 | if self.debug: 260 | mse = tf.Print(mse, [mse], message="MSE: ") 261 | 262 | tf.summary.scalar("test_PSNR/" + self.model_name, self.get_psnr_tensor(mse)) 263 | 264 | if self.loss_alpha == 0.0 or self.inference_depth == 0: 265 | loss = mse 266 | else: 267 | 268 | # we define 'Alpha Loss' as the MSE of internal H1 to Hn 269 | alpha_mses = (self.inference_depth) * [None] 270 | 271 | with tf.variable_scope("Alpha_Losses"): 272 | for i in range(0, self.inference_depth): 273 | with tf.variable_scope("Alpha_Loss%d" % (i+1)): 274 | if self.residual: 275 | self.Y2_conv[i] = self.Y2_conv[i] + self.x 276 | inference_square = tf.square(tf.subtract(self.y, self.Y2_conv[i])) 277 | alpha_mses[i] = tf.reduce_mean(inference_square) 278 | 279 | alpha_loss = tf.add_n(alpha_mses) 280 | alpha_loss = tf.multiply(1.0 / self.inference_depth, alpha_loss, name="loss1_weight") 281 | alpha_loss2 = tf.multiply(self.loss_alpha_input, alpha_loss, name="loss1_alpha") 282 | 283 | if self.visualize: 284 | tf.summary.scalar("loss_alpha/" + self.model_name, alpha_loss) 285 | tf.summary.scalar("loss_mse/" + self.model_name, mse) 286 | 287 | mse2 = tf.multiply(1 - self.loss_alpha_input, mse, name="loss_mse_alpha") 288 | loss = mse2 + alpha_loss2 289 | 290 | if self.loss_beta > 0.0: 291 | with tf.variable_scope("L2_norms"): 292 | L2_norm = tf.nn.l2_loss(self.Wm1_conv) + tf.nn.l2_loss(self.W0_conv) \ 293 | + tf.nn.l2_loss(self.W_conv) + tf.nn.l2_loss(self.WD1_conv) \ 294 | + tf.nn.l2_loss(self.WD2_conv) 295 | L2_norm *= self.loss_beta 296 | loss += L2_norm 297 | 298 | if self.visualize: 299 | tf.summary.scalar("loss_L2_norm/" + self.model_name, L2_norm) 300 | 301 | if self.visualize: 302 | tf.summary.scalar("test_loss/" + self.model_name, loss) 303 | 304 | self.loss = loss 305 | self.mse = mse 306 | self.train_step = self.add_optimizer_op(loss, self.lr_input) 307 | 308 | util.print_num_of_total_parameters() 309 | 310 | def get_psnr_tensor(self, mse): 311 | 312 | with tf.variable_scope("get_PSNR"): 313 | value = tf.constant(self.max_value, dtype=mse.dtype) / tf.sqrt(mse) 314 | numerator = tf.log(value) 315 | denominator = tf.log(tf.constant(10, dtype=mse.dtype)) 316 | return tf.constant(20, dtype=mse.dtype) * numerator / denominator 317 | 318 | def add_optimizer_op(self, loss, lr_input): 319 | 320 | if self.optimizer == "gd": 321 | train_step = tf.train.GradientDescentOptimizer(lr_input).minimize(loss) 322 | elif self.optimizer == "adadelta": 323 | train_step = tf.train.AdadeltaOptimizer(lr_input).minimize(loss) 324 | elif self.optimizer == "adagrad": 325 | train_step = tf.train.AdagradOptimizer(lr_input).minimize(loss) 326 | elif self.optimizer == "adam": 327 | train_step = tf.train.AdamOptimizer(lr_input, beta1=self.beta1, beta2=self.beta2).minimize(loss) 328 | elif self.optimizer == "momentum": 329 | train_step = tf.train.MomentumOptimizer(lr_input, self.momentum).minimize(loss) 330 | elif self.optimizer == "rmsprop": 331 | train_step = tf.train.RMSPropOptimizer(lr_input, momentum=self.momentum).minimize(loss) 332 | else: 333 | print("Optimizer arg should be one of [gd, adagrad, adam, momentum, rmsprop].") 334 | return None 335 | 336 | return train_step 337 | 338 | def init_all_variables(self, load_initial_data=False): 339 | 340 | if self.visualize: 341 | self.summary_op = tf.summary.merge_all() 342 | self.summary_writer = tf.summary.FileWriter(self.log_dir, graph=self.sess.graph) 343 | 344 | self.sess.run(tf.global_variables_initializer()) 345 | self.saver = tf.train.Saver() 346 | 347 | if load_initial_data: 348 | self.saver.restore(self.sess, self.checkpoint_dir + "/" + self.model_name + ".ckpt") 349 | print("Model restored.") 350 | 351 | self.start_time = time.time() 352 | 353 | def train_batch(self, log_mse=False): 354 | 355 | _, mse = self.sess.run([self.train_step, self.mse], feed_dict={self.x: self.batch_input_images, 356 | self.y: self.batch_true_images, 357 | self.lr_input: self.lr, 358 | self.loss_alpha_input: self.loss_alpha}) 359 | self.step += 1 360 | self.training_psnr = util.get_psnr(mse, max_value=self.max_value) 361 | 362 | def evaluate(self): 363 | 364 | summary_str, mse = self.sess.run([self.summary_op, self.mse], 365 | feed_dict={self.x: self.test.input.image, 366 | self.y: self.test.true.image, 367 | self.loss_alpha_input: self.loss_alpha}) 368 | 369 | self.summary_writer.add_summary(summary_str, self.step) 370 | self.summary_writer.flush() 371 | 372 | if self.min_validation_mse < 0 or self.min_validation_mse > mse: 373 | self.min_validation_epoch = self.epochs_completed 374 | self.min_validation_mse = mse 375 | else: 376 | if self.epochs_completed > self.min_validation_epoch + self.lr_decay_epoch: 377 | self.min_validation_epoch = self.epochs_completed 378 | self.min_validation_mse = mse 379 | self.lr *= self.lr_decay 380 | 381 | psnr = util.get_psnr(mse, max_value=self.max_value) 382 | self.psnr_graph_epoch.append(self.epochs_completed) 383 | self.psnr_graph_value.append(psnr) 384 | 385 | return mse 386 | 387 | def save_summary(self): 388 | 389 | summary_str = self.sess.run(self.summary_op, 390 | feed_dict={self.x: self.test.input.image, 391 | self.y: self.test.true.image, 392 | self.loss_alpha_input: self.loss_alpha}) 393 | 394 | self.summary_writer.add_summary(summary_str, 0) 395 | self.summary_writer.flush() 396 | 397 | def print_status(self, mse): 398 | 399 | psnr = util.get_psnr(mse, max_value=self.max_value) 400 | if self.step == 0: 401 | print("Initial MSE:%f PSNR:%f" % (mse, psnr)) 402 | else: 403 | processing_time = (time.time() - self.start_time) / self.step 404 | print("%s Step:%d MSE:%f PSNR:%f (%f)" % (util.get_now_date(), self.step, mse, psnr, self.training_psnr)) 405 | print("Epoch:%d LR:%f α:%f (%2.2fsec/step)" % (self.epochs_completed, self.lr, self.loss_alpha, processing_time)) 406 | 407 | def print_weight_variables(self): 408 | 409 | util.print_CNN_weight(self.Wm1_conv) 410 | util.print_CNN_bias(self.Bm1_conv) 411 | util.print_CNN_weight(self.W0_conv) 412 | util.print_CNN_bias(self.B0_conv) 413 | util.print_CNN_bias(self.W) 414 | 415 | def save_model(self): 416 | 417 | filename = self.checkpoint_dir + "/" + self.model_name + ".ckpt" 418 | self.saver.save(self.sess, filename) 419 | print("Model saved [%s]." % filename) 420 | 421 | def save_all(self): 422 | 423 | self.save_model() 424 | 425 | psnr_graph = np.column_stack((np.array(self.psnr_graph_epoch), np.array(self.psnr_graph_value))) 426 | 427 | filename = self.checkpoint_dir + "/" + self.model_name + ".csv" 428 | np.savetxt(filename, psnr_graph, delimiter=",") 429 | print("Graph saved [%s]." % filename) 430 | 431 | def do(self, input_image): 432 | 433 | if len(input_image.shape) == 2: 434 | input_image = input_image.reshape(input_image.shape[0], input_image.shape[1], 1) 435 | 436 | image = np.multiply(input_image, self.max_value / 255.0) 437 | image = image.reshape(1, image.shape[0], image.shape[1], image.shape[2]) 438 | y = self.sess.run(self.y_, feed_dict={self.x: image}) 439 | 440 | return np.multiply(y[0], 255.0 / self.max_value) 441 | 442 | def do_super_resolution(self, file_path, output_folder="output"): 443 | 444 | filename, extension = os.path.splitext(file_path) 445 | output_folder = output_folder + "/" 446 | org_image = util.load_image(file_path) 447 | util.save_image(output_folder + file_path, org_image) 448 | 449 | if len(org_image.shape) >= 3 and org_image.shape[2] == 3 and self.channels == 1: 450 | scaled_image = util.resize_image_by_pil_bicubic(org_image, self.scale) 451 | util.save_image(output_folder + filename + "_bicubic" + extension, scaled_image) 452 | input_ycbcr_image = util.convert_rgb_to_ycbcr(scaled_image, jpeg_mode=self.jpeg_mode) 453 | output_y_image = self.do(input_ycbcr_image[:, :, 0:1]) 454 | util.save_image(output_folder + filename + "_result_y" + extension, output_y_image) 455 | 456 | image = util.convert_y_and_cbcr_to_rgb(output_y_image, input_ycbcr_image[:, :, 1:3], jpeg_mode=self.jpeg_mode) 457 | else: 458 | scaled_image = util.resize_image_by_pil_bicubic(org_image, self.scale) 459 | util.save_image(output_folder + filename + "_bicubic" + extension, scaled_image) 460 | image = self.do(scaled_image) 461 | 462 | util.save_image(output_folder + filename + "_result" + extension, image) 463 | return 0 464 | 465 | def do_super_resolution_for_test(self, file_path, output_folder="output", output=True): 466 | 467 | filename, extension = os.path.splitext(file_path) 468 | output_folder = output_folder + "/" 469 | true_image = util.set_image_alignment(util.load_image(file_path), self.scale) 470 | 471 | if len(true_image.shape) >= 3 and true_image.shape[2] == 3 and self.channels == 1: 472 | input_y_image = util.build_input_image(true_image, channels=self.channels, scale=self.scale, alignment=self.scale, 473 | convert_ycbcr=True, jpeg_mode=self.jpeg_mode) 474 | true_ycbcr_image = util.convert_rgb_to_ycbcr(true_image, jpeg_mode=self.jpeg_mode) 475 | 476 | output_y_image = self.do(input_y_image) 477 | mse = util.compute_mse(true_ycbcr_image[:, :, 0:1], output_y_image, border_size=self.scale) 478 | 479 | if output: 480 | output_color_image = util.convert_y_and_cbcr_to_rgb(output_y_image, true_ycbcr_image[:, :, 1:3], 481 | jpeg_mode=self.jpeg_mode) 482 | loss_image = util.get_loss_image(true_ycbcr_image[:, :, 0:1], output_y_image, border_size=self.scale) 483 | 484 | util.save_image(output_folder + file_path, true_image) 485 | util.save_image(output_folder + filename + "_input" + extension, input_y_image) 486 | util.save_image(output_folder + filename + "_true_y" + extension, true_ycbcr_image[:, :, 0:1]) 487 | util.save_image(output_folder + filename + "_result" + extension, output_y_image) 488 | util.save_image(output_folder + filename + "_result_c" + extension, output_color_image) 489 | util.save_image(output_folder + filename + "_loss" + extension, loss_image) 490 | else: 491 | input_image = util.load_input_image(file_path, channels=1, scale=self.scale, alignment=self.scale) 492 | output_image = self.do(input_image) 493 | mse = util.compute_mse(true_image, output_image, border_size=self.scale) 494 | 495 | if output: 496 | util.save_image(output_folder + file_path, true_image) 497 | util.save_image(output_folder + filename + "_result" + extension, output_image) 498 | 499 | print("MSE:%f PSNR:%f" % (mse, util.get_psnr(mse))) 500 | return mse 501 | 502 | def end_train_step(self): 503 | self.total_time = time.time() - self.start_time 504 | 505 | def print_steps_completed(self): 506 | if self.step <= 0: 507 | return 508 | 509 | processing_time = self.total_time / self.step 510 | 511 | h = self.total_time // (60 * 60) 512 | m = (self.total_time - h * 60 * 60) // 60 513 | s = (self.total_time - h * 60 * 60 - m * 60) 514 | 515 | print("Finished at Total Epoch:%d Step:%d Time:%02d:%02d:%02d (%0.3fsec/step)" % ( 516 | self.epochs_completed, self.step, h, m, s, processing_time)) 517 | -------------------------------------------------------------------------------- /super_resolution_utilty.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | """ 4 | Deeply-Recursive Convolutional Network for Image Super-Resolution 5 | Paper: http://www.cv-foundation.org/openaccess/content_cvpr_2016/html/Kim_Deeply-Recursive_Convolutional_Network_CVPR_2016_paper.html 6 | 7 | Test implementation utility 8 | Author: Jin Yamanaka 9 | """ 10 | 11 | from __future__ import division 12 | 13 | import datetime 14 | import math 15 | import os 16 | import shutil 17 | from os import listdir 18 | from os.path import isfile, join 19 | 20 | import numpy as np 21 | import tensorflow as tf 22 | from PIL import Image 23 | from scipy import misc 24 | 25 | # utilities for save / load 26 | 27 | test_datasets = { 28 | "set5": ["Set5", 0, 5], 29 | "set14": ["Set14", 0, 14], 30 | "bsd100": ["BSD100", 0, 100], 31 | "urban100": ["Urban100", 0, 100], 32 | "test": ["Set5", 0, 1] 33 | } 34 | 35 | 36 | class LoadError(Exception): 37 | def __init__(self, message): 38 | self.message = message 39 | 40 | 41 | def make_dir(directory): 42 | if not os.path.exists(directory): 43 | os.makedirs(directory) 44 | 45 | 46 | def get_files_in_directory(path): 47 | file_list = [path + f for f in listdir(path) if isfile(join(path, f))] 48 | return file_list 49 | 50 | 51 | def remove_generic(path, __func__): 52 | try: 53 | __func__(path) 54 | except OSError as error: 55 | print("OS error: {0}".format(error)) 56 | 57 | 58 | def clean_dir(path): 59 | if not os.path.isdir(path): 60 | return 61 | 62 | files = os.listdir(path) 63 | for x in files: 64 | full_path = os.path.join(path, x) 65 | if os.path.isfile(full_path): 66 | f = os.remove 67 | remove_generic(full_path, f) 68 | elif os.path.isdir(full_path): 69 | clean_dir(full_path) 70 | f = os.rmdir 71 | remove_generic(full_path, f) 72 | 73 | 74 | def save_image(filename, image): 75 | if len(image.shape) >= 3 and image.shape[2] == 1: 76 | image = image.reshape(image.shape[0], image.shape[1]) 77 | 78 | directory = os.path.dirname(filename) 79 | if directory != "" and not os.path.exists(directory): 80 | os.makedirs(directory) 81 | 82 | image = misc.toimage(image, cmin=0, cmax=255) # to avoid range rescaling 83 | misc.imsave(filename, image) 84 | 85 | print("Saved [%s]" % filename) 86 | 87 | 88 | def save_image_data(filename, image): 89 | directory = os.path.dirname(filename) 90 | if directory != "" and not os.path.exists(directory): 91 | os.makedirs(directory) 92 | 93 | np.save(filename, image) 94 | print("Saved [%s]" % filename) 95 | 96 | if len(image.shape) == 3 and image.shape[2] == 1: 97 | image = image.reshape(image.shape[0], image.shape[1]) 98 | misc.imsave(filename, image) 99 | 100 | 101 | def convert_rgb_to_y(image, jpeg_mode=True, max_value=255.0): 102 | if len(image.shape) <= 2 or image.shape[2] == 1: 103 | return image 104 | 105 | if jpeg_mode: 106 | xform = np.array([[0.299, 0.587, 0.114]]) 107 | y_image = image.dot(xform.T) 108 | else: 109 | xform = np.array([[65.481 / 256.0, 128.553 / 256.0, 24.966 / 256.0]]) 110 | y_image = image.dot(xform.T) + (16.0 * max_value / 256.0) 111 | 112 | return y_image 113 | 114 | 115 | def convert_rgb_to_ycbcr(image, jpeg_mode=True, max_value=255): 116 | if len(image.shape) < 2 or image.shape[2] == 1: 117 | return image 118 | 119 | if jpeg_mode: 120 | xform = np.array([[0.299, 0.587, 0.114], [-0.169, - 0.331, 0.500], [0.500, - 0.419, - 0.081]]) 121 | ycbcr_image = image.dot(xform.T) 122 | ycbcr_image[:, :, [1, 2]] += max_value / 2 123 | else: 124 | xform = np.array( 125 | [[65.481 / 256.0, 128.553 / 256.0, 24.966 / 256.0], [- 37.945 / 256.0, - 74.494 / 256.0, 112.439 / 256.0], 126 | [112.439 / 256.0, - 94.154 / 256.0, - 18.285 / 256.0]]) 127 | ycbcr_image = image.dot(xform.T) 128 | ycbcr_image[:, :, 0] += (16.0 * max_value / 256.0) 129 | ycbcr_image[:, :, [1, 2]] += (128.0 * max_value / 256.0) 130 | 131 | return ycbcr_image 132 | 133 | 134 | def convert_y_and_cbcr_to_rgb(y_image, cbcr_image, jpeg_mode=True, max_value=255.0): 135 | if len(y_image.shape) <= 2: 136 | y_image = y_image.reshape[y_image.shape[0], y_image.shape[1], 1] 137 | 138 | if len(y_image.shape) == 3 and y_image.shape[2] == 3: 139 | y_image = y_image[:, :, 0:1] 140 | 141 | ycbcr_image = np.zeros([y_image.shape[0], y_image.shape[1], 3]) 142 | ycbcr_image[:, :, 0] = y_image[:, :, 0] 143 | ycbcr_image[:, :, 1:3] = cbcr_image[:, :, 0:2] 144 | 145 | return convert_ycbcr_to_rgb(ycbcr_image, jpeg_mode=jpeg_mode, max_value=max_value) 146 | 147 | 148 | def convert_ycbcr_to_rgb(ycbcr_image, jpeg_mode=True, max_value=255.0): 149 | rgb_image = np.zeros([ycbcr_image.shape[0], ycbcr_image.shape[1], 3]) # type: np.ndarray 150 | 151 | if jpeg_mode: 152 | rgb_image[:, :, [1, 2]] = ycbcr_image[:, :, [1, 2]] - (128.0 * max_value / 256.0) 153 | xform = np.array([[1, 0, 1.402], [1, - 0.344, - 0.714], [1, 1.772, 0]]) 154 | rgb_image = rgb_image.dot(xform.T) 155 | else: 156 | rgb_image[:, :, 0] = ycbcr_image[:, :, 0] - (16.0 * max_value / 256.0) 157 | rgb_image[:, :, [1, 2]] = ycbcr_image[:, :, [1, 2]] - (128.0 * max_value / 256.0) 158 | xform = np.array( 159 | [[max_value / 219.0, 0, max_value * 0.701 / 112.0], 160 | [max_value / 219, - max_value * 0.886 * 0.114 / (112 * 0.587), - max_value * 0.701 * 0.299 / (112 * 0.587)], 161 | [max_value / 219.0, max_value * 0.886 / 112.0, 0]]) 162 | rgb_image = rgb_image.dot(xform.T) 163 | 164 | return rgb_image 165 | 166 | 167 | def set_image_alignment(image, alignment): 168 | alignment = int(alignment) # I don't like this... 169 | width, height = image.shape[1], image.shape[0] 170 | width = (width // alignment) * alignment 171 | height = (height // alignment) * alignment 172 | if image.shape[1] != width or image.shape[0] != height: 173 | return image[:height, :width, :] 174 | 175 | return image 176 | 177 | 178 | def resize_image_by_bicubic(image, scale): 179 | size = [int(image.shape[0] * scale), int(image.shape[1] * scale)] 180 | image = image.reshape(1, image.shape[0], image.shape[1], image.shape[2]) 181 | tf_image = tf.image.resize_bicubic(image, size=size) 182 | image = tf_image.eval() 183 | return image.reshape(image.shape[1], image.shape[2], image.shape[3]) 184 | 185 | 186 | def resize_image_by_pil_bicubic(image, scale): 187 | width, height = image.shape[1], image.shape[0] 188 | new_width = int(width * scale) 189 | new_height = int(height * scale) 190 | 191 | if len(image.shape) == 3 and image.shape[2] == 3: 192 | image = Image.fromarray(image, "RGB") 193 | image = image.resize([new_width, new_height], resample=Image.BICUBIC) 194 | image = np.asarray(image) 195 | else: 196 | image = Image.fromarray(image.reshape(height, width)) 197 | image = image.resize([new_width, new_height], resample=Image.BICUBIC) 198 | image = np.asarray(image) 199 | image = image.reshape(new_height, new_width, 1) 200 | return image 201 | 202 | 203 | def load_image(filename, width=0, height=0, channels=0, alignment=0): 204 | if not os.path.isfile(filename): 205 | raise LoadError("File not found [%s]" % filename) 206 | image = misc.imread(filename) 207 | 208 | if len(image.shape) == 2: 209 | image = image.reshape(image.shape[0], image.shape[1], 1) 210 | if (width != 0 and image.shape[1] != width) or (height != 0 and image.shape[0] != height): 211 | raise LoadError("Attributes mismatch") 212 | if channels != 0 and image.shape[2] != channels: 213 | raise LoadError("Attributes mismatch") 214 | if alignment != 0 and ((width % alignment) != 0 or (height % alignment) != 0): 215 | raise LoadError("Attributes mismatch") 216 | 217 | print("Loaded [%s]: %d x %d x %d" % (filename, image.shape[1], image.shape[0], image.shape[2])) 218 | return image 219 | 220 | 221 | def load_image_data(filename, width=0, height=0, channels=0, alignment=0): 222 | if not os.path.isfile(filename + ".npy"): 223 | raise LoadError("File not found") 224 | image = np.load(filename + ".npy") 225 | 226 | if (width != 0 and image.shape[1] != width) or (height != 0 and image.shape[0] != height): 227 | raise LoadError("Attributes mismatch") 228 | if channels != 0 and image.shape[2] != channels: 229 | raise LoadError("Attributes mismatch") 230 | if alignment != 0 and ((width % alignment) != 0 or (height % alignment) != 0): 231 | raise LoadError("Attributes mismatch") 232 | 233 | print("Cache Loaded [%s]: %d x %d x %d" % (filename, image.shape[1], image.shape[0], image.shape[2])) 234 | return image 235 | 236 | 237 | def load_input_image(filename, width=0, height=0, channels=1, scale=1, alignment=0, 238 | convert_ycbcr=True, jpeg_mode=False, rescale=True): 239 | image = load_image(filename) 240 | return build_input_image(image, width, height, channels, scale, alignment, 241 | convert_ycbcr, jpeg_mode, rescale) 242 | 243 | 244 | def build_input_image(image, width=0, height=0, channels=1, scale=1, alignment=0, 245 | convert_ycbcr=True, jpeg_mode=False, rescale=True): 246 | if width != 0 and height != 0: 247 | if image.shape[0] != height or image.shape[1] != width: 248 | x = (image.shape[1] - width) // 2 249 | y = (image.shape[0] - height) // 2 250 | image = image[y: y + height, x: x + width, :] 251 | 252 | if alignment > 1: 253 | image = set_image_alignment(image, alignment) 254 | 255 | if scale != 1: 256 | image = resize_image_by_pil_bicubic(image, 1.0 / scale) 257 | if rescale: 258 | image = resize_image_by_pil_bicubic(image, scale) 259 | 260 | if convert_ycbcr: 261 | image = convert_rgb_to_ycbcr(image, jpeg_mode=jpeg_mode) 262 | 263 | if channels == 1 and image.shape[2] > 1: 264 | image = image[:, :, 0:1].copy() # use copy() since after the step we use stride_tricks.as_strided(). 265 | 266 | return image 267 | 268 | 269 | def load_input_image_with_cache(cache_dir, org_filename, channels=1, scale=1, alignment=0, 270 | convert_ycbcr=True, jpeg_mode=False, rescale=True): 271 | if cache_dir is None or cache_dir is "": 272 | return load_input_image(org_filename, channels=channels, scale=scale, alignment=alignment, 273 | convert_ycbcr=convert_ycbcr, jpeg_mode=jpeg_mode, rescale=rescale) 274 | 275 | filename, extension = os.path.splitext(org_filename) 276 | 277 | if filename.startswith("../"): 278 | filename = filename[len("../"):] 279 | 280 | if scale != 1.0: 281 | filename += "_%1.0f" % scale 282 | if channels == 1: 283 | filename += "_Y" 284 | 285 | cache_filename = cache_dir + "/" + filename + extension 286 | try: 287 | image = load_image(cache_filename, channels=channels) 288 | except LoadError: 289 | image = load_input_image(org_filename, channels=channels, scale=scale, alignment=alignment, 290 | convert_ycbcr=convert_ycbcr, jpeg_mode=jpeg_mode, rescale=rescale) 291 | save_image(cache_filename, image) 292 | 293 | return image 294 | 295 | 296 | def get_split_images(image, window_size, stride=None): 297 | if len(image.shape) == 3 and image.shape[2] == 1: 298 | image = image.reshape(image.shape[0], image.shape[1]) 299 | 300 | window_size = int(window_size) 301 | size = image.itemsize # byte size of each value 302 | height, width = image.shape 303 | if stride is None: 304 | stride = window_size 305 | else: 306 | stride = int(stride) 307 | 308 | new_height = 1 + (height - window_size) // stride 309 | new_width = 1 + (width - window_size) // stride 310 | 311 | shape = (new_height, new_width, window_size, window_size) 312 | strides = size * np.array([width * stride, stride, width, 1]) 313 | windows = np.lib.stride_tricks.as_strided(image, shape=shape, strides=strides) 314 | windows = windows.reshape(windows.shape[0] * windows.shape[1], windows.shape[2], windows.shape[3], 1) 315 | 316 | return windows 317 | 318 | 319 | # utilities for building graphs 320 | 321 | def conv2d(x, w, stride, name=""): 322 | return tf.nn.conv2d(x, w, strides=[stride, stride, 1, 1], padding="SAME", name=name + "_conv") 323 | 324 | 325 | def conv2d_with_bias(x, w, stride, bias, name=""): 326 | conv = conv2d(x, w, stride, name) 327 | return tf.add(conv, bias, name=name + "_add") 328 | 329 | 330 | def conv2d_with_bias(x, w, stride, bias, add_relu=False, name=""): 331 | conv = conv2d(x, w, stride, name) 332 | if add_relu: 333 | return tf.nn.relu(tf.add(conv, bias, name=name + "_add"), name=name + "_relu") 334 | else: 335 | return tf.add(conv, bias, name=name + "_add") 336 | 337 | 338 | def dilated_conv2d_with_bias(x, w, stride, bias, add_relu=False, name=""): 339 | conv = tf.nn.atrous_conv2d(x, w, 2, padding="SAME", name=name + "_conv") 340 | if add_relu: 341 | return tf.nn.relu(tf.add(conv, bias, name=name + "_add"), name=name + "_relu") 342 | else: 343 | return tf.add(conv, bias, name=name + "_add") 344 | 345 | 346 | def xavier_cnn_initializer(shape, uniform=True, name=None): 347 | fan_in = shape[0] * shape[1] * shape[2] 348 | fan_out = shape[0] * shape[1] * shape[3] 349 | n = fan_in + fan_out 350 | if uniform: 351 | init_range = math.sqrt(6.0 / n) 352 | return tf.random_uniform(shape, minval=-init_range, maxval=init_range, name=name) 353 | else: 354 | stddev = math.sqrt(3.0 / n) 355 | return tf.truncated_normal(shape=shape, stddev=stddev, name=name) 356 | 357 | 358 | def he_initializer(shape, name=None): 359 | n = shape[0] * shape[1] * shape[2] 360 | stddev = math.sqrt(2.0 / n) 361 | return tf.truncated_normal(shape=shape, stddev=stddev, name=name) 362 | 363 | 364 | def weight(shape, stddev=0.01, name=None, uniform=False, initializer="xavier"): 365 | if initializer == "xavier": 366 | initial = xavier_cnn_initializer(shape, uniform=uniform, name=name) 367 | elif initializer == "he": 368 | initial = he_initializer(shape, name=name) 369 | elif initializer == "uniform": 370 | initial = tf.random_uniform(shape, minval=-2.0 * stddev, maxval=2.0 * stddev) 371 | elif initializer == "stddev": 372 | initial = tf.truncated_normal(shape=shape, stddev=stddev) 373 | elif initializer == "diagonal": 374 | initial = tf.truncated_normal(shape=shape, stddev=stddev) 375 | if len(shape) == 4: 376 | initial = initial.eval() 377 | i = shape[0] // 2 378 | j = shape[1] // 2 379 | for k in range(min(shape[2], shape[3])): 380 | initial[i][j][k][k] = 1.0 381 | else: 382 | initial = tf.zeros(shape) 383 | 384 | return tf.Variable(initial, name=name) 385 | 386 | 387 | def bias(shape, initial_value=0.0, name=None): 388 | initial = tf.constant(initial_value, shape=shape) 389 | 390 | if name is None: 391 | return tf.Variable(initial) 392 | else: 393 | return tf.Variable(initial, name=name) 394 | 395 | 396 | # utilities for logging ----- 397 | 398 | def add_summaries(scope_name, model_name, var, stddev=True, mean=False, max=False, min=False): 399 | with tf.name_scope(scope_name): 400 | 401 | mean_var = tf.reduce_mean(var) 402 | if mean: 403 | tf.summary.scalar("mean/" + model_name, mean_var) 404 | 405 | if stddev: 406 | stddev_var = tf.sqrt(tf.reduce_sum(tf.square(var - mean_var))) 407 | tf.summary.scalar("stddev/" + model_name, stddev_var) 408 | 409 | if max: 410 | tf.summary.scalar("max/" + model_name, tf.reduce_max(var)) 411 | 412 | if min: 413 | tf.summary.scalar("min/" + model_name, tf.reduce_min(var)) 414 | tf.summary.histogram(model_name, var) 415 | 416 | 417 | def get_now_date(): 418 | d = datetime.datetime.today() 419 | return "%s/%s/%s %s:%s:%s" % (d.year, d.month, d.day, d.hour, d.minute, d.second) 420 | 421 | 422 | def get_loss_image(image1, image2, scale=1.0, border_size=0): 423 | if len(image1.shape) == 2: 424 | image1 = image1.reshape(image1.shape[0], image1.shape[1], 1) 425 | if len(image2.shape) == 2: 426 | image2 = image2.reshape(image2.shape[0], image2.shape[1], 1) 427 | 428 | if image1.shape[0] != image2.shape[0] or image1.shape[1] != image2.shape[1] or image1.shape[2] != image2.shape[2]: 429 | return None 430 | 431 | if image1.dtype == np.uint8: 432 | image1 = image1.astype(np.double) 433 | if image2.dtype == np.uint8: 434 | image2 = image2.astype(np.double) 435 | 436 | loss_image = np.multiply(np.square(np.subtract(image1, image2)), scale) 437 | loss_image = np.minimum(loss_image, 255.0) 438 | loss_image = loss_image[border_size:-border_size, border_size:-border_size, :] 439 | 440 | return loss_image 441 | 442 | 443 | def compute_mse(image1, image2, border_size=0): 444 | if len(image1.shape) == 2: 445 | image1 = image1.reshape(image1.shape[0], image1.shape[1], 1) 446 | if len(image2.shape) == 2: 447 | image2 = image2.reshape(image2.shape[0], image2.shape[1], 1) 448 | 449 | if image1.shape[0] != image2.shape[0] or image1.shape[1] != image2.shape[1] or image1.shape[2] != image2.shape[2]: 450 | return None 451 | 452 | if image1.dtype != np.uint8: 453 | image1 = image1.astype(np.int) 454 | image1 = image1.astype(np.double) 455 | 456 | if image2.dtype != np.uint8: 457 | image2 = image2.astype(np.int) 458 | image2 = image2.astype(np.double) 459 | 460 | mse = 0.0 461 | for i in range(border_size, image1.shape[0] - border_size): 462 | for j in range(border_size, image1.shape[1] - border_size): 463 | for k in range(image1.shape[2]): 464 | error = image1[i, j, k] - image2[i, j, k] 465 | mse += error * error 466 | 467 | return mse / ((image1.shape[0] - 2 * border_size) * (image1.shape[1] - 2 * border_size) * image1.shape[2]) 468 | 469 | 470 | def print_CNN_weight(tensor): 471 | print("Tensor[%s] shape=%s" % (tensor.name, str(tensor.get_shape()))) 472 | weight = tensor.eval() 473 | for i in range(weight.shape[3]): 474 | values = "" 475 | for x in range(weight.shape[0]): 476 | for y in range(weight.shape[1]): 477 | for c in range(weight.shape[2]): 478 | values += "%2.3f " % weight[y][x][c][i] 479 | print(values) 480 | print("\n") 481 | 482 | 483 | def print_CNN_bias(tensor): 484 | print("Tensor[%s] shape=%s" % (tensor.name, str(tensor.get_shape()))) 485 | bias = tensor.eval() 486 | values = "" 487 | for i in range(bias.shape[0]): 488 | values += "%2.3f " % bias[i] 489 | print(values + "\n") 490 | 491 | 492 | def get_test_filenames(data_folder, dataset, scale): 493 | test_folder = data_folder + "/" + test_datasets[dataset][0] +"/" 494 | 495 | test_filenames = [] 496 | for i in range(test_datasets[dataset][1], test_datasets[dataset][2]): 497 | test_filenames.append(test_folder + "img_%03d.png" % (i + 1)) 498 | 499 | return test_filenames 500 | 501 | 502 | def build_test_filenames(data_folder, dataset, scale): 503 | test_filenames = [] 504 | 505 | if dataset == "all": 506 | for test_dataset in test_datasets: 507 | test_filenames += get_test_filenames(data_folder, test_dataset, scale) 508 | else: 509 | test_filenames += get_test_filenames(data_folder, dataset, scale) 510 | 511 | return test_filenames 512 | 513 | 514 | def get_psnr(mse, max_value=255.0): 515 | if mse is None or mse == float('Inf') or mse == 0: 516 | psnr = 0 517 | else: 518 | psnr = 20 * math.log(max_value / math.sqrt(mse), 10) 519 | return psnr 520 | 521 | 522 | def print_num_of_total_parameters(): 523 | total_parameters = 0 524 | parameters_string = "" 525 | for variable in tf.trainable_variables(): 526 | 527 | shape = variable.get_shape() 528 | variable_parameters = 1 529 | for dim in shape: 530 | variable_parameters *= dim.value 531 | total_parameters += variable_parameters 532 | parameters_string += ("%s-%d, " % (str(shape), variable_parameters)) 533 | 534 | print(parameters_string) 535 | print("Total %d variables, %s params" % (len(tf.trainable_variables()), "{:,}".format(total_parameters))) 536 | 537 | 538 | # utility for extracting target files from datasets 539 | def main(): 540 | flags = tf.app.flags 541 | FLAGS = flags.FLAGS 542 | 543 | flags.DEFINE_string("org_data_folder", "org_data", "Folder for original datasets") 544 | flags.DEFINE_string("test_set", "all", "Test dataset. set5, set14, bsd100, urban100 or all are available") 545 | flags.DEFINE_integer("scale", 2, "Scale for Super Resolution (can be 2 or 4)") 546 | 547 | test_filenames = build_test_filenames(FLAGS.org_data_folder, FLAGS.test_set, FLAGS.scale) 548 | 549 | for filename in test_filenames: 550 | target_filename = "data/" + filename 551 | print("[%s] > [%s]" % (filename, target_filename)) 552 | if not os.path.exists(os.path.dirname(target_filename)): 553 | os.makedirs(os.path.dirname(target_filename)) 554 | shutil.copy(filename, target_filename) 555 | 556 | print("OK.") 557 | 558 | 559 | if __name__ == '__main__': 560 | main() 561 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import tensorflow as tf 4 | import super_resolution as sr 5 | import super_resolution_utilty as util 6 | 7 | flags = tf.app.flags 8 | FLAGS = flags.FLAGS 9 | 10 | # Model 11 | flags.DEFINE_float("initial_lr", 0.001, "Initial learning rate") 12 | flags.DEFINE_float("lr_decay", 0.5, "Learning rate decay rate when it does not reduced during specific epoch") 13 | flags.DEFINE_integer("lr_decay_epoch", 4, "Decay learning rate when loss does not decrease") 14 | flags.DEFINE_float("beta1", 0.1, "Beta1 form adam optimizer") 15 | flags.DEFINE_float("beta2", 0.1, "Beta2 form adam optimizer") 16 | flags.DEFINE_float("momentum", 0.9, "Momentum for momentum optimizer and rmsprop optimizer") 17 | flags.DEFINE_integer("feature_num", 96, "Number of CNN Filters") 18 | flags.DEFINE_integer("cnn_size", 3, "Size of CNN filters") 19 | flags.DEFINE_integer("inference_depth", 9, "Number of recurrent CNN filters") 20 | flags.DEFINE_integer("batch_num", 64, "Number of mini-batch images for training") 21 | flags.DEFINE_integer("batch_size", 41, "Image size for mini-batch") 22 | flags.DEFINE_integer("stride_size", 21, "Stride size for mini-batch") 23 | flags.DEFINE_string("optimizer", "adam", "Optimizer: can be [gd, momentum, adadelta, adagrad, adam, rmsprop]") 24 | flags.DEFINE_float("loss_alpha", 1, "Initial loss-alpha value (0-1). Don't use intermediate outputs when 0.") 25 | flags.DEFINE_integer("loss_alpha_zero_epoch", 25, "Decrease loss-alpha to zero by this epoch") 26 | flags.DEFINE_float("loss_beta", 0.0001, "Loss-beta for weight decay") 27 | flags.DEFINE_float("weight_dev", 0.001, "Initial weight stddev") 28 | flags.DEFINE_string("initializer", "he", "Initializer: can be [uniform, stddev, diagonal, xavier, he]") 29 | 30 | # Image Processing 31 | flags.DEFINE_integer("scale", 2, "Scale for Super Resolution (can be 2 or 4)") 32 | flags.DEFINE_float("max_value", 255.0, "For normalize image pixel value") 33 | flags.DEFINE_integer("channels", 1, "Using num of image channels. Use YCbCr when channels=1.") 34 | flags.DEFINE_boolean("jpeg_mode", False, "Using Jpeg mode for converting from rgb to ycbcr") 35 | flags.DEFINE_boolean("residual", False, "Using residual net") 36 | 37 | # Training or Others 38 | flags.DEFINE_boolean("is_training", True, "Train model with 91 standard images") 39 | flags.DEFINE_string("dataset", "set5", "Test dataset. [set5, set14, bsd100, urban100, all, test] are available") 40 | flags.DEFINE_string("training_set", "ScSR", "Training dataset. [ScSR, Set5, Set14, Bsd100, Urban100] are available") 41 | flags.DEFINE_integer("evaluate_step", 20, "steps for evaluation") 42 | flags.DEFINE_integer("save_step", 2000, "steps for saving learned model") 43 | flags.DEFINE_float("end_lr", 1e-5, "Training end learning rate") 44 | flags.DEFINE_string("checkpoint_dir", "model", "Directory for checkpoints") 45 | flags.DEFINE_string("cache_dir", "cache", "Directory for caching image data. If specified, build image cache") 46 | flags.DEFINE_string("data_dir", "data", "Directory for test/train images") 47 | flags.DEFINE_boolean("load_model", False, "Load saved model before start") 48 | flags.DEFINE_string("model_name", "", "model name for save files and tensorboard log") 49 | 50 | # Debugging or Logging 51 | flags.DEFINE_string("output_dir", "output", "Directory for output test images") 52 | flags.DEFINE_string("log_dir", "tf_log", "Directory for tensorboard log") 53 | flags.DEFINE_boolean("debug", False, "Display each calculated MSE and weight variables") 54 | flags.DEFINE_boolean("initialise_log", True, "Clear all tensorboard log before start") 55 | flags.DEFINE_boolean("visualize", True, "Save loss and graph data") 56 | flags.DEFINE_boolean("summary", False, "Save weight and bias") 57 | 58 | flags.DEFINE_string("file", "", "Test filename") 59 | 60 | 61 | def main(_): 62 | print("Super Resolution (tensorflow version:%s)" % tf.__version__) 63 | print("%s\n" % util.get_now_date()) 64 | 65 | if FLAGS.model_name is "": 66 | model_name = "model_F%d_D%d_LR%f" % (FLAGS.feature_num, FLAGS.inference_depth, FLAGS.initial_lr) 67 | else: 68 | model_name = "model_%s" % FLAGS.model_name 69 | model = sr.SuperResolution(FLAGS, model_name=model_name) 70 | 71 | test_filenames = [FLAGS.file] 72 | FLAGS.load_model = True 73 | 74 | model.build_embedding_graph() 75 | model.build_inference_graph() 76 | model.build_reconstruction_graph() 77 | model.build_optimizer() 78 | model.init_all_variables(load_initial_data=FLAGS.load_model) 79 | 80 | model.do_super_resolution(FLAGS.file, FLAGS.output_dir) 81 | 82 | 83 | if __name__ == '__main__': 84 | tf.app.run() 85 | --------------------------------------------------------------------------------