forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openvinotoolkit#93 from nosovmik/rebase18
Rebase18
- Loading branch information
Showing
130 changed files
with
2,906 additions
and
2,026 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...prepare_model/convert_model/tf_specific/Convert_AttentionOCR_From_Tensorflow.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.