Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 0c5f153

Browse files
aseemwbhushan23
authored andcommitted
a few fixes in the Readme (#475)
1 parent 7287539 commit 0c5f153

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ There's a comprehensive [Tutorial](https://github.com/onnx/tutorials/tree/master
1010
## [New] Beta onnx-coreml converter with Core ML 3
1111

1212
To try out the new beta converter with CoreML 3 (>= iOS 13, >= macOS 15),
13-
install coremltools 3.0b3 and coremltools 1.0b3
13+
install coremltools 3.0b6 and coremltools 1.0b3
1414

1515
```shell
1616
pip install coremltools==3.0b6
1717
pip install onnx-coreml==1.0b3
1818
```
1919

20-
With beta 3, flag `disable_coreml_rank5_mapping` which should be set to true to utilize
21-
the Core ML 3 specification is removed and replace by target iOS specific flag, taking default value of '12'
20+
In beta 3, the flag `disable_coreml_rank5_mapping` (which was part of beta 2) has been removed and instead replaced by
21+
the generic argument `target_ios` which can be used to target different versions of CoreML/iOS.
2222

23-
target_ios takes a string specifying target deployment iOS version e.g. '11.2', '12' and '13'
23+
`target_ios` takes a string specifying target deployment iOS version e.g. '11.2', '12' and '13'.
24+
By default, the converter uses the value of '12'.
2425

2526
For example:
2627
```python
2728
from onnx_coreml import convert
28-
29-
ml_model = convert(model='my_model.onnx', target_ios='13')
29+
ml_model = convert(model='my_model.onnx', target_ios='13') # to use CoreML 3
3030
```
3131

3232
## Installation
@@ -81,7 +81,8 @@ def convert(model,
8181
predicted_feature_name='classLabel',
8282
add_custom_layers = False,
8383
custom_conversion_functions = {},
84-
target_ios='12')
84+
target_ios='12'
85+
)
8586
```
8687

8788
The function returns a coreml model instance that can be saved to a .mlmodel file, e.g.:
@@ -160,22 +161,23 @@ __custom_conversion_fuctions__: dict (str: function)
160161
Examples: https://github.com/onnx/onnx-coreml/blob/master/tests/custom_layers_test.py#L43
161162

162163
__onnx_coreml_input_shape_map__: dict (str: List[int])
163-
(Optional) A dictionary with keys corresponding to the model input names. Values are a list of integers that specify
164+
(Optional)
165+
(only used if `target_ios` version is less than '13')
166+
A dictionary with keys corresponding to the model input names. Values are a list of integers that specify
164167
how the shape of the input is mapped to CoreML. Convention used for CoreML shapes is:
165168
0: Sequence, 1: Batch, 2: channel, 3: height, 4: width.
166169
For example, an input of rank 2 could be mapped as [3,4] (i.e. H,W) or [1,2] (i.e. B,C) etc.
167170

168-
__target_ios__: str
169-
Target Deployment iOS Version (default: '12')
170-
Supported iOS version options: '11.2', '12', '13'
171+
__target_ios__: str
172+
Target Deployment iOS version (default: '12')
173+
Supported values: '11.2', '12', '13'
171174
CoreML model produced by the converter will be compatible with the iOS version specified in this argument.
172-
e.g. if target_ios = '12', the converter would only utilize CoreML features released till iOS12 (equivalently macOS 10.14, watchOS 5 etc).
173-
174-
- (Supported features: https://github.com/apple/coremltools/releases/tag/v0.8)
175-
iOS 12 (CoreML 2.0)
176-
- (Supported features: https://github.com/apple/coremltools/releases/tag/v2.0)
177-
iSO 13 (CoreML 3.0)
178-
- (Supported features: https://github.com/apple/coremltools/releases/tag/3.0-beta6)
175+
e.g. if `target_ios` = '12', the converter would only utilize CoreML features released till iOS12
176+
(equivalently macOS 10.14, watchOS 5 etc).
177+
Release notes:
178+
* iOS 11 / CoreML 1: https://github.com/apple/coremltools/releases/tag/v0.8
179+
* iOS 12 / CoreML 2: https://github.com/apple/coremltools/releases/tag/v2.0
180+
* iOS 13 / CoreML 3: https://github.com/apple/coremltools/releases/tag/v3.0-beta
179181

180182
### Returns
181183
__model__: A coreml model.

0 commit comments

Comments
 (0)