You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/APIExamples.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
+
docs/APIExamples.md
1
2
# API Code snippets
2
3
3
4
## Converting between MLModel and Spec
4
-
5
+
5
6
```python
6
7
import coremltools
7
8
@@ -52,7 +53,7 @@ print_network_spec(spec)
52
53
53
54
Another useful tool for visualizing CoreML models and models from other frameworks: [Netron](https://github.com/lutzroeder/netron)
54
55
55
-
## Printing the pre-processing parameters
56
+
## Printing the pre-processing parameters
56
57
57
58
This is useful for image based neural network models
58
59
@@ -77,7 +78,7 @@ print(nn.preprocessing)
77
78
## Changing MLMultiArray input/output datatypes
78
79
79
80
[Here](https://github.com/apple/coremltools/blob/d07421460f9f0ad1a2e9cf8b5248670358a24a1a/mlmodel/format/FeatureTypes.proto#L106) is the list of supported datatypes.
80
-
For instance, change the datatype from 'double' to 'float32':
81
+
For instance, change the datatype from 'double' to 'float32':
81
82
82
83
```python
83
84
import coremltools
@@ -115,7 +116,7 @@ import PIL.Image
115
116
116
117
model = coremltools.models.MLModel('path/to/the/saved/model.mlmodel')
0 commit comments