ONNX
DaniAffCH commited on
Commit
f3c1f8c
·
1 Parent(s): 26f2fbd

[GSoC] Add block quantized models (#270)

Browse files

* Gemm and MatMul block quantization support

* refactoring

* fix indentation

* node name independent

* Block quantization tool:
- constant weight category supported
- add data type saturation
- handled the case in which all the elements within a block are the same

benchmark script modified to support block quantized models

block quantized some models

* add missing block quantized models

* formatting

* add blocked models to eval script. Evaluation yunet

* Add sface and pphumanseg evaluation, block quantization tool fix, handpose blocked model fix, removed blocked CRNN EN,

* changed evaluation metric in block_quantize script and add verbose mode

* Add evaluation for PP-ResNet and Mobilenet

* changed file suffix and update readmes

* renamed int8bq

Files changed (1) hide show
  1. README.md +7 -2
README.md CHANGED
@@ -2,6 +2,9 @@
2
 
3
  This model is ported from [PaddleHub](https://github.com/PaddlePaddle/PaddleHub) using [this script from OpenCV](https://github.com/opencv/opencv/blob/master/samples/dnn/dnn_model_runner/dnn_conversion/paddlepaddle/paddle_humanseg.py).
4
 
 
 
 
5
  ## Demo
6
 
7
  ### Python
@@ -46,11 +49,13 @@ Results of accuracy evaluation with [tools/eval](../../tools/eval).
46
 
47
  | Models | Accuracy | mIoU |
48
  | ------------------ | -------------- | ------------- |
49
- | PPHumanSeg | 0.9581 | 0.8996 |
50
- | PPHumanSeg quant | 0.4365 | 0.2788 |
 
51
 
52
 
53
  \*: 'quant' stands for 'quantized'.
 
54
 
55
  ---
56
  ## License
 
2
 
3
  This model is ported from [PaddleHub](https://github.com/PaddlePaddle/PaddleHub) using [this script from OpenCV](https://github.com/opencv/opencv/blob/master/samples/dnn/dnn_model_runner/dnn_conversion/paddlepaddle/paddle_humanseg.py).
4
 
5
+ **Note**:
6
+ - `human_segmentation_pphumanseg_2023mar_int8bq.onnx` represents the block-quantized version in int8 precision and is generated using [block_quantize.py](../../tools/quantize/block_quantize.py) with `block_size=64`.
7
+
8
  ## Demo
9
 
10
  ### Python
 
49
 
50
  | Models | Accuracy | mIoU |
51
  | ------------------ | -------------- | ------------- |
52
+ | PPHumanSeg | 0.9656 | 0.9164 |
53
+ | PPHumanSeg block | 0.9655 | 0.9162 |
54
+ | PPHumanSeg quant | 0.7285 | 0.3642 |
55
 
56
 
57
  \*: 'quant' stands for 'quantized'.
58
+ \*\*: 'block' stands for 'blockwise quantized'.
59
 
60
  ---
61
  ## License