Skip to content

CoreML export. How to parse MLMultiArray #6123

Description

@obohrer

Search before asking

Question

Hi, I'm relatively new to this domain and currently experimenting with running CoreML to detect objects on IOS.
I've managed to train a custom model using yolov5 and tested the weights using a webcam as source. It does work 🚀.
However, when exporting the model to coreml using export.py it has been a struggle.
The exported model has the input dimension 480x640, so far so good.
However, the outputs are the following var_875, var_860.
During detection CoreML returns 2 matrices :[1 x 3 x 80 x 60 x 6] and [1 x 3 x 40 x 30 x 6]
It seems that 80 x 60 and 40 x 30 are the same ratio as the dimension (*8,*16 multiplier)
Is there documentation on how to parse such outputs?

So far I've found many functions to parse those MLMultiArrayValue but none of them are producing correct scores or bounding boxes.

Any pointers on what those dimensions means and how to parse it would be greatly appreciated and happy to contribute back with code snippets / improve the exporter (eg name the outputs correctly)

Additional

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions