Requirements: A few years ago, I saw some articles about the restoration of old photos, which were about converting black and white photos into color photos. Some are based on DeOldify implementations, and there is time to look into them today.
DeOldify Project Address:The hyperlink login is visible.
Looking at the introduction of the project, a .NET version is recommended, address:The hyperlink login is visible., this article attempts to test with DeOldify.NET.
Clone the project with the following command:
Run the corresponding compilation script according to your needs:
Build | Details | Script | Artistic | Basic version of Artistic colorizer with float16 weights | Compile.artistic.bat | Artistic.w32 | Artistic colorizer with float32 weights | Compile.artistic.float.bat | Artistic.simd | Artistic colorizer with SIMD acceleration and float16 weights | Compile.artistic.simd.bat | Artistic.simd.w32 | Artistic colorizer with SIMD acceleration and float32 weights | Compile.artistic.simd.float.bat | Stable | Basic version of Stable colorizer with float16 weights | Compile.stable.bat | Stable.w32 | Stable colorizer with float32 weights | Compile.stable.float.bat | Stable.simd | Stable colorizer with SIMD acceleration and float16 weights | Compile.stable.simd.bat | Stable.simd.w32 | Stable colorizer with SIMD acceleration and float32 weights | Compile.stable.simd.float.bat |
This article uses Stable.simd.w32 as an example, run the Compile.stable.simd.float.bat script, don't rush to execute it! Don't rush to execute! Don't rush to execute!
Before executing, download the model at the address:The hyperlink login is visible.
There are 4 models in the warehouse, each size is as follows, you can download it according to your needs:
Place the downloaded Stable.model file in the Implementation\src\Resources folder to download, since the source code is to package the model with embedded resources into the application, it will be very large, so we need to modify the source code.
Modify the "Implementation\src\DeOldify.cs" code as follows:
You also need to modify the "Implementation\Windows.stable.simd.float.rsp" file, which will be configured as followsDelete:
Finally, the Compile.stable.simd.float.bat script is executed, and the compilation is complete, and the file size ends up at 1.7M, which was 800M+. The compiled file is under the Release folder, and you need to create a new Resources folder under that folder and put the Stable.model file into that directory.
Run the "DeOldify.NET.stable.windows.simd.w32.exe" program, find a black and white photo from the Internet, and test it as shown below:
The comparison between the original image and the processed image is as follows:
Finished product download:
Tourists, if you want to see the hidden content of this post, please Reply |