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
|
|
@ -33,9 +33,19 @@ Documentation Index (as per sidebar)
|
|||
:caption: Python Documentation:
|
||||
|
||||
Python Package Overview <overview/python-package>
|
||||
Python Examples <overview/python-examples>
|
||||
Python Class Documentation & Reference <overview/python-reference>
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:caption: Examples:
|
||||
|
||||
Python Examples <overview/python-examples>
|
||||
C++ Examples <overview/advanced-examples>
|
||||
Android Mobile App Integration <overview/mobile-android>
|
||||
Game Engine Godot Integration <overview/game-engine-godot>
|
||||
Example Benchmark with Matrix Multiplication <overview/matmul-benchmark>
|
||||
Convolutional Neural Network (CNN) Simple Upscale <overview/convolutional-net>
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:caption: Advanced Concepts & Deep Dives:
|
||||
|
|
@ -43,7 +53,5 @@ Documentation Index (as per sidebar)
|
|||
CI, Docker Images Docs & Tests <overview/ci-tests>
|
||||
Variable Types for Tensors, and Push/Spec Constants <overview/variable-types>
|
||||
Asynchronous & Parallel Operations <overview/async-parallel>
|
||||
Mobile App Integration (Android) <overview/mobile-android>
|
||||
Game Engine Integration (Godot Engine) <overview/game-engine-godot>
|
||||
Code Index <genindex>
|
||||
|
||||
|
|
|
|||
3
docs/overview/convolutional-net.rst
Normal file
3
docs/overview/convolutional-net.rst
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. mdinclude:: ../../examples/neural_network_vgg7/README.md
|
||||
|
||||
12
docs/overview/matmul-benchmark.rst
Normal file
12
docs/overview/matmul-benchmark.rst
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
.. mdinclude:: ../../examples/python_naive_matmul/README.md
|
||||
|
||||
|
||||
Implementation Overview
|
||||
================
|
||||
|
||||
The benchmark can be found in the `benchmark.py` file in the repo, which is outlined below. This file runs a naive implementation of the three matrix multiplication implementations to evaluate the performance of each.
|
||||
|
||||
.. literalinclude:: ../../examples/python_naive_matmuln/benchmark.py
|
||||
:language: python
|
||||
|
||||
3
docs/overview/raspberry-pi.rst
Normal file
3
docs/overview/raspberry-pi.rst
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
.. mdinclude:: ../../examples/pi4_mesa_build/README.md
|
||||
|
||||
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