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: examples/CoreML/ONNXLive/README.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,22 @@
1
1
# ONNXLive Tutorial:
2
-
Convert style transfer models from PyTorch to CoreML.
2
+
This tutorial will show you to convert a neural style transfer model that has been exported from PyTorch and into the Apple Core ML format using ONNX. THis will allow you to easily run deep learning models on Apple devices and, in this case, live stream from the camera.
3
3
4
-
ONNX is a neural network exchange format that can be exported and imported from/to many deep learning frameworks.
5
-
In this tutorial, we will use it to convert PyTorch style transfer models to CoreML and
6
-
run them on an iPhone on the live stream from the camera.
4
+
## What is ONNX?
5
+
ONNX (Open Neural Network Exchange is an open format to represent deep learning models. With ONNX, AI developers can more easily move models between state-of-the-art tools and choose the combination that is best for them. ONNX is developed and supported by a community of partners. You can learn more about ONNX and what tools are supported by going to [onnx.ai](http://onnx.ai/).
7
6
8
-
## Overview
7
+
## Tutorial Overview
9
8
10
-
This tutorial goes through 4 steps:
9
+
This tutorial will walk you through 4 main steps:
11
10
12
11
1.[Download (or train) PyTorch style transfer models](#download-or-train-pytorch-style-transfer-models)
13
12
2.[Convert the PyTorch models to ONNX models](#convert-the-pytorch-models-to-onnx-models)
14
13
3.[Convert the ONNX models to CoreML models](#convert-the-onnx-models-to-coreml-models)
15
14
4.[Run the CoreML models in a style transfer iOS App](#run-the-coreml-models-in-a-style-transfer-ios-app)
16
15
17
-
## Preparations
16
+
## Preparing the Environment
18
17
19
-
We're working in a virtualenv to not screw with your local packages.
20
-
We're using Python 3.6 for this tutorial, but other versions should work too.
18
+
We will be working in a virtualenv in order to avoid conflicts with your local packages.
19
+
We are also using Python 3.6 for this tutorial, but other versions should work as well.
21
20
22
21
python3.6 -m venv venv
23
22
source ./venv/bin/activate
@@ -26,16 +25,16 @@ You need to install pytorch
26
25
27
26
pip install torchvision
28
27
29
-
and the onnx->coreml converter.
28
+
and the onnx->coreml converter
30
29
31
30
git clone https://github.com/onnx/onnx-coreml
32
31
cd onnx-coreml
33
32
git submodule update --recursive --init
34
33
./install.sh
35
34
cd ..
36
35
37
-
You'd also need to install XCode if you want to run the iOS style transfer app on your iPhone.
38
-
Converting the models will work on Linux too, but to run the iOS app, you need a Mac.
36
+
You will also need to install XCode if you want to run the iOS style transfer app on your iPhone.
37
+
You can also convert models in Linux, however to run the iOS app itself, you will need a Mac.
39
38
40
39
## Download (or train) PyTorch style transfer models
0 commit comments