File size: 2,299 Bytes
a46f5e7
 
42d4762
 
 
 
 
 
6a15e0c
42d4762
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a15e0c
42d4762
6a15e0c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
license: mit
language:
- en
pipeline_tag: image-to-image
tags:
- dehazing
- ImageEnhancement
---

# ImageDehazing

This is a collection of image dehazing algorithms, models have been converted to run on the Axera NPU using **w8a8** quantization.

This model has been optimized with the following LoRA: 

Compatible with Pulsar2 version: 6.0 115775d3

## Convert tools links:

For those who are interested in model conversion, you can try to export axmodel through 

- [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html) 


## Support Platform

- AX650
  - [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
  - [M.2 Accelerator card](https://docs.m5stack.com/en/ai_hardware/LLM-8850_Card)
  

| 模型 | 输入分辨率 | AX650板端耗时 |
|------|-----------|--------------|
| AOD-Net | 640×480 | 2.4 ms |
| Light-Dehazenet | 480×640 | 9.2 ms |
| DehazeFormer_t | 512×512 | 161ms |
| MixDehazeNet | 256×256 | 38 ms |
| GCANet | 512×512 | 80 ms |
| GridDehazeNet | 640×480 | 113 ms |
| DEA-Net | 512×512 | 127 ms |
| FFA-Net | 512×512 | 873 ms |


## How to use

Download all files from this repository to the device

```
所有模型文件组织方式均如下:
.
|-- model_convert
|   |-- axmodel
|   |   `-- dehazeformer-t-512-constant.axmodel
|   `-- dehazeformer.json
|-- pic
|   `-- 00000_0_0.1800.png
|-- python
|   |-- axmodel_infer.py
|   `-- onnx_infer.py
`-- res
    `-- output.png

```

### Inference
#### Inference with AX650 Host, such as M4N-Dock(爱芯派Pro)
模型推理,执行命令:
```
(base) root@ax650:~/GCANet# python axmodel_infer.py
[INFO] Available providers:  ['AxEngineExecutionProvider', 'AXCLRTExecutionProvider']
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Chip type: ChipType.MC50
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Engine version: 2.12.0s
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 7.0 22923e4e
Saved: axmodel_output/0051_0.8_0.2_input_dehaze_compare.png
Saved: axmodel_output/0099_0.9_0.16_input_dehaze_compare.png


```

推理结果样例:

![GCANet dehazing result 1](GCANet/res/0099_0.9_0.16_input_dehaze_compare.png)

![GCANet dehazing result 2](GCANet/res/0051_0.8_0.2_input_dehaze_compare.png)