-
Notifications
You must be signed in to change notification settings - Fork 125
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
How to Convert Yolov3 model to CoreML format #8
Comments
Hello. @NaeemKhan333 I have not converted Yolov3. https://qiita.com/TokyoYoshida/items/68a5f77e72e48fa870e6 These are written by Japanese but you can translate by google translate or some and read, I think. May the force be with you. |
@john-rocky Thanks for reply , Yes I have tested these articles , model get converted , but when open it in xcode , there is no preview tab to test the results. In the following article The author done following two steps, I do not know where to do this steps , is it done on converted model or is it during training.
The conversion to CoreML worked fine, but when I copy it into my Xcode project and try to infer it in the Vision Framework, it fails. This is because there are three outputs of YOLOv3, and the shape is 1x1x255x13x13, 1x1x255x26x26, 1x1x255x52x52, but it cannot be interpreted by Vision Framework as it is. You need to decode the output. This blog was easy to understand about the output of YOLO v3. Decoding seems to be difficult if you make it yourself, so this time I will use this project. Ma-Dan / YOLOv3-CoreML This project assumes that the CoreML output will be 255x13x13, 255x26x26, 255x52x52.
Reshape the output of the model as follows: 1x1x255x13x13 → 255x13x13 To do this, you need to add a layer to reshape with Core ML Tools. How to edit layers with Core ML Tools It is a layer to reshape, but at first I tried it because there is add_squeeze that reduces the dimension, but for some reason it did not work. There was also add_reshape , but this did not reduce the dimension of the first 1x1 part. As a result of various investigations, there was add_reshape_static , and I was able to reshape it successfully using this. Add it as follows.
|
@john-rocky There are some steps that are missing or ambiguous in the given links. https://qiita.com/TokyoYoshida/items/68a5f77e72e48fa870e6 ( Step 6 and 7 are confusing) |
@john-rocky Thanks for the nice repository. I want to convert the Yolov3 model into core ML format. Can you guide me about the conversion process of yolov3 to coreML? Thank you
The text was updated successfully, but these errors were encountered: