Updated documentation to add relevant pages for releasE
Signed-off-by: Alejandro Saucedo <axsauze@gmail.com>
This commit is contained in:
parent
99df5a2be9
commit
1b0159e02c
7 changed files with 63 additions and 7 deletions
1
examples/neural_network_vgg7/.gitignore
vendored
1
examples/neural_network_vgg7/.gitignore
vendored
|
|
@ -1,3 +1,2 @@
|
|||
model-kipper
|
||||
model.json
|
||||
out.png
|
||||
|
|
|
|||
|
|
@ -1,6 +1,17 @@
|
|||
# Waifu2x VGG7 implementation
|
||||
# Convolutional Neural Network (CNN) VGG7 implementation
|
||||
|
||||
This demonstrates performing image upscaling using Python and kompute.
|
||||
This example provides an implementation of a convolutional neural network (CNN) that enables for image resolution upscaling, which means that images can improve their quality through purely the machine learning implementation.
|
||||
|
||||
This example demonstrates performing image upscaling using Kompute on the test image below.
|
||||
|
||||
In this example we will be doing the following:
|
||||
|
||||
* Import pre-trained model
|
||||
* Create Kompute code that loads model weights
|
||||
* Create Kompute shader that performs inference on image
|
||||
* Run model against image to perform upscale
|
||||
|
||||
## Import pre-trained model
|
||||
|
||||
To import the no-noise-compensation VGG7 model (into `model-kipper`):
|
||||
|
||||
|
|
@ -11,7 +22,27 @@ python3 import_vgg7.py model.json
|
|||
|
||||
Other models from the vgg\_7 set (such as `https://raw.githubusercontent.com/nagadomi/waifu2x/master/models/vgg_7/photo/noise0_model.json`) can be subsituted as desired.
|
||||
|
||||
To execute that model (no tiling is performed, so be careful about image sizes):
|
||||
## Create code that loads model weights
|
||||
|
||||
We implement the kompute logic under run_vgg7 that loads the model weights and coordinates the execution of the inference.
|
||||
|
||||
## Create Kompute shader that performs inference on image
|
||||
|
||||
Similarly, we created a compute shader that performs an inference iteration on an image provided to perfrom upscaling.
|
||||
|
||||
## run model against image to perfrom upscale
|
||||
|
||||
We now execute model against an image created by us to show how upscaling works. The image used will be the one below:
|
||||
|
||||

|
||||
|
||||
To execute that model no tiling is performed, so be careful about image sizes.
|
||||
|
||||
We can now run the command below to perform inference against the image blow.
|
||||
|
||||
`python3 run_vgg7.py w2wbinit.png out.png`
|
||||
|
||||
This would successfully upscale the resolution using the machine learning model, and the result is below:
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
BIN
examples/neural_network_vgg7/out.png
Normal file
BIN
examples/neural_network_vgg7/out.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Loading…
Add table
Add a link
Reference in a new issue