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

Fix coreml quantization #434

Merged
merged 1 commit into from
Aug 5, 2022
Merged

Fix coreml quantization #434

merged 1 commit into from
Aug 5, 2022

Conversation

taka-wang
Copy link
Contributor

Instead of importing platform, you can check it by sys.platform. By the way, prefix is a missing value in this script.

Instead of importing platform, you can check it by `sys.platform`. By the way, `prefix` is a missing value in this script.
@AlexeyAB
Copy link
Collaborator

AlexeyAB commented Aug 5, 2022

@taka-wang Thanks! Have you tried conversion and output using this fix?

@AlexeyAB AlexeyAB merged commit cfde076 into WongKinYiu:main Aug 5, 2022
@taka-wang
Copy link
Contributor Author

Sure, it works on my MacOS 12.5 with python3.9.

size-8
size-16

@AlexeyAB
Copy link
Collaborator

AlexeyAB commented Aug 6, 2022

@AlexeyAB
Copy link
Collaborator

AlexeyAB commented Aug 7, 2022

What latency and CPU/ANE ratio do you get for the yolov7.pt model and did you try int8 quantization? https://takawang.medium.com/execute-yolov7-model-on-ios-devices-bd9713834ad0

@taka-wang taka-wang deleted the fix-coreml-quantization branch August 8, 2022 04:44
@taka-wang
Copy link
Contributor Author

taka-wang commented Aug 8, 2022

What latency and CPU/ANE ratio do you get for the yolov7.pt model and did you try int8 quantization? https://takawang.medium.com/execute-yolov7-model-on-ios-devices-bd9713834ad0

@AlexeyAB I follow the following two articles and update anchors accordingly.


Performance reports on these two devices, let me know if you need any further information, thanks.

  • iPad Pro 5th gen 12.9 (M1)
  • iPad Mini 6th gen (A15)
    v7_tiny_int8
    v7_32

@AlexeyAB
Copy link
Collaborator

AlexeyAB commented Aug 8, 2022

@taka-wang Thanks! Could you also show Latency and Compute Unit Mapping for YOLOv7-640-FP16?
image

@taka-wang
Copy link
Contributor Author

@AlexeyAB

Here is model reports with NMS layers for v7_640_fp16 (around 3~4ms for nms from my reports).
v7_640_fp16

For Compute Unit Mapping, maybe the upper diagram is more meaningful, thanks.
v7_640

@AlexeyAB
Copy link
Collaborator

AlexeyAB commented Aug 8, 2022

@taka-wang
So it's pretty fast, 20 FPS for YOLOv7-fp16 640x640, and mostly uses ANE (302 of 305 without NMS, and 335 of 364 with NMS).
If you would share the code or App in the AppStore with YOLOv7-fp16, I would post the link in this repository.

@taka-wang
Copy link
Contributor Author

Ok, I will let you known when I have submit the app, thanks.

@taka-wang
Copy link
Contributor Author

taka-wang commented Aug 28, 2022

@taka-wang how did you get export to add the "preview" tab? Adding --include-nms does not seem to add preview or NMS for me.

@captncollins As far as I know, --include-nms option is only for onnx or tensorrt inference. You may refer to this article, MobileNetV2 + SSDLite with Core ML, to add your own nms function. My Xcode version is Version 14.0 beta 4.

wheemyungshin-nota pushed a commit to wheemyungshin/yolov7 that referenced this pull request Dec 1, 2023
Instead of importing platform, you can check it by `sys.platform`. By the way, `prefix` is a missing value in this script.
nelioasousa pushed a commit to nelioasousa/yolov7 that referenced this pull request Apr 26, 2024
Instead of importing platform, you can check it by `sys.platform`. By the way, `prefix` is a missing value in this script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants