Skip to content

Commit df8b973

Browse files
authored
Re-quantify some models from per_channel mode to per_tensor mode (#90)
* re-quantize some models from per_channel mode to per_tensor mode * remove the description about per_channel
1 parent d028d74 commit df8b973

File tree

9 files changed

+45
-13
lines changed

9 files changed

+45
-13
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Guidelines:
1919
| ---------------------------------------------------- | ----------------------------- | ---------- | -------------- | ------------ | --------------- | ------------ | ----------- |
2020
| [YuNet](./models/face_detection_yunet) | Face Detection | 160x120 | 1.45 | 6.22 | 12.18 | 4.04 | 86.69 |
2121
| [SFace](./models/face_recognition_sface) | Face Recognition | 112x112 | 8.65 | 99.20 | 24.88 | 46.25 | --- |
22-
| [LPD-YuNet](./models/license_plate_detection_yunet/) | License Plate Detection | 320x240 | --- | 168.03 | 56.12 | 154.20\* | |
22+
| [LPD-YuNet](./models/license_plate_detection_yunet/) | License Plate Detection | 320x240 | --- | 168.03 | 56.12 | 29.53 | |
2323
| [DB-IC15](./models/text_detection_db) | Text Detection | 640x480 | 142.91 | 2835.91 | 208.41 | --- | --- |
2424
| [DB-TD500](./models/text_detection_db) | Text Detection | 640x480 | 142.91 | 2841.71 | 210.51 | --- | --- |
2525
| [CRNN-EN](./models/text_recognition_crnn) | Text Recognition | 100x32 | 50.21 | 234.32 | 196.15 | 125.30 | --- |
@@ -31,8 +31,8 @@ Guidelines:
3131
| [WeChatQRCode](./models/qrcode_wechatqrcode) | QR Code Detection and Parsing | 100x100 | 7.04 | 37.68 | --- | --- | --- |
3232
| [DaSiamRPN](./models/object_tracking_dasiamrpn) | Object Tracking | 1280x720 | 36.15 | 705.48 | 76.82 | --- | --- |
3333
| [YoutuReID](./models/person_reid_youtureid) | Person Re-Identification | 128x256 | 35.81 | 521.98 | 90.07 | 44.61 | --- |
34-
| [MP-PalmDet](./models/palm_detection_mediapipe) | Palm Detection | 256x256 | 15.57 | 168.37 | 50.64 | 145.56\* | --- |
35-
| [MP-HandPose](./models/handpose_estimation_mediapipe) | Hand Pose Estimation | 256x256 | 20.16 | 148.24 | 156.30 | 663.77\* | --- |
34+
| [MP-PalmDet](./models/palm_detection_mediapipe) | Palm Detection | 256x256 | 15.57 | 168.37 | 50.64 | 62.45 | --- |
35+
| [MP-HandPose](./models/handpose_estimation_mediapipe) | Hand Pose Estimation | 256x256 | 20.16 | 148.24 | 156.30 | 42.70 | --- |
3636

3737
\*: Models are quantized in per-channel mode, which run slower than per-tensor quantized models on NPU.
3838

models/handpose_estimation_mediapipe/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ This model is converted from Tensorflow-JS to ONNX using following tools:
99
- tf_saved_model to ONNX: https://github.com/onnx/tensorflow-onnx
1010
- simplified by [onnx-simplifier](https://github.com/daquexian/onnx-simplifier)
1111

12-
Also note that the model is quantized in per-channel mode with [Intel's neural compressor](https://github.com/intel/neural-compressor), which gives better accuracy but may lose some speed.
13-
1412
## Demo
1513

1614
Run the following commands to try the demo:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:05a0cc7d3f4dfa135795173c2458f5ac01c8c93e16596b1ac02c144e3d236e77
3-
size 1607095
2+
oid sha256:2ebaf701aa5f13de101a6d27ae5b1b011201f0b4d177e06d57e4f7f5970e985b
3+
size 1559235
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:26c4769e86df6a079f538f9daf4a9c7b1f386dccab9bd1292c75fdf9a37ff240
3-
size 1129229
2+
oid sha256:933f8332152718d2b7b30ba40cf07fbbb4099d7ecc3709708862e3d36b5661a9
3+
size 1087947

models/palm_detection_mediapipe/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ This model detects palm bounding boxes and palm landmarks, and is converted from
66
- tf_saved_model to ONNX: https://github.com/onnx/tensorflow-onnx
77
- simplified by [onnx-simplifier](https://github.com/daquexian/onnx-simplifier)
88

9-
Also note that the model is quantized in per-channel mode with [Intel's neural compressor](https://github.com/intel/neural-compressor), which gives better accuracy but may lose some speed.
10-
119
## Demo
1210

1311
Run the following commands to try the demo:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:e0430ef470cceb826446585a6c7af6911bba58affb416186cb134e6ddc8a76de
3-
size 3182222
2+
oid sha256:4f634e62a9f4a838c953c8d25389c340568234c473aff383986aa854ab1b36f4
3+
size 3120401

tools/quantize/inc_configs/lpd_yunet.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ quantization: # optional. tuning constrai
3232
dtype: float32
3333
label: True
3434

35+
model_wise: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
36+
weight:
37+
granularity: per_tensor
38+
scheme: asym
39+
dtype: int8
40+
algorithm: minmax
41+
activation:
42+
granularity: per_tensor
43+
scheme: asym
44+
dtype: int8
45+
algorithm: minmax
46+
3547
tuning:
3648
accuracy_criterion:
3749
relative: 0.02 # optional. default value is relative, other value is absolute. this example allows relative accuracy loss: 1%.

tools/quantize/inc_configs/mp_handpose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ quantization: # optional. tuning constrai
3232
dtype: float32
3333
label: True
3434

35+
model_wise: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
36+
weight:
37+
granularity: per_tensor
38+
scheme: asym
39+
dtype: int8
40+
algorithm: minmax
41+
activation:
42+
granularity: per_tensor
43+
scheme: asym
44+
dtype: int8
45+
algorithm: minmax
46+
3547
tuning:
3648
accuracy_criterion:
3749
relative: 0.02 # optional. default value is relative, other value is absolute. this example allows relative accuracy loss: 1%.

tools/quantize/inc_configs/mp_palmdet.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ quantization: # optional. tuning constrai
3232
dtype: float32
3333
label: True
3434

35+
model_wise: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
36+
weight:
37+
granularity: per_tensor
38+
scheme: asym
39+
dtype: int8
40+
algorithm: minmax
41+
activation:
42+
granularity: per_tensor
43+
scheme: asym
44+
dtype: int8
45+
algorithm: minmax
46+
3547
tuning:
3648
accuracy_criterion:
3749
relative: 0.02 # optional. default value is relative, other value is absolute. this example allows relative accuracy loss: 1%.

0 commit comments

Comments
 (0)