[Attention OCR] Document model support (#6244)
* Add doc How to convert AttentionOCR * Add converting * Add converting 2 * Add converting 3 * Fix document * Fix document1 * Fix document1 * Fix document1 * Fix ie_docs * Fix model/path * Add link to Convert_Model_From_TensorFlow.md * fix doc * Fix documentation
This commit is contained in:
committed by
GitHub
parent
c6654b9c81
commit
abe9005ffb
@@ -161,7 +161,7 @@ Where `HEIGHT` and `WIDTH` are the input images height and width for which the m
|
||||
* [GNMT](https://github.com/tensorflow/nmt) topology can be converted using [these instructions](tf_specific/Convert_GNMT_From_Tensorflow.md).
|
||||
* [BERT](https://github.com/google-research/bert) topology can be converted using [these instructions](tf_specific/Convert_BERT_From_Tensorflow.md).
|
||||
* [XLNet](https://github.com/zihangdai/xlnet) topology can be converted using [these instructions](tf_specific/Convert_XLNet_From_Tensorflow.md).
|
||||
|
||||
* [Attention OCR](https://github.com/emedvedev/attention-ocr) topology can be converted using [these instructions](tf_specific/Convert_AttentionOCR_From_Tensorflow.md).
|
||||
|
||||
|
||||
## Loading Non-Frozen Models to the Model Optimizer <a name="loading-nonfrozen-models"></a>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# Convert TensorFlow* Attention OCR Model to Intermediate Representation {#openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_AttentionOCR_From_Tensorflow}
|
||||
|
||||
This tutorial explains how to convert the Attention OCR (AOCR) model from the [TensorFlow* Attention OCR repository](https://github.com/emedvedev/attention-ocr) to the Intermediate Representation (IR).
|
||||
|
||||
## Extract Model from `aocr` Library
|
||||
|
||||
The easiest way to get an AOCR model is to download `aocr` Python\* library:
|
||||
```
|
||||
pip install git+https://github.com/emedvedev/attention-ocr.git@master#egg=aocr
|
||||
```
|
||||
This library contains a pretrained model and allows to train and run AOCR using the command line. After installing `aocr`, you can extract the model:
|
||||
```
|
||||
aocr export --format=frozengraph model/path/
|
||||
```
|
||||
After this step you can find the model in model/path/ folder.
|
||||
|
||||
## Convert the TensorFlow* AOCR Model to IR
|
||||
|
||||
The original AOCR model contains data preprocessing which consists of the following steps:
|
||||
* Decoding input data to binary format where input data is an image represented as a string.
|
||||
* Resizing binary image to working resolution.
|
||||
|
||||
After that, the resized image is sent to the convolution neural network (CNN). The Model Optimizer does not support image decoding so you should cut of preprocessing part of the model using '--input' command line parameter.
|
||||
```sh
|
||||
python3 path/to/model_optimizer/mo_tf.py \
|
||||
--input_model=model/path/frozen_graph.pb \
|
||||
--input="map/TensorArrayStack/TensorArrayGatherV3:0[1 32 86 1]" \
|
||||
--output "transpose_1,transpose_2" \
|
||||
--output_dir path/to/ir/
|
||||
```
|
||||
|
||||
Where:
|
||||
* `map/TensorArrayStack/TensorArrayGatherV3:0[1 32 86 1]` - name of node producing tensor after preprocessing.
|
||||
* `transpose_1` - name of the node producing tensor with predicted characters.
|
||||
* `transpose_2` - name of the node producing tensor with predicted characters probabilties
|
||||
@@ -41,6 +41,7 @@ limitations under the License.
|
||||
<tab type="user" title="Convert TensorFlow* XLNet Model to the Intermediate Representation" url="@ref openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_XLNet_From_Tensorflow"/>
|
||||
<tab type="user" title="Converting TensorFlow* Wide and Deep Models from TensorFlow" url="@ref openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_WideAndDeep_Family_Models"/>
|
||||
<tab type="user" title="Converting EfficientDet Models from TensorFlow" url="@ref openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_EfficientDet_Models"/>
|
||||
<tab type="user" title="Converting Attention OCR Model from TensorFlow" url="@ref openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_AttentionOCR_From_Tensorflow"/>
|
||||
</tab>
|
||||
<tab type="usergroup" title="Converting a MXNet* Model" url="@ref openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_MxNet">
|
||||
<tab type="user" title="Converting a Style Transfer Model from MXNet" url="@ref openvino_docs_MO_DG_prepare_model_convert_model_mxnet_specific_Convert_Style_Transfer_From_MXNet"/>
|
||||
|
||||
Reference in New Issue
Block a user