qqc1989 commited on
Commit
7a6a599
Β·
verified Β·
1 Parent(s): dfc6b8a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +112 -3
README.md CHANGED
@@ -1,3 +1,112 @@
1
- ---
2
- license: bsd-3-clause-clear
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: bsd-3-clause-clear
3
+ language:
4
+ - en
5
+ pipeline_tag: image-to-image
6
+ tags:
7
+ - Real-ESRGAN
8
+ - SR
9
+ - Int8
10
+ ---
11
+
12
+
13
+ # Real-ESRGAN
14
+
15
+ This version of Real-ESRGAN has been converted to run on the Axera NPU using **w8a16** quantization.
16
+
17
+ This model has been optimized with the following LoRA:
18
+
19
+ Compatible with Pulsar2 version: 3.4
20
+
21
+ ## Convert tools links:
22
+
23
+ For those who are interested in model conversion, you can try to export axmodel through
24
+
25
+ - [The repo of original](https://github.com/xinntao/Real-ESRGAN)
26
+
27
+ - [The repo of AXera Platform](https://github.com/AXERA-TECH/realesrgan.axera), which you can get the detial of guide
28
+
29
+ - [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html)
30
+
31
+
32
+ ## Support Platform
33
+
34
+ - AX650
35
+ - [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
36
+ - [M.2 Accelerator card](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html)
37
+ - AX630C(todo, convert model failed, try to fix......)
38
+
39
+
40
+ |Chips| 64x64 -> 256x256 | 256x256 -> 1024x1024 |
41
+ |--|--|--|
42
+ |AX650| 15 ms | 420 ms |
43
+
44
+ ## How to use
45
+
46
+ Download all files from this repository to the device
47
+
48
+ ```
49
+ (axcl) axera@raspberrypi:~/samples/realesrgan.axera $ tree -L 1
50
+ .
51
+ β”œβ”€β”€ main_onnx.py
52
+ β”œβ”€β”€ main.py
53
+ β”œβ”€β”€ output_test_256.jpg
54
+ β”œβ”€β”€ README.md
55
+ β”œβ”€β”€ realesrgan-x4-256.axmodel
56
+ β”œβ”€β”€ realesrgan-x4-256.onnx
57
+ β”œβ”€β”€ realesrgan-x4.axmodel
58
+ β”œβ”€β”€ realesrgan-x4.onnx
59
+ β”œβ”€β”€ resize_script.py
60
+ └── test_256.jpeg
61
+
62
+ 1 directory, 10 files
63
+
64
+ ```
65
+
66
+ ### python env requirement
67
+
68
+ #### pyaxengine
69
+
70
+ https://github.com/AXERA-TECH/pyaxengine
71
+
72
+ ```
73
+ wget https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3rc0/axengine-0.1.3-py3-none-any.whl
74
+ pip install axengine-0.1.3-py3-none-any.whl
75
+ ```
76
+
77
+ #### others
78
+
79
+ ```
80
+ pip install argparse numpy opencv-python
81
+ ```
82
+
83
+ ## Inference with AX650 Host, such as M4N-Dock(爱芯派Pro)
84
+
85
+ (TODO)
86
+
87
+ ## Inference with M.2 Accelerator card
88
+
89
+ [What is M.2 Accelerator card?](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html), Show this DEMO based on Raspberry PI 5.
90
+
91
+ ```
92
+ (axcl) axera@raspberrypi:~/samples/realesrgan.axera $ python main.py --input test_256.jpeg --output output_test_256.jpg --model realesrgan-x4-256.axmodel
93
+ [INFO] Available providers: ['AXCLRTExecutionProvider']
94
+ [INFO] Using provider: AXCLRTExecutionProvider
95
+ [INFO] SOC Name: AX650N
96
+ [INFO] VNPU type: VNPUType.DISABLED
97
+ [INFO] Compiler version: 3.4 3dfd5692
98
+ input.1 [1, 256, 256, 3] uint8
99
+ <cdata 'char *' 0x262e54e0> [1, 1024, 1024, 3] float32
100
+ Original Image Shape: (243, 243, 3)
101
+ Preprocessed Image Shape: (1, 256, 256, 3)
102
+ Inference Time: 455.81 ms
103
+ Output Shape: (1, 1024, 1024, 3)
104
+ Final Output Image Shape: (1024, 1024, 3)
105
+ (axcl) axera@raspberrypi:~/samples/realesrgan.axera $
106
+ ```
107
+
108
+ **Input**
109
+ ![](./test_256.jpeg)
110
+
111
+ **Output**
112
+ ![](./output_test_256.jpeg)