Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantize all models to fp16 #183

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

WanliZhong
Copy link
Member

@WanliZhong WanliZhong commented Jun 24, 2023

This PR try to quantize all the models from float32 to float16. Accuracy evaluation results show they have almost same performance. Merged after OpenCV 4.8.0 released.

Models Dataset fp32 acc fp16 acc
YuNet WIDERFace 0.88437(E), 0.86560(M), 0.75030(H) 0.88425(E), 0.86558(M), 0.75018(H)
MobileNet V1 imagenet 0.6773(Top1), 0.8797(Top5) 0.6774(Top1), 0.88(Top5)
MobileNet V2 imagenet 0.6953(Top1), 0.8923(Top5) 0.6952(Top1), 0.8923(Top5)
PPResnet imagenet 0.8238(Top1), 0.9615(Top5) 0.8238(Top1), 0.9615(Top5)
SFace LFW 0.9940 0.9940
PPHumanSeg mini supervisely 0.91642(IoU), 0.96558(Acc) 0.91641(IoU), 0.96557(Acc)
CRNN ICDAR 2003 0.8166 0.8201
CRNN IIIT5K 0.7433 0.7493

@WanliZhong
Copy link
Member Author

WanliZhong commented Jun 24, 2023

@fengyuentau

  1. Where the original float32 models place?
  2. Should we name the new model xxx_fp16.onnx or just replace the fp32 models?
  3. What's the difference among CRNN models (ch, cn, en; 2021, 2022, 2023)?

@fengyuentau fengyuentau self-assigned this Jun 24, 2023
@fengyuentau fengyuentau added the update model request to update existing models label Jun 24, 2023
@fengyuentau
Copy link
Member

Where the original float32 models place?

We need to discuss this. Probably end up in placing in a net drive.

Should we name the new model xxx_fp16.onnx or just replace the fp32 models?

Replace.

What's the difference among CRNN models (ch, cn, en; 2021, 2022, 2023)?

ch, cn, en stand for different charsets. Each charset contains different characters. You can find them in crnn.py.

@WanliZhong
Copy link
Member Author

What's the difference between text_recognition_CRNN_EN_2021sep.onnx and text_recognition_CRNN_EN_2023feb.onnx? They have the same accuracy through evaluation in IIIT5K and ICDAR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
update model request to update existing models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants