turicreate icon indicating copy to clipboard operation
turicreate copied to clipboard

How can I set some model metadata when used model.export_coreml(),Thanks.

Open HincaTseng opened this issue 7 years ago • 6 comments

How can I add the license, author get surfaced in the XCode UI. I can't find more information in Turi Create API Documentation.Could you help me with it.Thank you very much😻!

In Docs... image classification -> Introductory Example

#Export for use in Core ML. model.export_coreml('MyCustomImageClassifier.mlmodel')

In coremltools Docs... Model Interface about author

#Here is coremltools code. core_model.author = 'Hincat' core_model.license = 'BSD-3' core_model.save('Favourite.mlmodel')

HincaTseng avatar Feb 05 '18 13:02 HincaTseng

Hi, thanks for letting us know this is something you would like to be able to do. Right now there is no way to set custom meta data through Turi Create. The current way to do it is to re-open the mlmodel file using coremltools, add the desired information, and then re-save it.

gustavla avatar Feb 05 '18 15:02 gustavla

We should probably return a coremltools.models.MLModel object from export_coreml (and/or, create a new API to_coreml to just return the object without saving), so that users can directly add metadata and call save.

znation avatar Feb 05 '18 21:02 znation

Sincerely thanks again,have a good day.😸😸😸

HincaTseng avatar Feb 06 '18 11:02 HincaTseng

model.export_coreml(file, author='X', license='Y') would be a great API.

iMerica avatar Oct 01 '18 23:10 iMerica

Just chiming in to say I, too, would like a way to add metadata to a model – if for now other reason than to add versions to my models. Thanks!

jamois avatar Mar 29 '19 16:03 jamois

I just created my first useful CoreML model using turicreate and I also wanted to add this metadata.

Versioning, author and license are important to track.

triztian avatar Dec 03 '20 10:12 triztian