提交 352f5fab 编写于 作者: L liutuo 提交者: liuqi

update

上级 cd5270e7
...@@ -25,7 +25,6 @@ The main documentation is organized into the following sections: ...@@ -25,7 +25,6 @@ The main documentation is organized into the following sections:
:caption: User guide :caption: User guide
:name: sec-user :name: sec-user
user_guide/installation
user_guide/basic_usage user_guide/basic_usage
user_guide/advanced_usage user_guide/advanced_usage
user_guide/op_lists user_guide/op_lists
......
Environment Requirement Environment Requirement
======================= ========================
MACE requires the following dependencies: MACE requires the following dependencies:
Necessary Dependencies: Necessary Dependencies:
----------------------- ------------------------
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
...@@ -51,7 +51,7 @@ Necessary Dependencies: ...@@ -51,7 +51,7 @@ Necessary Dependencies:
``export ANDROID_NDK_HOME=/path/to/ndk`` to specify ANDROID_NDK_HOME ``export ANDROID_NDK_HOME=/path/to/ndk`` to specify ANDROID_NDK_HOME
Optional Dependencies: Optional Dependencies:
--------------------- -----------------------
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
......
Manual setup Manual setup
============ =============
The setup steps are based on ``Ubuntu``. And dependencies to install can refer to :doc:`env_requirement`. The setup steps are based on ``Ubuntu``. And dependencies to install can refer to :doc:`env_requirement`.
Install Necessary Dependencies Install Necessary Dependencies
------------------------------ -------------------------------
Install Bazel Install Bazel
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Recommend bazel with version larger than ``0.13.0`` (Refer to `Bazel documentation <https://docs.bazel.build/versions/master/install.html>`__). Recommend bazel with version larger than ``0.13.0`` (Refer to `Bazel documentation <https://docs.bazel.build/versions/master/install.html>`__).
...@@ -23,7 +23,7 @@ Recommend bazel with version larger than ``0.13.0`` (Refer to `Bazel documentati ...@@ -23,7 +23,7 @@ Recommend bazel with version larger than ``0.13.0`` (Refer to `Bazel documentati
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
Install NDK Install NDK
~~~~~~~~~~~ ~~~~~~~~~~~~
Recommend NDK with version r15c or r16 (Refer to `NDK installation guide <https://developer.android.com/ndk/guides/setup#install>`__). Recommend NDK with version r15c or r16 (Refer to `NDK installation guide <https://developer.android.com/ndk/guides/setup#install>`__).
...@@ -43,7 +43,7 @@ Recommend NDK with version r15c or r16 (Refer to `NDK installation guide <https: ...@@ -43,7 +43,7 @@ Recommend NDK with version r15c or r16 (Refer to `NDK installation guide <https:
export PATH=${PATH}:${ANDROID_NDK_HOME} export PATH=${PATH}:${ANDROID_NDK_HOME}
Install extra tools Install extra tools
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
.. code:: sh .. code:: sh
...@@ -61,7 +61,7 @@ Install extra tools ...@@ -61,7 +61,7 @@ Install extra tools
filelock filelock
Install Optional Dependencies Install Optional Dependencies
----------------------------- ------------------------------
.. code:: sh .. code:: sh
......
Using docker Using docker
============ =============
Pull or Build docker image Pull or Build docker image
-------------------------- ---------------------------
MACE provides docker images with necessary dependencies installed and also Dockerfiles for images building, MACE provides docker images with necessary dependencies installed and also Dockerfiles for images building,
you can pull the existing ones directly or build them from the Dockerfiles. you can pull the existing ones directly or build them from the Dockerfiles.
...@@ -33,8 +33,9 @@ In most cases, the ``lite edition`` image can satify developer's basic needs. ...@@ -33,8 +33,9 @@ In most cases, the ``lite edition`` image can satify developer's basic needs.
We will show steps with lite edition later. We will show steps with lite edition later.
Using the image Using the image
--------------- -----------------
Create container with the following command Create container with the following command
......
Advanced usage Advanced usage
============== ===============
This part contains the full usage of MACE. This part contains the full usage of MACE.
How to build How to build
-------------------------------- -------------
==================== =========
Overview Overview
==================== =========
As mentioned in the previous part, a model deployment file defines a case of model deployment. As mentioned in the previous part, a model deployment file defines a case of model deployment.
The whole building process is loading a deployment file, converting models, building MACE and packing generated files. The whole building process is loading a deployment file, converting models, building MACE and packing generated files.
==================== ================
Deployment file Deployment file
==================== ================
One deployment file will generate one library normally, but if more than one ABIs are specified, One deployment file will generate one library normally, but if more than one ABIs are specified,
...@@ -111,9 +111,9 @@ in one deployment file. ...@@ -111,9 +111,9 @@ in one deployment file.
sha256sum path/to/your/file sha256sum path/to/your/file
==================== =========
Building Building
==================== =========
* **Build static or shared library** * **Build static or shared library**
...@@ -246,12 +246,12 @@ Use ``-h`` to get detailed help. ...@@ -246,12 +246,12 @@ Use ``-h`` to get detailed help.
How to deploy How to deploy
-------------------------------- --------------
======================== =========
Overview Overview
======================== =========
``build`` command will generate the static/shared library, model files and ``build`` command will generate the static/shared library, model files and
header files and package them as header files and package them as
......
Basic usage Basic usage
============= ============
Build and run an example model Build and run an example model
-------------------------------- -------------------------------
At first, make sure the environment has been set up correctly already (refer to :doc:`installation`). At first, make sure the environment has been set up correctly already (refer to :doc:`../installation/env_requirement`).
The followings are instructions about how to quickly build and run a provided model in *MACE Model Zoo*. The followings are instructions about how to quickly build and run a provided model in *MACE Model Zoo*.
...@@ -67,13 +67,13 @@ Here we use the mobilenet-v2 model as an example. ...@@ -67,13 +67,13 @@ Here we use the mobilenet-v2 model as an example.
Build your own model Build your own model
---------------------------- ---------------------
This part will show you how to use your pre-trained model in MACE. This part will show you how to use your pre-trained model in MACE.
================================== ======================
1. Prepare your model 1. Prepare your model
================================== ======================
Mace now supports models from Tensorflow and Caffe(more frameworks will be supported). Mace now supports models from Tensorflow and Caffe(more frameworks will be supported).
...@@ -121,9 +121,9 @@ Mace now supports models from Tensorflow and Caffe(more frameworks will be suppo ...@@ -121,9 +121,9 @@ Mace now supports models from Tensorflow and Caffe(more frameworks will be suppo
$CAFFE_ROOT/build/tools/upgrade_net_proto_binary MODEL.caffemodel MODEL.new.caffemodel $CAFFE_ROOT/build/tools/upgrade_net_proto_binary MODEL.caffemodel MODEL.new.caffemodel
============================================ ===========================================
2. Create a deployment file for your model 2. Create a deployment file for your model
============================================ ===========================================
When converting a model or building a library, MACE needs to read a YAML file which is called model deployment file here. When converting a model or building a library, MACE needs to read a YAML file which is called model deployment file here.
...@@ -145,9 +145,9 @@ Modify one of them and use it for your own case. ...@@ -145,9 +145,9 @@ Modify one of them and use it for your own case.
More details about model deployment file, please refer to :doc:`advanced_usage`. More details about model deployment file, please refer to :doc:`advanced_usage`.
====================================== ======================
3. Convert your model 3. Convert your model
====================================== ======================
When the deployment file is ready for your model, you can use MACE converter tool to convert your model(s). When the deployment file is ready for your model, you can use MACE converter tool to convert your model(s).
...@@ -167,9 +167,9 @@ The generated model files will be stored in ``build/${library_name}/model`` fold ...@@ -167,9 +167,9 @@ The generated model files will be stored in ``build/${library_name}/model`` fold
Please set ``build_type:proto`` in your deployment file before converting. Please set ``build_type:proto`` in your deployment file before converting.
The usage of ``build_type:code`` will be demonstrated in :doc:`advanced_usage`. The usage of ``build_type:code`` will be demonstrated in :doc:`advanced_usage`.
====================================== =============================
4. Build MACE into a library 4. Build MACE into a library
====================================== =============================
MACE can be built into either a static or a shared library (which is MACE can be built into either a static or a shared library (which is
specified by ``linkshared`` in YAML model deployment file). specified by ``linkshared`` in YAML model deployment file).
...@@ -190,11 +190,12 @@ The above command will generate library files in the ``build/${library_name}/lib ...@@ -190,11 +190,12 @@ The above command will generate library files in the ``build/${library_name}/lib
2. If you want to build a library for a specific soc, please refer to :doc:`advanced_usage`. 2. If you want to build a library for a specific soc, please refer to :doc:`advanced_usage`.
====================================== ==================
5. Run your model 5. Run your model
====================================== ==================
With the converted model, *.so or *.a library and header files, you can use the following commands to run and validate your model. With the converted model, the static or shared library and header files, you can use the following commands
to run and validate your model.
* **run** * **run**
...@@ -219,9 +220,9 @@ With the converted model, *.so or *.a library and header files, you can use the ...@@ -219,9 +220,9 @@ With the converted model, *.so or *.a library and header files, you can use the
python tools/converter.py benchmark --config=path/to/your/model_deployment_file.yml python tools/converter.py benchmark --config=path/to/your/model_deployment_file.yml
======================================================== =======================================
6. Deploy your model into applications 6. Deploy your model into applications
======================================================== =======================================
In the converting and building steps, you've got the static/shared library, model files and In the converting and building steps, you've got the static/shared library, model files and
header files. All of these generated files have been packaged into header files. All of these generated files have been packaged into
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册