RAISR-master: The test code debugging record of RAISR, a new compression technology for google Images (Python implementation, without any knowledge of python, including pip install solution ),
RAISR-master: test the new google Image Compression Technology RAISR
The test code of this article comes from: the test http://m.blog.csdn.net/sparkexpert/article/details/70786666 of the new google Image Compression Technology RAISR.
See: https://github.com/MKFMIKU/RAISR for code
When learning there are several great god's article profit and understanding: Google super resolution paper RAISR implementation summary http://blog.csdn.net/u011630458/article/details/69524582
PAISR: Rapid and Accurate Image Super Resolution
Cd .. return last layer, first return to the C root directory, layer by layer
Cd to the directory of Python 35 scrips, one layer to the next directory,
Run Pip install numpy.
Then import numpy in shell to test it.
No error reported, indicating success
Problems to be Solved:
1. Pip install script cannot be downloaded
Scipy installation depends on numpy. numpy has been installed.
Egg file, similar to Java jar: egg file, use easy-install
1) download ez_setup.py and run python ez_setup
2) easy_install *. egg
Go to this website: http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# numpy download numpy and script are stored in the scripts directory and installed in the scripts directory. Because scipy requires numpy mlk dependency, numpy on the official website does not have this dependency, and you need to download numpy first.
Test the import successfully.
Reference: https://www.zhihu.com/question/30188492? Sort = created
In the same way: before installing cv2, make sure that numpy has been installed.
Http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# numpy
2. Solved problems: h [j, t] = sparse. linalg. cg (Q [j, t], V [j, t])  Error cg
Solution: from scipy. sparse. linalg import cg
Train. py runs successfully
2. Error in Test. py
Run train. py first and run test. py.
Pip install matplotlib in Test. py
Solution: Put the items in the model folder into C: \ Program Files \ Python35 \ Lib \ site-packages.
6. Then, a new error is reported.
7. New errors
After trying n solutions, we can see that opencv3.2 cannot use imread \ imwrite to directly read and write image paths containing Chinese characters. Therefore, the following two methods are required for reading and writing:
Import cv2 as c
Import numpy as np
Img = c. imdecode (np. fromfile (path, dtype = np. uint8), 0) # Read. Last parameter: 0-gray, 1-color
C.imencode('.jpg ', img) . tofile (path1) # Write
So I directly changed the image path to the Desktop: mat = cv2.imread ("C:/Users/Administrator/Desktop/0.jpg ")
Run it. The speed starts from !!!!.
1. train set, test set, download the BSD300 dataset, and decompress the images Folder:
D: \ BaiduNetdiskDownload \ BSDS300 \ images
Modify train. py:
In the previous image, no error was reported because the following code was not run:
So as I understand it, I changed it and ran it at a very slow speed from:
Modify test. py:
A folder is created for the result.
Another error occurred yesterday, so I switched back to an original image for testing. I couldn't create my own folder once I ran it, and changed it back:
Wait for the test results to compare with the figure shown yesterday. Similarly, the test results will end from.
I want to import a jpg image, and the output is a PNG image. I changed the original image to 1/4 of the original size, and then changed it to PNG Image 0.png.
(1)put 0.png to test.pyand run it to the original pngmap fig2.png in the algorithm.
(2) manually scale 0.png images to the original 4x 0big.png
Wait until the running result starts from to and compare the RAISR of 0big.pngand fig2.png. The error is reported because the previous one was not changed to png.
After the change, run and end at. If any of the errors is reported, I did not write the changes:
After the change is made, go to "22: 07" and start at, and generate "fig2.png" successfully.
For better comparison, I will display the source image and the enlarged image separately, and modify the code to wait until the running result starts from:
In this way, the operation is successful, and they are also placed in two graphs, but one graph has two positions:
Although the size of an image is 298kb and is separated from kb, it is difficult to continue improving.
Problem to be solved on October 20: Continue to modify text1.py and check the python syntax.
MATLAB bilinear interpolation program, look at the code, don't change, end!
plt.savefigNote the sequence of saving the generated images: In
plt.show()And then called
plt.show()You have created a new blank image (coordinate axis ).
plt.savefig()The new blank image is saved. So call plt. savefig () first ().
Final modified code: