[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
README.md
CHANGED
@@ -8,15 +8,20 @@ Notes:
|
|
8 |
- This model can detect **faces of pixels between around 10x10 to 300x300** due to the training scheme.
|
9 |
- For details on training this model, please visit https://github.com/ShiqiYu/libfacedetection.train.
|
10 |
- This ONNX model has fixed input shape, but OpenCV DNN infers on the exact shape of input image. See https://github.com/opencv/opencv_zoo/issues/44 for more information.
|
|
|
11 |
|
12 |
Results of accuracy evaluation with [tools/eval](../../tools/eval).
|
13 |
|
14 |
| Models | Easy AP | Medium AP | Hard AP |
|
15 |
| ----------- | ------- | --------- | ------- |
|
16 |
-
| YuNet | 0.
|
17 |
-
| YuNet
|
|
|
|
|
18 |
|
19 |
\*: 'quant' stands for 'quantized'.
|
|
|
|
|
20 |
|
21 |
## Demo
|
22 |
|
|
|
8 |
- This model can detect **faces of pixels between around 10x10 to 300x300** due to the training scheme.
|
9 |
- For details on training this model, please visit https://github.com/ShiqiYu/libfacedetection.train.
|
10 |
- This ONNX model has fixed input shape, but OpenCV DNN infers on the exact shape of input image. See https://github.com/opencv/opencv_zoo/issues/44 for more information.
|
11 |
+
- `face_detection_yunet_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`.
|
12 |
|
13 |
Results of accuracy evaluation with [tools/eval](../../tools/eval).
|
14 |
|
15 |
| Models | Easy AP | Medium AP | Hard AP |
|
16 |
| ----------- | ------- | --------- | ------- |
|
17 |
+
| YuNet | 0.8844 | 0.8656 | 0.7503 |
|
18 |
+
| YuNet block | 0.8845 | 0.8652 | 0.7504 |
|
19 |
+
| YuNet quant | 0.8810 | 0.8629 | 0.7503 |
|
20 |
+
|
21 |
|
22 |
\*: 'quant' stands for 'quantized'.
|
23 |
+
\*\*: 'block' stands for 'blockwise quantized'.
|
24 |
+
|
25 |
|
26 |
## Demo
|
27 |
|