├── .gitignore
├── LICENSE
├── README.md
├── human-pose-estimator
├── README.md
├── examples
│ ├── app.js
│ ├── browser-image.html
│ └── browser-video.html
├── model
│ ├── conversion-manifest.json
│ ├── group1-shard1of2
│ ├── group1-shard2of2
│ └── model.json
├── package-lock.json
├── package.json
├── rollup.config.js
├── src
│ ├── human-pose-estimator-coco.js
│ ├── human-pose-estimator-input.js
│ ├── human-pose-estimator-model.js
│ ├── human-pose-estimator-output.js
│ └── human-pose-estimator.js
└── test
│ ├── Pilots.jpg
│ └── test.js
└── image-segmenter
├── README.md
├── examples
├── app.js
├── browser-image.html
└── browser-video.html
├── model
├── conversion-manifest.json
├── group1-shard1of3
├── group1-shard2of3
├── group1-shard3of3
└── model.json
├── package-lock.json
├── package.json
├── rollup.config.js
├── src
├── image-segmenter-input.js
├── image-segmenter-map.js
├── image-segmenter-model.js
├── image-segmenter-output.js
└── image-segmenter.js
└── test
├── group.jpg
└── test.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .cache
3 | .vscode
4 |
5 | *.tgz
6 |
7 | dist/
8 | node_modules/
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Pre-trained Model Asset eXchange (MAX) models for TensorFlow.js
2 |
3 | This repository is a collection of MAX models that have been converted for use in TensorFlow.js applications.
4 |
5 |
6 | ## Resources
7 |
8 | - [Model Asset eXchange (MAX)](https://ibm.biz/max-models)
9 | - [TensorFlow.js](https://www.tensorflow.org/js/)
10 |
11 | ## License
12 |
13 | [Apache-2.0](LICENSE)
14 |
--------------------------------------------------------------------------------
/human-pose-estimator/README.md:
--------------------------------------------------------------------------------
1 | # MAX for TensorFlow.js: Human Pose Estimator
2 |
3 | This is a TensorFlow.js port of the [MAX Human Pose Estimator](https://developer.ibm.com/exchanges/models/all/max-human-pose-estimator) pre-trained model. The Human Pose Estimator was trained to detect humans in an image and identifies the body parts, including nose, neck, eyes, shoulders, elbows, wrists, hips, knees, and ankles.
4 |
5 | ## Install
6 |
7 | ### Browser
8 |
9 | ```html
10 |
11 |
12 | ```
13 |
14 | By default when the `@codait/max-human-pose-estimator` JavaScript module is loaded, the model is automatically loaded and the cache warmed up (by running inference against an all zero input). To change this default behavior (and prevent the model from being automatically initialized) set attribute `data-init-model="false"` in the `script` tag for the `@codait/max-human-pose-estimator`.
15 |
16 | ### Node.js
17 |
18 | ```
19 | npm install --save @codait/max-human-pose-estimator
20 | ```
21 |
22 | ## Usage
23 |
24 | The complete examples for browser and Node.js environments are in the [`/examples`](https://github.com/CODAIT/max-tfjs-models/tree/master/human-pose-estimator/examples) directory.
25 |
26 | ### Browser
27 |
28 | > **Note**: _When loaded in a browser, the global variable `poseEstimator` will be available to access the API._
29 |
30 | ```javascript
31 | let image = document.getElementById('my-image')
32 |
33 | poseEstimator
34 | .predict(image)
35 | .then(prediction => {
36 | console.log(prediction.posesDetected)
37 | })
38 | ```
39 |
40 | ### Node.js
41 |
42 | ```javascript
43 | const { predict } = require('@codait/max-human-pose-estimator')
44 | const { read, MIME_PNG } = require('jimp')
45 | const { createCanvas, loadImage } = require('canvas')
46 |
47 | const createCanvasElement = function (imageInput) {
48 | return new Promise(async (resolve, reject) => {
49 | const img = await loadImage(imageInput)
50 | let canvas = createCanvas(img.width, img.height)
51 | let ctx = canvas.getContext('2d')
52 | await ctx.drawImage(img, 0, 0)
53 | resolve(canvas)
54 | })
55 | }
56 |
57 | const imagePath = `file://${ __dirname}/my-image.jpg`
58 |
59 | read(imagePath)
60 | .then(imageData => imageData.scaleToFit(512, 512).getBufferAsync(MIME_PNG))
61 | .then(imageBuffer => createCanvasElement(imageBuffer))
62 | .then(imageElement => predict(imageElement))
63 | .then(prediction => {
64 | console.log(prediction.posesDetected)
65 | })
66 | ```
67 |
68 | ### API
69 |
70 | - **loadModel(_init_)**
71 |
72 | Loads the model files.
73 |
74 | `init` - if `true`, a prediction will be triggered using an all zero Tensor to warm up the model (helps increase speed of subsequent predictions when running in a browser). Default is `true`.
75 |
76 | Returns the TensorFlow.js model.
77 |
78 | - **processInput(_image_, _mirrorImage_)**
79 |
80 | Processes the input image to the shape and format expected by the model. The image is resized/scaled (to max width or height of 432px) and converted to a 4D Tensor.
81 |
82 | `image` - an instance of HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement.
83 | `mirrorImage` - if `true` the image will be flipped horizontally (e.g., mirrored webcam video). Default is `false`.
84 |
85 | Returns a 4D Tensor representation of the image that can be passed to the model.
86 |
87 | - **runInference(_inputTensor_)**
88 |
89 | Runs inference on the input Tensor passed. The output is 4D Tensor comprised of the concatenation of the heatmap and part affinity field map predictions
90 |
91 | `inputTensor` - a 4D Tensor representing an ImageData
92 |
93 | Returns the inference results.
94 |
95 | - **processOutput(_inferenceResults_)**
96 |
97 | Processes the inference output replacing the output Tensor with calculated poses along with the heat map and part affinity field map predictions.
98 |
99 | `inferenceResults` - the model output from running inference.
100 |
101 | Returns an object containing
102 |
103 | - `heatMap`: a 2D array with the predicted heat map
104 | - `pafMap`: a 2D array with the predicted part affinity field map
105 | - `posesDetected`: an array of human poses detected in the image
106 | - `imageSize`: an object with the width and height of the resized image
107 |
108 | - **predict(_image_, _mirrorImage_)**
109 |
110 | Loads the model (if not loaded), processes the input image, runs inference, processes the inference output, and returns a prediction object. This is a convenience function to avoid having to call each of the functions (`loadModel`, `processInput`, `runInference`, `processOutput`) individually.
111 |
112 | `image` - an instance of HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement.
113 | `mirrorImage` - if `true` the image will be flipped horizontally (e.g., mirrored webcam video). Default is `false`.
114 |
115 | Returns an object containing
116 |
117 | - `heatMap`: a 2D array with the predicted heat map
118 | - `pafMap`: a 2D array with the predicted part affinity field map
119 | - `posesDetected`: an array of human poses detected in the image
120 | - `imageSize`: an object with the width and height of the resized image
121 |
122 | - **cocoUtil()**
123 |
124 | An object containing a set of helper variables for processing the inference output:
125 |
126 | - `parts`: an array of named body parts with the part's index corresponding to its ID
127 | - `pairs`: a 2D array listing body part connections (e.g., [1, 2] = Neck to Right Shoulder)
128 | - `pairsNetwork`: a 2D array listing part affinity field indexing corresponding to the each pair of body parts
129 | - `colors`: a 2D array of RBG color values
130 |
131 | - **config(_params_)**
132 |
133 | Set or get configuration params for the post processing calculations. Do not include _`params`_ to get the configuration values.
134 |
135 | `params` - an object containing parameters to set.
136 |
137 | Available parameters include:
138 |
139 | - `nmsWindowSize`: pixel size when applying non-maximum suppression to calculate peaks (default: 6)
140 | - `nmsThreshold`: minimum pixel score required when calculating peaks (default: 0.001)
141 | - `localPAFThreshold`: minimum part affinity field score when calculating possible pairs (default: 0.141)
142 | - `partScoreThreshold`: minimum part score required when calculating parts (default: 0.247)
143 | - `pafCountThreshold`: minimum part affinity field values when calculating possible pairs (default: 4)
144 | - `partCountThreshold`: minimum parts required when calculating poses (default: 4)
145 |
146 | - **version**
147 |
148 | Returns the version
149 |
150 | ## Model
151 |
152 | The model assets produced by converting the pre-trained model to the TensorFlow.js format can be found in the [`/model`](https://github.com/CODAIT/max-tfjs-models/tree/master/human-pose-estimator/model) directory.
153 |
154 | ## Resources
155 |
156 | - [MAX Human Pose Estimator](https://developer.ibm.com/exchanges/models/all/max-human-pose-estimator)
157 | - [Use your arms to make music](https://developer.ibm.com/patterns/making-music-with-the-max-human-pose-estimator-and-tensorflowjs/)
158 | - [veremax](https://ibm.biz/veremax)
159 | - [TensorFlow.js](https://www.tensorflow.org/js/)
160 | - Human pose estimation using OpenPose with TensorFlow - [Part 1](https://arvrjourney.com/human-pose-estimation-using-openpose-with-tensorflow-part-1-7dd4ca5c8027), [Part II](https://arvrjourney.com/human-pose-estimation-using-openpose-with-tensorflow-part-2-e78ab9104fc8)
161 |
162 | ## License
163 |
164 | [Apache-2.0](https://github.com/CODAIT/max-tfjs-models/blob/master/LICENSE)
165 |
--------------------------------------------------------------------------------
/human-pose-estimator/examples/app.js:
--------------------------------------------------------------------------------
1 | // const { predict, version } = require('@codait/max-human-pose-estimator')
2 | const { predict, version } = require('../dist/max.humanpose.cjs.js')
3 |
4 | const { read, MIME_PNG } = require('jimp')
5 | const { createCanvas, loadImage } = require('canvas')
6 |
7 | const createCanvasElement = function (imageInput) {
8 | let canvas = null
9 | return loadImage(imageInput).then(img => {
10 | canvas = createCanvas(img.width, img.height)
11 | const ctx = canvas.getContext('2d')
12 | return ctx.drawImage(img, 0, 0)
13 | }).then(() => {
14 | return canvas
15 | })
16 | }
17 |
18 | if (process.argv.length < 3) {
19 | console.log('please pass an image to process. ex:')
20 | console.log(' node app.js /path/to/image.jpg')
21 | } else {
22 | console.log(`@codait/max-human-pose-estimator v${version}`)
23 | const imagePath = process.argv[2]
24 |
25 | read(imagePath)
26 | .then(imageData => imageData.scaleToFit(512, 512).getBufferAsync(MIME_PNG))
27 | .then(imageBuffer => createCanvasElement(imageBuffer))
28 | .then(imageElement => predict(imageElement))
29 | .then(prediction => {
30 | console.log(prediction)
31 | })
32 | }
33 |
--------------------------------------------------------------------------------
/human-pose-estimator/examples/browser-image.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | human-pose-estimator // image
5 |
6 |
124 |
125 |
126 |
human-pose-estimator // image
127 |
128 |
129 | run inference
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/human-pose-estimator/examples/browser-video.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | human-pose-estimator // video
5 |
16 |
17 |
111 |
112 |
113 |
human-pose-estimator // video
114 |
115 | Start webcam
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/human-pose-estimator/model/conversion-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "MAX-Human-Pose-Estimator",
3 | "url": "https://developer.ibm.com/exchanges/models/all/max-human-pose-estimator",
4 | "source": "human-pose-estimator/1.0/assets.tar.gz/human-pose-estimator-tensorflow.pb",
5 | "framework": "tf_js",
6 | "converter": {
7 | "tensorflowjs": {
8 | "version": "0.8.0",
9 | "params": {
10 | "input_format": "tf_frozen_model",
11 | "output_node_names": "Openpose/concat_stage7",
12 | "output_json": true
13 | }
14 | }
15 | },
16 | "output": [
17 | "group1-shard1of2",
18 | "group1-shard2of2",
19 | "model.json"
20 | ]
21 | }
--------------------------------------------------------------------------------
/human-pose-estimator/model/group1-shard1of2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CODAIT/max-tfjs-models/7104d423078d05adb80249ceed565211fcaa116e/human-pose-estimator/model/group1-shard1of2
--------------------------------------------------------------------------------
/human-pose-estimator/model/group1-shard2of2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CODAIT/max-tfjs-models/7104d423078d05adb80249ceed565211fcaa116e/human-pose-estimator/model/group1-shard2of2
--------------------------------------------------------------------------------
/human-pose-estimator/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@codait/max-human-pose-estimator",
3 | "version": "0.3.0",
4 | "description": "Detect humans in an image and estimate the pose for each person.",
5 | "main": "dist/max.humanpose.cjs.js",
6 | "module": "dist/max.humanpose.es.js",
7 | "jsdelivr": "dist/max.humanpose.min.js",
8 | "unpkg": "dist/max.humanpose.min.js",
9 | "scripts": {
10 | "clean": "rimraf dist && mkdirp dist",
11 | "rollup": "rollup --config rollup.config.js",
12 | "uglify": "uglifyjs dist/max.humanpose.js -mc --source-map --output dist/max.humanpose.min.js",
13 | "copy": "ncp model dist/model",
14 | "build": "npm run clean && npm run rollup && npm run uglify",
15 | "test": "standard && npm run build && jasmine test/test.js"
16 | },
17 | "files": [
18 | "dist",
19 | "model"
20 | ],
21 | "author": "va barbosa (https://github.com/vabarbosa/)",
22 | "license": "Apache-2.0",
23 | "keywords": [
24 | "human pose estimator",
25 | "pose detection",
26 | "openpose",
27 | "model asset exchange",
28 | "max",
29 | "tensorflow.js",
30 | "tensorflowjs",
31 | "tensorflow",
32 | "tf.js",
33 | "tfjs",
34 | "machine learning"
35 | ],
36 | "repository": {
37 | "type": "git",
38 | "url": "git+https://github.com/CODAIT/max-tfjs-models.git"
39 | },
40 | "bugs": {
41 | "url": "https://github.com/CODAIT/max-tfjs-models/issues"
42 | },
43 | "homepage": "https://github.com/CODAIT/max-tfjs-models/tree/master/human-pose-estimator#readme",
44 | "dependencies": {
45 | "@tensorflow/tfjs-node": "^2.0.1"
46 | },
47 | "devDependencies": {
48 | "canvas": "^2.6.1",
49 | "jasmine": "^3.5.0",
50 | "jimp": "^0.14.0",
51 | "mkdirp": "^1.0.4",
52 | "ncp": "^2.0.0",
53 | "rimraf": "^3.0.2",
54 | "rollup": "^2.23.0",
55 | "@rollup/plugin-json": "^4.1.0",
56 | "@rollup/plugin-replace": "^2.3.3",
57 | "standard": "^14.3.4",
58 | "uglify-es": "^3.3.9"
59 | },
60 | "standard": {
61 | "ignore": [
62 | "dist"
63 | ]
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/human-pose-estimator/rollup.config.js:
--------------------------------------------------------------------------------
1 | import replace from '@rollup/plugin-replace'
2 | import json from '@rollup/plugin-json'
3 |
4 | const jsonPlugin = json({
5 | include: 'package.json',
6 | preferConst: true,
7 | indent: ' ',
8 | compact: true,
9 | namedExports: ['version']
10 | })
11 |
12 | export default [
13 | {
14 | input: 'src/human-pose-estimator.js',
15 | output: [
16 | {
17 | format: 'iife',
18 | compact: true,
19 | name: 'poseEstimator',
20 | file: 'dist/max.humanpose.js'
21 | },
22 | {
23 | format: 'es',
24 | compact: true,
25 | name: 'poseEstimator',
26 | file: 'dist/max.humanpose.es.js'
27 | }
28 | ],
29 | plugins: [
30 | replace({
31 | 'process.rollupBrowser': true
32 | }),
33 | jsonPlugin
34 | ]
35 | }, {
36 | input: 'src/human-pose-estimator.js',
37 | output: [
38 | {
39 | format: 'cjs',
40 | compact: true,
41 | name: 'poseEstimator',
42 | file: 'dist/max.humanpose.cjs.js'
43 | }
44 | ],
45 | plugins: [
46 | replace({
47 | 'process.rollupBrowser': false
48 | }),
49 | jsonPlugin
50 | ]
51 | }
52 | ]
53 |
--------------------------------------------------------------------------------
/human-pose-estimator/src/human-pose-estimator-coco.js:
--------------------------------------------------------------------------------
1 |
2 | export const cocoParts = [
3 | 'Nose',
4 | 'Neck',
5 | 'RShoulder',
6 | 'RElbow',
7 | 'RWrist',
8 | 'LShoulder',
9 | 'LElbow',
10 | 'LWrist',
11 | 'RHip',
12 | 'RKnee',
13 | 'RAnkle',
14 | 'LHip',
15 | 'LKnee',
16 | 'LAnkle',
17 | 'REye',
18 | 'LEye',
19 | 'REar',
20 | 'LEar'
21 | ]
22 |
23 | export const cocoPairs = [
24 | [1, 2],
25 | [1, 5],
26 | [2, 3],
27 | [3, 4],
28 | [5, 6],
29 | [6, 7],
30 | [1, 8],
31 | [8, 9],
32 | [9, 10],
33 | [1, 11],
34 | [11, 12],
35 | [12, 13],
36 | [1, 0],
37 | [0, 14],
38 | [14, 16],
39 | [0, 15],
40 | [15, 17],
41 | [2, 16],
42 | [5, 17]
43 | ]
44 |
45 | export const cocoPairsNetwork = [
46 | [12, 13],
47 | [20, 21],
48 | [14, 15],
49 | [16, 17],
50 | [22, 23],
51 | [24, 25],
52 | [0, 1],
53 | [2, 3],
54 | [4, 5],
55 | [6, 7],
56 | [8, 9],
57 | [10, 11],
58 | [28, 29],
59 | [30, 31],
60 | [34, 35],
61 | [32, 33],
62 | [36, 37],
63 | [18, 19],
64 | [26, 27]
65 | ]
66 |
67 | export const cocoColors = [
68 | [255, 0, 0],
69 | [255, 85, 0],
70 | [255, 170, 0],
71 | [255, 255, 0],
72 | [170, 255, 0],
73 | [85, 255, 0],
74 | [0, 255, 0],
75 | [0, 255, 85],
76 | [0, 255, 170],
77 | [0, 255, 255],
78 | [0, 170, 255],
79 | [0, 85, 255],
80 | [0, 0, 255],
81 | [85, 0, 255],
82 | [170, 0, 255],
83 | [255, 0, 255],
84 | [255, 0, 170],
85 | [255, 0, 85]
86 | ]
87 |
--------------------------------------------------------------------------------
/human-pose-estimator/src/human-pose-estimator-input.js:
--------------------------------------------------------------------------------
1 | /* globals tf, Image */
2 |
3 | const IMAGESIZE = 432
4 |
5 | const computeTargetSize = function (width, height) {
6 | const resizeRatio = IMAGESIZE / Math.max(width, height)
7 |
8 | return {
9 | width: Math.round(resizeRatio * width),
10 | height: Math.round(resizeRatio * height)
11 | }
12 | }
13 |
14 | const getImageData = function (imageInput) {
15 | if (process.rollupBrowser) {
16 | return new Promise((resolve, reject) => {
17 | if (typeof imageInput === 'string') {
18 | const img = new Image()
19 | img.onload = () => resolve(img)
20 | img.onerror = err => reject(err)
21 | img.src = imageInput
22 | } else {
23 | resolve(imageInput)
24 | }
25 | })
26 | } else {
27 | return Promise.resolve(imageInput)
28 | }
29 | }
30 |
31 | const imageToTensor = function (imageData, mirrorImage = false) {
32 | return tf.tidy(() => {
33 | let imgTensor = tf.browser.fromPixels(imageData)
34 | if (mirrorImage) {
35 | imgTensor = imgTensor.reverse(1)
36 | }
37 | const targetSize = computeTargetSize(imgTensor.shape[0], imgTensor.shape[1])
38 | return imgTensor
39 | .resizeBilinear([targetSize.width, targetSize.height])
40 | .toFloat()
41 | .expandDims()
42 | })
43 | }
44 |
45 | /**
46 | * convert image to Tensor input required by the model
47 | *
48 | * @param {HTMLImageElement} imageInput - the image element
49 | * @param {boolean} mirrorImage - horizontally flip image (default: false)
50 | */
51 | const preprocess = function (imageInput, mirrorImage = false) {
52 | return getImageData(imageInput)
53 | .then(imageData => {
54 | return imageToTensor(imageData, mirrorImage)
55 | })
56 | .then(inputTensor => {
57 | return Promise.resolve(inputTensor)
58 | })
59 | .catch(err => {
60 | console.error(err)
61 | return Promise.reject(err)
62 | })
63 | }
64 |
65 | export { preprocess }
66 |
--------------------------------------------------------------------------------
/human-pose-estimator/src/human-pose-estimator-model.js:
--------------------------------------------------------------------------------
1 | /* globals tf */
2 |
3 | let modelPath = null
4 |
5 | if (!process.rollupBrowser) {
6 | modelPath = `file://${__dirname}/../model/model.json`
7 | } else {
8 | modelPath = 'https://s3.us.cloud-object-storage.appdomain.cloud/codait-cos-max/max-human-pose-estimator/tfjs/0.1.0/model.json'
9 | }
10 |
11 | let model = null
12 | let warmed = false
13 |
14 | /**
15 | * load the human pose estimator model
16 | */
17 | const load = function (initialize) {
18 | if (!model) {
19 | // console.log('loading model...')
20 | // console.time('model load')
21 | return tf.loadGraphModel(modelPath)
22 | .then(m => {
23 | // console.timeEnd('model load')
24 | model = m
25 | if (istrue(initialize)) {
26 | warmup()
27 | }
28 | return Promise.resolve(model)
29 | })
30 | .catch(err => {
31 | // console.timeEnd('model load')
32 | console.error(err)
33 | return Promise.reject(err)
34 | })
35 | } else if (istrue(initialize) && !warmed) {
36 | warmup()
37 | return Promise.resolve(model)
38 | } else {
39 | return Promise.resolve(model)
40 | }
41 | }
42 |
43 | /**
44 | * run the model to get a prediction
45 | */
46 | const run = function (imageTensor) {
47 | if (!imageTensor) {
48 | console.error('no image provided')
49 | throw new Error('no image provided')
50 | } else if (!model) {
51 | console.error('model not available')
52 | throw new Error('model not available')
53 | } else {
54 | // console.log('running model...')
55 | // console.time('model inference')
56 | const results = model.predict(imageTensor)
57 | // console.timeEnd('model inference')
58 | warmed = true
59 | return results
60 | }
61 | }
62 |
63 | /**
64 | * run inference on the TensorFlow.js model
65 | */
66 | const inference = function (imageTensor) {
67 | return load(false).then(() => {
68 | try {
69 | const results = run(imageTensor)
70 | return Promise.resolve(results)
71 | .then((result) => {
72 | tf.dispose(imageTensor)
73 | return result
74 | })
75 | } catch (err) {
76 | return Promise.reject(err)
77 | }
78 | })
79 | }
80 |
81 | const warmup = function () {
82 | try {
83 | run(tf.zeros([1, 512, 512, 3]))
84 | } catch (err) { }
85 | }
86 |
87 | const istrue = function (param) {
88 | return param === null ||
89 | typeof param === 'undefined' ||
90 | (typeof param === 'string' && param.toLowerCase() === 'true') ||
91 | (typeof param === 'boolean' && param)
92 | }
93 |
94 | if (process.rollupBrowser) {
95 | const init = document.currentScript.getAttribute('data-init-model')
96 | if (istrue(init)) {
97 | load(true)
98 | }
99 | }
100 |
101 | export { load, inference }
102 |
--------------------------------------------------------------------------------
/human-pose-estimator/src/human-pose-estimator-output.js:
--------------------------------------------------------------------------------
1 | /* globals tf */
2 |
3 | import { cocoParts, cocoPairs, cocoPairsNetwork } from './human-pose-estimator-coco.js'
4 |
5 | const HeatMapCount = 19
6 | const PafMapCount = 38
7 | const MaxPairCount = 17
8 | const DIMFACTOR = 8
9 |
10 | const DEFAULTCONFIG = {
11 | nmsWindowSize: 6,
12 | nmsThreshold: 0.001,
13 | localPAFThreshold: 0.141,
14 | partScoreThreshold: 0.247,
15 | pafCountThreshold: 4,
16 | partCountThreshold: 4
17 | }
18 |
19 | let cfg = Object.assign({}, DEFAULTCONFIG)
20 |
21 | const configuration = function (config) {
22 | cfg = Object.assign({}, DEFAULTCONFIG, (typeof config === 'object' ? config : {}))
23 | }
24 |
25 | const estimatePoses = function (heatmapTensor, pafmapTensor) {
26 | return tf.tidy(() => {
27 | const heatmap = heatmapTensor.bufferSync()
28 | const pafmap = pafmapTensor.bufferSync()
29 |
30 | // compute possible parts candidates
31 | const partCandidates = computeParts(heatmap)
32 | // compute possible pairs candidates
33 | const pairCandidates = computePairs(pafmap, partCandidates)
34 | // compute possible poses
35 | const poseCandidates = computePoses(partCandidates, pairCandidates)
36 |
37 | tf.dispose(heatmapTensor)
38 | tf.dispose(pafmapTensor)
39 | // create the JSON response (with bodyParts, poseLines, etc)
40 | return formatResponse(poseCandidates)
41 | })
42 | }
43 |
44 | const computeParts = function (heatmap) {
45 | const height = heatmap.shape[0]
46 | const width = heatmap.shape[1]
47 | const depth = heatmap.shape[2] - 1
48 | const parts = new Array(depth)
49 |
50 | // extract peak parts from heatmap
51 | for (var y = 0; y < height; y++) {
52 | for (var x = 0; x < width; x++) {
53 | for (var d = 0; d < depth; d++) {
54 | if (!parts[d]) {
55 | parts[d] = []
56 | }
57 | const score = heatmap.get(y, x, d)
58 | if (score > cfg.nmsThreshold && isMaximum(score, y, x, d, heatmap)) {
59 | parts[d].push([y, x, score])
60 | }
61 | }
62 | }
63 | }
64 |
65 | return parts
66 | }
67 |
68 | const isMaximum = function (score, y, x, d, heatmap) {
69 | let isMax = true
70 | const height = heatmap.shape[0]
71 | const width = heatmap.shape[1]
72 |
73 | const h1 = Math.max(0, y - cfg.nmsWindowSize)
74 | const h2 = Math.min(height - 1, y + cfg.nmsWindowSize)
75 | const w1 = Math.max(0, x - cfg.nmsWindowSize)
76 | const w2 = Math.min(width - 1, x + cfg.nmsWindowSize)
77 |
78 | for (var h = h1; h <= h2; h++) {
79 | for (var w = w1; w <= w2; w++) {
80 | if (score < heatmap.get(h, w, d)) {
81 | isMax = false
82 | break
83 | }
84 | }
85 | if (!isMax) {
86 | break
87 | }
88 | }
89 |
90 | return isMax
91 | }
92 |
93 | const computePairs = function (pafmap, parts) {
94 | const pairsFinal = new Array(MaxPairCount)
95 | const pairs = new Array(MaxPairCount)
96 |
97 | cocoPairs.forEach((cocopair, i) => {
98 | const part1 = parts[cocopair[0]]
99 | const part2 = parts[cocopair[1]]
100 |
101 | pairs[i] = []
102 | pairsFinal[i] = []
103 |
104 | // connect the parts, score the connection, and find best matching connections
105 | for (var p1 = 0; p1 < part1.length; p1++) {
106 | for (var p2 = 0; p2 < part2.length; p2++) {
107 | const val = getPairScore(part1[p1][1], part1[p1][0], part2[p2][1], part2[p2][0], pafmap, cocoPairsNetwork[i])
108 | const score = val.score
109 | const count = val.count
110 |
111 | if (score > cfg.partScoreThreshold && count >= cfg.pafCountThreshold) {
112 | let inserted = false
113 |
114 | for (var l = 0; l < MaxPairCount; l++) {
115 | if (pairs[i][l] && score > pairs[i][l][2]) {
116 | pairs[i].splice(l, 0, [p1, p2, score])
117 | inserted = true
118 | break
119 | }
120 | }
121 |
122 | if (!inserted) {
123 | pairs[i].push([p1, p2, score])
124 | }
125 | }
126 | }
127 | }
128 |
129 | const added = {}
130 | for (var m = 0; m < pairs[i].length; m++) {
131 | const p = pairs[i][m]
132 | if (!added[`${p[0]}`] && !added[`${p[1]}`]) {
133 | pairsFinal[i].push(p)
134 | added[`${p[0]}`] = 1
135 | added[`${p[1]}`] = 1
136 | }
137 | }
138 | })
139 |
140 | return pairsFinal
141 | }
142 |
143 | const getPairScore = function (x1, y1, x2, y2, pafmap, cpnetwork) {
144 | let count = 0
145 | let score = 0
146 |
147 | const dx = x2 - x1
148 | const dy = y2 - y1
149 | const normVec = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2))
150 |
151 | if (normVec >= 0.0001) {
152 | const shape = pafmap.shape
153 | const vx = dx / normVec
154 | const vy = dy / normVec
155 |
156 | for (var t = 0; t < 10; t++) {
157 | const tx = Math.round(x1 + (t * dx / 9) + 0.5)
158 | const ty = Math.round(y1 + (t * dy / 9) + 0.5)
159 |
160 | if (shape[0] > ty && shape[1] > tx) {
161 | const s = vy * pafmap.get(ty, tx, cpnetwork[1]) +
162 | vx * pafmap.get(ty, tx, cpnetwork[0])
163 |
164 | if (s > cfg.localPAFThreshold) {
165 | count++
166 | score += s
167 | }
168 | }
169 | }
170 | }
171 |
172 | return {
173 | score: score,
174 | count: count
175 | }
176 | }
177 |
178 | const computePoses = function (parts, pairs) {
179 | const humans = []
180 |
181 | cocoPairs.forEach((cocopair, i) => {
182 | const p1 = cocopair[0]
183 | const p2 = cocopair[1]
184 |
185 | pairs[i].forEach((pair, j) => {
186 | const ip1 = pair[0]
187 | const ip2 = pair[1]
188 | let merged = false
189 |
190 | // calculate possible bodies from all pairs found
191 | for (var k = 0; k < humans.length; k++) {
192 | const human = humans[k]
193 | if (ip1 === human.coordsIndexSet[p1] || ip2 === human.coordsIndexSet[p2]) {
194 | human.coordsIndexSet[p1] = ip1
195 | human.coordsIndexSet[p2] = ip2
196 |
197 | human.partsList[p1] = partsJSON(p1, parts[p1][ip1])
198 | human.partsList[p2] = partsJSON(p2, parts[p2][ip2])
199 |
200 | merged = true
201 | break
202 | }
203 | }
204 |
205 | if (!merged) {
206 | const human = {
207 | partsList: new Array(18),
208 | coordsIndexSet: new Array(18)
209 | }
210 |
211 | human.coordsIndexSet[p1] = ip1
212 | human.coordsIndexSet[p2] = ip2
213 |
214 | human.partsList[p1] = partsJSON(p1, parts[p1][ip1])
215 | human.partsList[p2] = partsJSON(p2, parts[p2][ip2])
216 |
217 | humans.push(human)
218 | }
219 | })
220 | })
221 |
222 | return humans
223 | }
224 |
225 | const partsJSON = function (id, coords) {
226 | return {
227 | x: coords[1] ? coords[1] * DIMFACTOR : coords[1],
228 | y: coords[0] ? coords[0] * DIMFACTOR : coords[0],
229 | partName: cocoParts[id],
230 | partId: id,
231 | score: coords[2]
232 | }
233 | }
234 |
235 | const formatResponse = function (humans) {
236 | const humansFinal = []
237 |
238 | for (var i = 0; i < humans.length; i++) {
239 | let bodyPartCount = 0
240 |
241 | for (let j = 0; j < HeatMapCount - 1; j++) {
242 | if (humans[i].coordsIndexSet[j]) {
243 | bodyPartCount += 1
244 | }
245 | }
246 |
247 | // only include poses with enough parts
248 | if (bodyPartCount > cfg.partCountThreshold) {
249 | const pList = humans[i].partsList
250 | const poseLines = []
251 |
252 | const cocoPairsRender = cocoPairs.slice(0, cocoPairs.length - 2)
253 | cocoPairsRender.forEach((pair, idx) => {
254 | if (pList[pair[0]] && pList[pair[1]]) {
255 | poseLines.push([pList[pair[0]].x, pList[pair[0]].y, pList[pair[1]].x, pList[pair[1]].y])
256 | }
257 | })
258 |
259 | humansFinal.push({
260 | humanId: i,
261 | bodyParts: pList,
262 | poseLines: poseLines
263 | })
264 | }
265 | }
266 |
267 | return humansFinal
268 | }
269 |
270 | /**
271 | * convert model Tensor output to JSON containing body parts and poses lines data
272 | *
273 | * @param {Tensor} inferenceResults - the output from running the model
274 | */
275 | const postprocess = function (inferenceResults) {
276 | const [heatmapTensor, pafmapTensor] = tf.tidy(() => {
277 | return inferenceResults.unstack()[0].split([HeatMapCount, PafMapCount], 2)
278 | })
279 | return Promise.all([heatmapTensor.array(), pafmapTensor.array()])
280 | .then(maps => {
281 | tf.dispose(inferenceResults)
282 | return Promise.resolve({
283 | heatMap: maps[0],
284 | pafMap: maps[1],
285 | posesDetected: estimatePoses(heatmapTensor, pafmapTensor),
286 | imageSize: {
287 | width: heatmapTensor.shape[1] * DIMFACTOR,
288 | height: heatmapTensor.shape[0] * DIMFACTOR
289 | }
290 | })
291 | })
292 | }
293 |
294 | export { postprocess, configuration }
295 |
--------------------------------------------------------------------------------
/human-pose-estimator/src/human-pose-estimator.js:
--------------------------------------------------------------------------------
1 | import { preprocess } from './human-pose-estimator-input.js'
2 | import { load, inference } from './human-pose-estimator-model.js'
3 | import { postprocess, configuration } from './human-pose-estimator-output.js'
4 | import { cocoParts, cocoPairs, cocoPairsNetwork, cocoColors } from './human-pose-estimator-coco.js'
5 | import { version } from '../package.json'
6 |
7 | if (!process.rollupBrowser) {
8 | global.tf = require('@tensorflow/tfjs-node')
9 | }
10 |
11 | const processInput = function (inputImage, mirrorImage) {
12 | return preprocess(inputImage, mirrorImage)
13 | }
14 |
15 | const loadModel = function (init) {
16 | return load(init)
17 | }
18 |
19 | const runInference = function (inputTensor) {
20 | return inference(inputTensor)
21 | }
22 |
23 | const processOutput = function (inferenceResults) {
24 | return postprocess(inferenceResults)
25 | }
26 |
27 | const predict = function (inputImage, mirrorImage) {
28 | return processInput(inputImage, mirrorImage)
29 | .then(runInference)
30 | .then(processOutput)
31 | .catch(err => {
32 | console.error(err)
33 | })
34 | }
35 |
36 | const config = function (config) {
37 | return configuration(config)
38 | }
39 |
40 | const cocoUtil = {
41 | parts: cocoParts,
42 | pairs: cocoPairs,
43 | pairsNetwork: cocoPairsNetwork,
44 | colors: cocoColors
45 | }
46 |
47 | export {
48 | predict,
49 | config,
50 | loadModel,
51 | processInput,
52 | runInference,
53 | processOutput,
54 | cocoUtil,
55 | version
56 | }
57 |
--------------------------------------------------------------------------------
/human-pose-estimator/test/Pilots.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CODAIT/max-tfjs-models/7104d423078d05adb80249ceed565211fcaa116e/human-pose-estimator/test/Pilots.jpg
--------------------------------------------------------------------------------
/human-pose-estimator/test/test.js:
--------------------------------------------------------------------------------
1 | /* globals jasmine, describe, it, expect, beforeAll, tf */
2 |
3 | const jimp = require('jimp')
4 | const nodeCanvas = require('canvas')
5 | const poseEstimator = require('../dist/max.humanpose.cjs.js')
6 |
7 | const imagePath = `${__dirname}/Pilots.jpg`
8 |
9 | const createCanvasElement = function (imageInput) {
10 | let canvas = null
11 | return nodeCanvas.loadImage(imageInput).then(img => {
12 | canvas = nodeCanvas.createCanvas(img.width, img.height)
13 | const ctx = canvas.getContext('2d')
14 | return ctx.drawImage(img, 0, 0)
15 | }).then(() => {
16 | return canvas
17 | })
18 | }
19 |
20 | describe('Human Pose Estimator', function () {
21 | const input = jimp.read(imagePath)
22 | .then(imageData => imageData.getBufferAsync(jimp.MIME_PNG))
23 | .then(imageBuffer => createCanvasElement(imageBuffer))
24 |
25 | beforeAll(async function () {
26 | // Load model before all tests so initial memory conditions are consistent
27 | await poseEstimator.loadModel()
28 | })
29 |
30 | it('version returns a valid version number', function () {
31 | expect(poseEstimator.version).toMatch(/(\d+\.){2}(\d+)/)
32 | })
33 |
34 | it('processInput() resizes image to maximum of 432px', function () {
35 | return input.then(imageElement => poseEstimator.processInput(imageElement))
36 | .then(result => expect(result.shape).toContain(432))
37 | })
38 |
39 | it('processInput() cleans up its tensors', function () {
40 | const initialNumTensors = tf.memory().numTensors
41 | // Should garbage collect every tensor except the one returned
42 | return input.then(imageElement => poseEstimator.processInput(imageElement))
43 | .then(() => expect(tf.memory().numTensors - initialNumTensors).toEqual(1))
44 | })
45 |
46 | it('runInference() outputs correct dimensions (1, x, y, 57)', function () {
47 | return poseEstimator.runInference(tf.zeros([1, 512, 512, 3]))
48 | .then(result => expect(result.shape[3]).toEqual(57))
49 | })
50 |
51 | it('runInference() cleans up its tensors', function () {
52 | const initialNumTensors = tf.memory().numTensors
53 | // Should garbage collect every tensor except the one returned
54 | return poseEstimator.runInference(tf.zeros([1, 512, 512, 3]))
55 | .then(() => expect(tf.memory().numTensors - initialNumTensors).toEqual(1))
56 | })
57 |
58 | it('predict() returns object with heatMap, pafMap, posesDetected, and imageSize', function () {
59 | return input.then(imageElement => poseEstimator.predict(imageElement))
60 | .then(result => expect(Object.keys(result)).toEqual(jasmine.arrayContaining(['heatMap', 'pafMap', 'posesDetected', 'imageSize'])))
61 | })
62 |
63 | it('has no memory leaks', function () {
64 | const initialMemory = tf.memory()
65 | return input.then(imageElement => poseEstimator.predict(imageElement))
66 | .then(result => expect(initialMemory).toEqual(tf.memory()))
67 | })
68 | })
69 |
--------------------------------------------------------------------------------
/image-segmenter/README.md:
--------------------------------------------------------------------------------
1 | # MAX for TensorFlow.js: Image Segmenter
2 |
3 | This is a TensorFlow.js port of the [MAX Image Segmenter](https://developer.ibm.com/exchanges/models/all/max-image-segmenter) pre-trained model. The Image Segmenter was trained to identify objects in an image and assigns each pixel of the image to a particular object.
4 |
5 | ## Install
6 |
7 | ### Browser
8 |
9 | ```html
10 |
11 |
12 | ```
13 |
14 | By default when the `@codait/max-image-segmenter` JavaScript module is loaded, the model is automatically loaded and the cache warmed up (by running inference against an all zero input). To change this default behavior (and prevent the model from being automatically initialized) set attribute `data-init-model="false"` in the `script` tag for the `@codait/max-image-segmenter`.
15 |
16 | ### Node.js
17 |
18 | ```
19 | npm install --save @codait/max-image-segmenter
20 | ```
21 |
22 | ## Usage
23 |
24 | The complete examples for browser and Node.js environments are in the [`/examples`](https://github.com/CODAIT/max-tfjs-models/tree/master/image-segmenter/examples) directory.
25 |
26 | ### Browser
27 |
28 | > **Note**: _When loaded in a browser, the global variable `imageSegmenter` will be available to access the API._
29 |
30 | ```javascript
31 | let image = document.getElementById('my-image')
32 |
33 | imageSegmenter
34 | .predict(image)
35 | .then(prediction => {
36 | console.log(prediction.segmentationMap)
37 | console.log(prediction.objectsDetected)
38 | })
39 | ```
40 |
41 | ### Node.js
42 |
43 | ```javascript
44 | const { predict } = require('@codait/max-image-segmenter')
45 | const { read, MIME_PNG } = require('jimp')
46 | const { createCanvas, loadImage } = require('canvas')
47 |
48 | const createCanvasElement = function (imageInput) {
49 | return new Promise(async (resolve, reject) => {
50 | const img = await loadImage(imageInput)
51 | let canvas = createCanvas(img.width, img.height)
52 | let ctx = canvas.getContext('2d')
53 | await ctx.drawImage(img, 0, 0)
54 | resolve(canvas)
55 | })
56 | }
57 |
58 | const imagePath = `file://${ __dirname}/my-image.jpg`
59 |
60 | read(imagePath)
61 | .then(imageData => imageData.scaleToFit(512, 512).getBufferAsync(MIME_PNG))
62 | .then(imageBuffer => createCanvasElement(imageBuffer))
63 | .then(imageElement => predict(imageElement))
64 | .then(prediction => {
65 | // console.log(prediction.segmentationMap)
66 | console.log(prediction.objectsDetected)
67 | })
68 | ```
69 |
70 | ### API
71 |
72 | - **loadModel(_init_)**
73 |
74 | Loads the model files.
75 |
76 | `init` - if `true`, a prediction will be triggered using an all zero Tensor to warm up the model (helps increase speed of subsequent predictions when running in a browser). Default is `true`.
77 |
78 | Returns the TensorFlow.js model.
79 |
80 | - **processInput(_image_)**
81 |
82 | Processes the input image to the shape and format expected by the model. The image is resized and converted to a 4D Tensor.
83 |
84 | `image` - an instance of HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement.
85 |
86 | Returns a 4D Tensor that can be passed to the model.
87 |
88 | - **runInference(_inputTensor_)**
89 |
90 | Runs inference on the input Tensor passed. The output is 2D Tensor with an object ID assigned to each index of the input Tensor.
91 |
92 | `inputTensor` - a 4D Tensor representing an ImageData
93 |
94 | Returns the inference results.
95 |
96 | - **processOutput(_inferenceResults_)**
97 |
98 | Processes the inference output replacing the output Tensor with an 2D array.
99 |
100 | `inferenceResults` - the model output from running inference.
101 |
102 | Returns an object containing
103 |
104 | - `segmentationMap`: a 2D array with an object ID assigned to each pixel of the image
105 | - `objectsDetected`: an array of objects detected in the image
106 | - `imageSize`: an object with the width and height of the resized image (corresponds to the size of the `segmentationMap`)
107 |
108 | - **predict(_image_)**
109 |
110 | Loads the model (if not loaded), processes the input image, runs inference, processes the inference output, and returns a prediction object. This is a convenience function to avoid having to call each of the functions (`loadModel`, `processInput`, `runInference`, `processOutput`) individually.
111 |
112 | `image` - an instance of HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement.
113 |
114 | Returns an object containing
115 |
116 | - `segmentationMap`: a 2D array with an object ID assigned to each pixel of the image
117 | - `objectsDetected`: an array of objects detected in the image
118 | - `imageSize`: an object with the width and height of the resized image (corresponds to the size of the `segmentationMap`)
119 |
120 | - **labelsMap()**
121 |
122 | An array of object labels where the label's index corresponds to its ID. It can be used to map the IDs in the `segmentationMap` to its corresponding label.
123 |
124 | - **colorsMap()**
125 |
126 | An array of RGB color values that can be used to map each object to a specific color.
127 |
128 | - **version**
129 |
130 | Returns the version
131 |
132 | ## Model
133 |
134 | The model assets produced by converting the pre-trained model to the TensorFlow.js format can be found in the [`/model`](https://github.com/CODAIT/max-tfjs-models/tree/master/image-segmenter/model) directory.
135 |
136 | ## Resources
137 |
138 | - [MAX Image Segmenter](https://developer.ibm.com/exchanges/models/all/max-image-segmenter)
139 | - [MAX Image Segmenter Web App](https://github.com/IBM/MAX-Image-Segmenter-Web-App)
140 | - [magicat](https://github.com/CODAIT/magicat)
141 | - [TensorFlow.js](https://www.tensorflow.org/js/)
142 |
143 | ## License
144 |
145 | [Apache-2.0](https://github.com/CODAIT/max-tfjs-models/blob/master/LICENSE)
146 |
--------------------------------------------------------------------------------
/image-segmenter/examples/app.js:
--------------------------------------------------------------------------------
1 | // const { predict, version } = require('@codait/max-image-segmenter')
2 | const { predict, version } = require('../dist/max.imgseg.cjs.js')
3 |
4 | const { read, MIME_PNG } = require('jimp')
5 | const { createCanvas, loadImage } = require('canvas')
6 |
7 | const createCanvasElement = function (imageInput) {
8 | let canvas = null
9 | return loadImage(imageInput).then(img => {
10 | canvas = createCanvas(img.width, img.height)
11 | const ctx = canvas.getContext('2d')
12 | return ctx.drawImage(img, 0, 0)
13 | }).then(() => {
14 | return canvas
15 | })
16 | }
17 |
18 | if (process.argv.length < 3) {
19 | console.log('please pass an image to process. ex:')
20 | console.log(' node app.js /path/to/image.jpg')
21 | } else {
22 | console.log(`@codait/max-image-segmenter v${version}`)
23 | const imagePath = process.argv[2]
24 |
25 | read(imagePath)
26 | .then(imageData => imageData.scaleToFit(512, 512).getBufferAsync(MIME_PNG))
27 | .then(imageBuffer => createCanvasElement(imageBuffer))
28 | .then(imageElement => predict(imageElement))
29 | .then(prediction => {
30 | // console.log(prediction.segmentationMap)
31 | console.log(`the following object(s) were detected: ${prediction.objectsDetected}`)
32 | })
33 | }
34 |
--------------------------------------------------------------------------------
/image-segmenter/examples/browser-image.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | image-segmenter // image
5 |
6 |
120 |
121 |
122 |
image-segmenter // image
123 |
124 |
125 | run inference
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/image-segmenter/examples/browser-video.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | image-segmenter // video
5 |
16 |
17 |
114 |
115 |
116 |
image-segmenter // video
117 |
118 | Start webcam
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/image-segmenter/model/conversion-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "MAX-Image-Segmenter",
3 | "url": "https://developer.ibm.com/exchanges/models/all/max-image-segmenter",
4 | "source": "image-segmenter/1.0/assets.tar.gz/assets/deeplabv3_mnv2_pascal_trainval/frozen_inference_graph.pb",
5 | "framework": "tf_js",
6 | "converter": {
7 | "tensorflowjs": {
8 | "version": "0.8.0",
9 | "params": {
10 | "input_format": "tf_frozen_model",
11 | "output_node_names": "SemanticPredictions",
12 | "output_json": true
13 | }
14 | }
15 | },
16 | "output": [
17 | "group1-shard1of3",
18 | "group1-shard2of3",
19 | "group1-shard3of3",
20 | "model.json"
21 | ]
22 | }
--------------------------------------------------------------------------------
/image-segmenter/model/group1-shard1of3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CODAIT/max-tfjs-models/7104d423078d05adb80249ceed565211fcaa116e/image-segmenter/model/group1-shard1of3
--------------------------------------------------------------------------------
/image-segmenter/model/group1-shard2of3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CODAIT/max-tfjs-models/7104d423078d05adb80249ceed565211fcaa116e/image-segmenter/model/group1-shard2of3
--------------------------------------------------------------------------------
/image-segmenter/model/group1-shard3of3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CODAIT/max-tfjs-models/7104d423078d05adb80249ceed565211fcaa116e/image-segmenter/model/group1-shard3of3
--------------------------------------------------------------------------------
/image-segmenter/model/model.json:
--------------------------------------------------------------------------------
1 | {"modelTopology": {"node": [{"name": "image_pooling/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "320"}, {"size": "256"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "image_pooling/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "256"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}]}}}}}, {"name": "MobilenetV2/expanded_conv_2/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "24"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "mul_1/x", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "sub_1/x", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "Reshape", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "3"}]}}}}}, {"name": "stack/0", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "ToFloat/x", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/Conv/Conv2D/merged_input", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "3"}, {"size": "32"}]}}}}}, {"name": "MobilenetV2/Conv/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "32"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "32"}, {"size": "16"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "16"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "16"}, {"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "96"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "96"}]}}}}}, {"name": "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "96"}, {"size": "24"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "24"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "24"}, {"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/depthwise/depthwise_weights", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "144"}, {"size": "1"}]}}}}}, {"name": "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "144"}, {"size": "24"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "24"}, {"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "144"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "144"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "144"}, {"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "32"}, {"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "192"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}}}, {"name": "MobilenetV2/expanded_conv_4/project/Conv2D/merged_input", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "192"}, {"size": "32"}]}}}}}, {"name": "MobilenetV2/expanded_conv_5/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "32"}, {"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "192"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "192"}, {"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "32"}, {"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}}}, {"name": "MobilenetV2/expanded_conv_6/depthwise/depthwise_weights", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "192"}, {"size": "1"}]}}}}}, {"name": "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}}}, {"name": "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "192"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "192"}, {"size": "64"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "64"}]}}}}}, {"name": "MobilenetV2/expanded_conv_7/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "64"}, {"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "384"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "384"}, {"size": "64"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "64"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "64"}, {"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "384"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "384"}, {"size": "64"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "64"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "64"}, {"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "384"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "384"}, {"size": "64"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "64"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "64"}, {"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "384"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "384"}]}}}}}, {"name": "MobilenetV2/expanded_conv_10/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "384"}, {"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "96"}, {"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "576"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}}}, {"name": "MobilenetV2/expanded_conv_11/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "576"}, {"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "96"}, {"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "576"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "576"}, {"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "96"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "96"}, {"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}, {"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/depthwise_weights", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "576"}, {"size": "1"}]}}}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}, {"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "576"}]}}}}}, {"name": "MobilenetV2/expanded_conv_13/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "576"}, {"size": "160"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "160"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "160"}, {"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "960"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/project/Conv2D/merged_input", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "960"}, {"size": "160"}]}}}}}, {"name": "MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "160"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "160"}, {"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "960"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "960"}, {"size": "160"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "160"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/expand/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "160"}, {"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/paddings", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}, {"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/depthwise_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "3"}, {"size": "3"}, {"size": "960"}, {"size": "1"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/BatchToSpaceND/crops", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}, {"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Scaled", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "960"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/project/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "960"}, {"size": "320"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "320"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "aspp0/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "320"}, {"size": "256"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "aspp0/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "256"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "concat_projection/Conv2D/merged_input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "512"}, {"size": "256"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "concat_projection/BatchNorm/FusedBatchNorm/Offset", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "256"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "logits/semantic/weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "1"}, {"size": "1"}, {"size": "256"}, {"size": "21"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "logits/semantic/biases", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "21"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "ResizeBilinear_1/size", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "strided_slice_7", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}}}, {"name": "Assert/Assert/data_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "SemanticPredictions/begin", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "3"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "SemanticPredictions/size/0", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "strided_slice_3/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "ImageTensor", "op": "Placeholder", "attr": {"shape": {"shape": {"dim": [{"size": "1"}, {"size": "-1"}, {"size": "-1"}, {"size": "3"}]}}, "dtype": {"type": "DT_UINT8"}}}, {"name": "strided_slice/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "strided_slice_4/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "strided_slice_4/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "Squeeze", "op": "Squeeze", "input": ["ImageTensor"], "attr": {"T": {"type": "DT_UINT8"}, "squeeze_dims": {"list": {"i": ["0"]}}}}, {"name": "Shape", "op": "Shape", "input": ["ImageTensor"], "attr": {"T": {"type": "DT_UINT8"}, "out_type": {"type": "DT_INT32"}}}, {"name": "Cast", "op": "Cast", "input": ["Squeeze"], "attr": {"SrcT": {"type": "DT_UINT8"}, "Truncate": {"b": false}, "DstT": {"type": "DT_FLOAT"}}}, {"name": "strided_slice", "op": "StridedSlice", "input": ["Shape", "strided_slice_4/stack", "strided_slice/stack_1", "strided_slice_4/stack"], "attr": {"shrink_axis_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}}}, {"name": "ExpandDims", "op": "ExpandDims", "input": ["Cast", "stack/0"], "attr": {"Tdim": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "Shape_1", "op": "Shape", "input": ["Cast"], "attr": {"T": {"type": "DT_FLOAT"}, "out_type": {"type": "DT_INT32"}}}, {"name": "strided_slice_8", "op": "StridedSlice", "input": ["strided_slice", "strided_slice_3/stack", "strided_slice_4/stack", "strided_slice_4/stack"], "attr": {"T": {"type": "DT_INT32"}, "Index": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}}}, {"name": "strided_slice_9", "op": "StridedSlice", "input": ["strided_slice", "strided_slice_4/stack", "strided_slice_4/stack_1", "strided_slice_4/stack"], "attr": {"T": {"type": "DT_INT32"}, "Index": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}}}, {"name": "strided_slice_1", "op": "StridedSlice", "input": ["Shape_1", "strided_slice_3/stack", "strided_slice_4/stack", "strided_slice_4/stack"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}}}, {"name": "strided_slice_2", "op": "StridedSlice", "input": ["Shape_1", "strided_slice_4/stack", "strided_slice_4/stack_1", "strided_slice_4/stack"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "begin_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}}}, {"name": "SemanticPredictions/size", "op": "Pack", "input": ["SemanticPredictions/size/0", "strided_slice_8", "strided_slice_9"], "attr": {"T": {"type": "DT_INT32"}, "axis": {"i": "0"}, "N": {"i": "3"}}}, {"name": "ToFloat_1/x", "op": "Pack", "input": ["strided_slice_1", "strided_slice_2"], "attr": {"N": {"i": "2"}, "T": {"type": "DT_INT32"}, "axis": {"i": "0"}}}, {"name": "ToFloat_1", "op": "Cast", "input": ["ToFloat_1/x"], "attr": {"Truncate": {"b": false}, "DstT": {"type": "DT_FLOAT"}, "SrcT": {"type": "DT_INT32"}}}, {"name": "ToInt32", "op": "Cast", "input": ["ToFloat_1"], "attr": {"SrcT": {"type": "DT_FLOAT"}, "Truncate": {"b": false}, "DstT": {"type": "DT_INT32"}}}, {"name": "ResizeBilinear", "op": "ResizeBilinear", "input": ["ExpandDims", "ToInt32"], "attr": {"align_corners": {"b": true}, "T": {"type": "DT_FLOAT"}}}, {"name": "Squeeze_1", "op": "Squeeze", "input": ["ResizeBilinear"], "attr": {"squeeze_dims": {"list": {"i": ["0"]}}, "T": {"type": "DT_FLOAT"}}}, {"name": "Shape_2", "op": "Shape", "input": ["Squeeze_1"], "attr": {"T": {"type": "DT_FLOAT"}, "out_type": {"type": "DT_INT32"}}}, {"name": "sub_2", "op": "Sub", "input": ["Squeeze_1", "Reshape"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "strided_slice_3", "op": "StridedSlice", "input": ["Shape_2", "strided_slice_3/stack", "strided_slice_4/stack", "strided_slice_4/stack"], "attr": {"T": {"type": "DT_INT32"}, "Index": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "begin_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}}}, {"name": "strided_slice_4", "op": "StridedSlice", "input": ["Shape_2", "strided_slice_4/stack", "strided_slice_4/stack_1", "strided_slice_4/stack"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}}}, {"name": "Shape_3", "op": "Shape", "input": ["sub_2"], "attr": {"T": {"type": "DT_FLOAT"}, "out_type": {"type": "DT_INT32"}}}, {"name": "sub", "op": "Sub", "input": ["sub_1/x", "strided_slice_3"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "sub_1", "op": "Sub", "input": ["sub_1/x", "strided_slice_4"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "strided_slice_5", "op": "StridedSlice", "input": ["Shape_3", "strided_slice_3/stack", "strided_slice_4/stack", "strided_slice_4/stack"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "begin_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}}}, {"name": "strided_slice_6", "op": "StridedSlice", "input": ["Shape_3", "strided_slice_4/stack", "strided_slice_4/stack_1", "strided_slice_4/stack"], "attr": {"end_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}}}, {"name": "Maximum", "op": "Maximum", "input": ["sub", "stack/0"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "Maximum_1", "op": "Maximum", "input": ["sub_1", "stack/0"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "add", "op": "Add", "input": ["strided_slice_3", "Maximum"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "add_1", "op": "Add", "input": ["strided_slice_4", "Maximum_1"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "sub_6", "op": "Sub", "input": ["add", "strided_slice_5"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "sub_4", "op": "Sub", "input": ["add_1", "strided_slice_6"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "stack", "op": "Pack", "input": ["stack/0", "sub_6"], "attr": {"T": {"type": "DT_INT32"}, "axis": {"i": "0"}, "N": {"i": "2"}}}, {"name": "stack_1", "op": "Pack", "input": ["stack/0", "sub_4"], "attr": {"T": {"type": "DT_INT32"}, "axis": {"i": "0"}, "N": {"i": "2"}}}, {"name": "stack_3", "op": "Pack", "input": ["stack", "stack_1", "stack_2"], "attr": {"T": {"type": "DT_INT32"}, "axis": {"i": "0"}, "N": {"i": "3"}}}, {"name": "Pad", "op": "Pad", "input": ["sub_2", "stack_3"], "attr": {"T": {"type": "DT_FLOAT"}, "Tpaddings": {"type": "DT_INT32"}}}, {"name": "add_2", "op": "Add", "input": ["Pad", "Reshape"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "ExpandDims_1", "op": "ExpandDims", "input": ["add_2", "stack/0"], "attr": {"T": {"type": "DT_FLOAT"}, "Tdim": {"type": "DT_INT32"}}}, {"name": "mul_1", "op": "Mul", "input": ["mul_1/x", "ExpandDims_1"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "sub_7", "op": "Sub", "input": ["mul_1", "ToFloat/x"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/Conv/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["sub_7", "MobilenetV2/Conv/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "2", "2", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/Conv/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/Conv/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/Conv/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/Conv/Relu6", "op": "Relu6", "input": ["MobilenetV2/Conv/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/Conv/Relu6", "MobilenetV2/expanded_conv/depthwise/depthwise_weights"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "U0FNRQ=="}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv/depthwise/depthwise", "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv/depthwise/Relu6", "MobilenetV2/expanded_conv/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_1/expand/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_1/expand/Relu6", "MobilenetV2/expanded_conv_1/depthwise/depthwise_weights"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "2", "2", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_1/depthwise/depthwise", "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_1/depthwise/Relu6", "MobilenetV2/expanded_conv_1/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_2/expand/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_2/expand/Relu6", "MobilenetV2/expanded_conv_2/depthwise/depthwise_weights"], "attr": {"data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "U0FNRQ=="}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_2/depthwise/depthwise", "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_2/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_2/depthwise/Relu6", "MobilenetV2/expanded_conv_2/project/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_2/ArithmeticOptimizer/AddOpsRewrite_Leaf_1_add", "op": "AddN", "input": ["MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_2/project/BatchNorm/FusedBatchNorm/Mul"], "attr": {"T": {"type": "DT_FLOAT"}, "_grappler:ArithmeticOptimizer:AddOpsRewriteStage": {"b": true}, "N": {"i": "2"}}}, {"name": "MobilenetV2/expanded_conv_2/ArithmeticOptimizer/AddOpsRewrite_add", "op": "Add", "input": ["MobilenetV2/expanded_conv_2/project/BatchNorm/FusedBatchNorm/Offset", "MobilenetV2/expanded_conv_2/ArithmeticOptimizer/AddOpsRewrite_Leaf_1_add"], "attr": {"T": {"type": "DT_FLOAT"}, "_grappler:ArithmeticOptimizer:AddOpsRewriteStage": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_2/ArithmeticOptimizer/AddOpsRewrite_add", "MobilenetV2/expanded_conv_3/expand/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_3/expand/Relu6", "MobilenetV2/expanded_conv_3/depthwise/depthwise_weights"], "attr": {"T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "2", "2", "1"]}}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_3/depthwise/depthwise", "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_3/depthwise/Relu6", "MobilenetV2/expanded_conv_3/project/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_4/expand/Conv2D/merged_input"], "attr": {"use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_4/expand/Relu6", "MobilenetV2/expanded_conv_4/depthwise/depthwise_weights"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_4/depthwise/depthwise", "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_4/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_4/depthwise/Relu6", "MobilenetV2/expanded_conv_4/project/Conv2D/merged_input"], "attr": {"T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}}}, {"name": "MobilenetV2/expanded_conv_4/ArithmeticOptimizer/AddOpsRewrite_Leaf_1_add", "op": "AddN", "input": ["MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_4/project/BatchNorm/FusedBatchNorm/Mul"], "attr": {"T": {"type": "DT_FLOAT"}, "_grappler:ArithmeticOptimizer:AddOpsRewriteStage": {"b": true}, "N": {"i": "2"}}}, {"name": "MobilenetV2/expanded_conv_4/ArithmeticOptimizer/AddOpsRewrite_add", "op": "Add", "input": ["MobilenetV2/expanded_conv_4/project/BatchNorm/FusedBatchNorm/Offset", "MobilenetV2/expanded_conv_4/ArithmeticOptimizer/AddOpsRewrite_Leaf_1_add"], "attr": {"_grappler:ArithmeticOptimizer:AddOpsRewriteStage": {"b": true}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_4/ArithmeticOptimizer/AddOpsRewrite_add", "MobilenetV2/expanded_conv_5/expand/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_5/expand/Relu6", "MobilenetV2/expanded_conv_5/depthwise/depthwise_weights"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "U0FNRQ=="}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}}}, {"name": "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_5/depthwise/depthwise", "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_5/depthwise/Relu6", "MobilenetV2/expanded_conv_5/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_5/ArithmeticOptimizer/AddOpsRewrite_Leaf_1_add", "op": "AddN", "input": ["MobilenetV2/expanded_conv_4/ArithmeticOptimizer/AddOpsRewrite_add", "MobilenetV2/expanded_conv_5/project/BatchNorm/FusedBatchNorm/Mul"], "attr": {"_grappler:ArithmeticOptimizer:AddOpsRewriteStage": {"b": true}, "N": {"i": "2"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_5/ArithmeticOptimizer/AddOpsRewrite_add", "op": "Add", "input": ["MobilenetV2/expanded_conv_5/project/BatchNorm/FusedBatchNorm/Offset", "MobilenetV2/expanded_conv_5/ArithmeticOptimizer/AddOpsRewrite_Leaf_1_add"], "attr": {"T": {"type": "DT_FLOAT"}, "_grappler:ArithmeticOptimizer:AddOpsRewriteStage": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_5/ArithmeticOptimizer/AddOpsRewrite_add", "MobilenetV2/expanded_conv_6/expand/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_6/expand/Relu6", "MobilenetV2/expanded_conv_6/depthwise/depthwise_weights"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_6/depthwise/depthwise", "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_6/depthwise/Relu6", "MobilenetV2/expanded_conv_6/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_7/expand/Conv2D/merged_input"], "attr": {"data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_7/expand/Relu6", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"T": {"type": "DT_FLOAT"}, "Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_7/depthwise/depthwise_weights"], "attr": {"padding": {"s": "VkFMSUQ="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_7/depthwise/depthwise", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_7/depthwise/Relu6", "MobilenetV2/expanded_conv_7/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_7/add", "op": "Add", "input": ["MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_7/add", "MobilenetV2/expanded_conv_8/expand/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_8/expand/Relu6", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"Tblock_shape": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}, "Tpaddings": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_8/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_8/depthwise/depthwise_weights"], "attr": {"data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "VkFMSUQ="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_8/depthwise/depthwise", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_8/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_8/depthwise/Relu6", "MobilenetV2/expanded_conv_8/project/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_8/add", "op": "Add", "input": ["MobilenetV2/expanded_conv_7/add", "MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_8/add", "MobilenetV2/expanded_conv_9/expand/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_9/expand/Relu6", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_9/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_9/depthwise/depthwise_weights"], "attr": {"padding": {"s": "VkFMSUQ="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_9/depthwise/depthwise", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_9/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_9/depthwise/Relu6", "MobilenetV2/expanded_conv_9/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_9/add", "op": "Add", "input": ["MobilenetV2/expanded_conv_8/add", "MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_9/add", "MobilenetV2/expanded_conv_10/expand/Conv2D/merged_input"], "attr": {"data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_10/expand/Relu6", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_10/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_10/depthwise/depthwise_weights"], "attr": {"strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "padding": {"s": "VkFMSUQ="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_10/depthwise/depthwise", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tblock_shape": {"type": "DT_INT32"}, "Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_10/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_10/depthwise/Relu6", "MobilenetV2/expanded_conv_10/project/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_11/expand/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_11/expand/Relu6", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"T": {"type": "DT_FLOAT"}, "Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_11/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_11/depthwise/depthwise_weights"], "attr": {"padding": {"s": "VkFMSUQ="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_11/depthwise/depthwise", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_11/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_11/depthwise/Relu6", "MobilenetV2/expanded_conv_11/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_11/add", "op": "Add", "input": ["MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_11/add", "MobilenetV2/expanded_conv_12/expand/Conv2D/merged_input"], "attr": {"data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_12/expand/Relu6", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_12/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_12/depthwise/depthwise_weights"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "VkFMSUQ="}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_12/depthwise/depthwise", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tblock_shape": {"type": "DT_INT32"}, "Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_12/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_12/depthwise/Relu6", "MobilenetV2/expanded_conv_12/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_12/add", "op": "Add", "input": ["MobilenetV2/expanded_conv_11/add", "MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_12/add", "MobilenetV2/expanded_conv_13/expand/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_13/expand/Relu6", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"T": {"type": "DT_FLOAT"}, "Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_13/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_13/depthwise/depthwise_weights"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "VkFMSUQ="}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_13/depthwise/depthwise", "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_13/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_13/depthwise/Relu6", "MobilenetV2/expanded_conv_13/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_14/expand/Conv2D/merged_input"], "attr": {"use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_14/expand/Relu6", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_14/depthwise/depthwise_weights"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "VkFMSUQ="}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_14/depthwise/depthwise", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_14/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tblock_shape": {"type": "DT_INT32"}, "Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_14/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_14/depthwise/Relu6", "MobilenetV2/expanded_conv_14/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_14/add", "op": "Add", "input": ["MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm", "MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_14/add", "MobilenetV2/expanded_conv_15/expand/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_15/expand/Relu6", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_15/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_15/depthwise/depthwise_weights"], "attr": {"padding": {"s": "VkFMSUQ="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_15/depthwise/depthwise", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_14/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"Tblock_shape": {"type": "DT_INT32"}, "Tcrops": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_15/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_15/depthwise/Relu6", "MobilenetV2/expanded_conv_15/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_15/add", "op": "Add", "input": ["MobilenetV2/expanded_conv_14/add", "MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_15/add", "MobilenetV2/expanded_conv_16/expand/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/expand/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/depthwise/SpaceToBatchND", "op": "SpaceToBatchND", "input": ["MobilenetV2/expanded_conv_16/expand/Relu6", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/paddings"], "attr": {"T": {"type": "DT_FLOAT"}, "Tpaddings": {"type": "DT_INT32"}, "Tblock_shape": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/depthwise", "op": "DepthwiseConv2dNative", "input": ["MobilenetV2/expanded_conv_16/depthwise/depthwise/SpaceToBatchND", "MobilenetV2/expanded_conv_16/depthwise/depthwise_weights"], "attr": {"data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "padding": {"s": "VkFMSUQ="}, "T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/depthwise/BatchToSpaceND", "op": "BatchToSpaceND", "input": ["MobilenetV2/expanded_conv_16/depthwise/depthwise", "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "MobilenetV2/expanded_conv_14/depthwise/depthwise/BatchToSpaceND/crops"], "attr": {"T": {"type": "DT_FLOAT"}, "Tblock_shape": {"type": "DT_INT32"}, "Tcrops": {"type": "DT_INT32"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Mul", "op": "Mul", "input": ["MobilenetV2/expanded_conv_16/depthwise/depthwise/BatchToSpaceND", "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Scaled"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/depthwise/Relu6", "op": "Relu6", "input": ["MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_16/depthwise/Relu6", "MobilenetV2/expanded_conv_16/project/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm/Mul", "MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "AvgPool2D/AvgPool", "op": "AvgPool", "input": ["MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm"], "attr": {"strides": {"list": {"i": ["1", "65", "65", "1"]}}, "data_format": {"s": "TkhXQw=="}, "ksize": {"list": {"i": ["1", "65", "65", "1"]}}, "padding": {"s": "VkFMSUQ="}, "T": {"type": "DT_FLOAT"}}}, {"name": "aspp0/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm", "aspp0/Conv2D/merged_input"], "attr": {"padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}}}, {"name": "image_pooling/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["AvgPool2D/AvgPool", "image_pooling/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "aspp0/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["aspp0/BatchNorm/FusedBatchNorm/Mul", "aspp0/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "image_pooling/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["image_pooling/BatchNorm/FusedBatchNorm/Mul", "image_pooling/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "aspp0/Relu", "op": "Relu", "input": ["aspp0/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "image_pooling/Relu", "op": "Relu", "input": ["image_pooling/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "ResizeBilinear_1", "op": "ResizeBilinear", "input": ["image_pooling/Relu", "ResizeBilinear_1/size"], "attr": {"align_corners": {"b": true}, "T": {"type": "DT_FLOAT"}}}, {"name": "concat", "op": "ConcatV2", "input": ["ResizeBilinear_1", "aspp0/Relu", "Assert/Assert/data_1"], "attr": {"N": {"i": "2"}, "Tidx": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "concat_projection/BatchNorm/FusedBatchNorm/Mul", "op": "Conv2D", "input": ["concat", "concat_projection/Conv2D/merged_input"], "attr": {"dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}}}, {"name": "concat_projection/BatchNorm/FusedBatchNorm", "op": "Add", "input": ["concat_projection/BatchNorm/FusedBatchNorm/Mul", "concat_projection/BatchNorm/FusedBatchNorm/Offset"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "concat_projection/Relu", "op": "Relu", "input": ["concat_projection/BatchNorm/FusedBatchNorm"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "logits/semantic/Conv2D", "op": "Conv2D", "input": ["concat_projection/Relu", "logits/semantic/weights"], "attr": {"use_cudnn_on_gpu": {"b": true}, "padding": {"s": "U0FNRQ=="}, "dilations": {"list": {"i": ["1", "1", "1", "1"]}}, "T": {"type": "DT_FLOAT"}, "strides": {"list": {"i": ["1", "1", "1", "1"]}}, "data_format": {"s": "TkhXQw=="}}}, {"name": "logits/semantic/BiasAdd", "op": "BiasAdd", "input": ["logits/semantic/Conv2D", "logits/semantic/biases"], "attr": {"data_format": {"s": "TkhXQw=="}, "T": {"type": "DT_FLOAT"}}}, {"name": "ResizeBilinear_2", "op": "ResizeBilinear", "input": ["logits/semantic/BiasAdd", "ResizeBilinear_1/size"], "attr": {"T": {"type": "DT_FLOAT"}, "align_corners": {"b": true}}}, {"name": "ResizeBilinear_3", "op": "ResizeBilinear", "input": ["ResizeBilinear_2", "strided_slice_7"], "attr": {"align_corners": {"b": true}, "T": {"type": "DT_FLOAT"}}}, {"name": "ArgMax", "op": "ArgMax", "input": ["ResizeBilinear_3", "Assert/Assert/data_1"], "attr": {"output_type": {"type": "DT_INT64"}, "Tidx": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "SemanticPredictions", "op": "Slice", "input": ["ArgMax", "SemanticPredictions/begin", "SemanticPredictions/size"], "attr": {"T": {"type": "DT_INT64"}, "Index": {"type": "DT_INT32"}}}], "library": {}, "versions": {}}, "weightsManifest": [{"paths": ["group1-shard1of3", "group1-shard2of3", "group1-shard3of3"], "weights": [{"name": "image_pooling/Conv2D/merged_input", "shape": [1, 1, 320, 256], "dtype": "float32"}, {"name": "image_pooling/BatchNorm/FusedBatchNorm/Offset", "shape": [256], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_5/project/BatchNorm/FusedBatchNorm/Offset", "shape": [32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_4/project/BatchNorm/FusedBatchNorm/Offset", "shape": [32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_2/project/BatchNorm/FusedBatchNorm/Offset", "shape": [24], "dtype": "float32"}, {"name": "mul_1/x", "shape": [], "dtype": "float32"}, {"name": "sub_1/x", "shape": [], "dtype": "int32"}, {"name": "stack_2", "shape": [2], "dtype": "int32"}, {"name": "Reshape", "shape": [1, 1, 3], "dtype": "float32"}, {"name": "stack/0", "shape": [], "dtype": "int32"}, {"name": "ToFloat/x", "shape": [], "dtype": "float32"}, {"name": "MobilenetV2/Conv/Conv2D/merged_input", "shape": [3, 3, 3, 32], "dtype": "float32"}, {"name": "MobilenetV2/Conv/BatchNorm/FusedBatchNorm/Offset", "shape": [32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv/depthwise/depthwise_weights", "shape": [3, 3, 32, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv/project/Conv2D/merged_input", "shape": [1, 1, 32, 16], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNorm/Offset", "shape": [16], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_1/expand/Conv2D/merged_input", "shape": [1, 1, 16, 96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_1/depthwise/depthwise_weights", "shape": [3, 3, 96, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_1/project/Conv2D/merged_input", "shape": [1, 1, 96, 24], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNorm/Offset", "shape": [24], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_2/expand/Conv2D/merged_input", "shape": [1, 1, 24, 144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_2/depthwise/depthwise_weights", "shape": [3, 3, 144, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_2/project/Conv2D/merged_input", "shape": [1, 1, 144, 24], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_3/expand/Conv2D/merged_input", "shape": [1, 1, 24, 144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_3/depthwise/depthwise_weights", "shape": [3, 3, 144, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [144], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_3/project/Conv2D/merged_input", "shape": [1, 1, 144, 32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNorm/Offset", "shape": [32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_4/expand/Conv2D/merged_input", "shape": [1, 1, 32, 192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_4/depthwise/depthwise_weights", "shape": [3, 3, 192, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_4/project/Conv2D/merged_input", "shape": [1, 1, 192, 32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_5/expand/Conv2D/merged_input", "shape": [1, 1, 32, 192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_5/depthwise/depthwise_weights", "shape": [3, 3, 192, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_5/project/Conv2D/merged_input", "shape": [1, 1, 192, 32], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_6/expand/Conv2D/merged_input", "shape": [1, 1, 32, 192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_6/depthwise/depthwise_weights", "shape": [3, 3, 192, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [192], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_6/project/Conv2D/merged_input", "shape": [1, 1, 192, 64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNorm/Offset", "shape": [64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/expand/Conv2D/merged_input", "shape": [1, 1, 64, 384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise_weights", "shape": [3, 3, 384, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/project/Conv2D/merged_input", "shape": [1, 1, 384, 64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNorm/Offset", "shape": [64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_8/expand/Conv2D/merged_input", "shape": [1, 1, 64, 384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_8/depthwise/depthwise_weights", "shape": [3, 3, 384, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_8/project/Conv2D/merged_input", "shape": [1, 1, 384, 64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNorm/Offset", "shape": [64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_9/expand/Conv2D/merged_input", "shape": [1, 1, 64, 384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_9/depthwise/depthwise_weights", "shape": [3, 3, 384, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_9/project/Conv2D/merged_input", "shape": [1, 1, 384, 64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNorm/Offset", "shape": [64], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_10/expand/Conv2D/merged_input", "shape": [1, 1, 64, 384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_10/depthwise/depthwise_weights", "shape": [3, 3, 384, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [384], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_10/project/Conv2D/merged_input", "shape": [1, 1, 384, 96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNorm/Offset", "shape": [96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_11/expand/Conv2D/merged_input", "shape": [1, 1, 96, 576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_11/depthwise/depthwise_weights", "shape": [3, 3, 576, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_11/project/Conv2D/merged_input", "shape": [1, 1, 576, 96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNorm/Offset", "shape": [96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_12/expand/Conv2D/merged_input", "shape": [1, 1, 96, 576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_12/depthwise/depthwise_weights", "shape": [3, 3, 576, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_12/project/Conv2D/merged_input", "shape": [1, 1, 576, 96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNorm/Offset", "shape": [96], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_13/expand/Conv2D/merged_input", "shape": [1, 1, 96, 576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/paddings", "shape": [2, 2], "dtype": "int32"}, {"name": "MobilenetV2/expanded_conv_13/depthwise/depthwise_weights", "shape": [3, 3, 576, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND/block_shape", "shape": [2], "dtype": "int32"}, {"name": "MobilenetV2/expanded_conv_7/depthwise/depthwise/BatchToSpaceND/crops", "shape": [2, 2], "dtype": "int32"}, {"name": "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [576], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_13/project/Conv2D/merged_input", "shape": [1, 1, 576, 160], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNorm/Offset", "shape": [160], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/expand/Conv2D/merged_input", "shape": [1, 1, 160, 960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise_weights", "shape": [3, 3, 960, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/project/Conv2D/merged_input", "shape": [1, 1, 960, 160], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNorm/Offset", "shape": [160], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_15/expand/Conv2D/merged_input", "shape": [1, 1, 160, 960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_15/depthwise/depthwise_weights", "shape": [3, 3, 960, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_15/project/Conv2D/merged_input", "shape": [1, 1, 960, 160], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNorm/Offset", "shape": [160], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_16/expand/Conv2D/merged_input", "shape": [1, 1, 160, 960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNorm/Offset", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/paddings", "shape": [2, 2], "dtype": "int32"}, {"name": "MobilenetV2/expanded_conv_16/depthwise/depthwise_weights", "shape": [3, 3, 960, 1], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/SpaceToBatchND/block_shape", "shape": [2], "dtype": "int32"}, {"name": "MobilenetV2/expanded_conv_14/depthwise/depthwise/BatchToSpaceND/crops", "shape": [2, 2], "dtype": "int32"}, {"name": "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Scaled", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNorm/Offset", "shape": [960], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_16/project/Conv2D/merged_input", "shape": [1, 1, 960, 320], "dtype": "float32"}, {"name": "MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNorm/Offset", "shape": [320], "dtype": "float32"}, {"name": "aspp0/Conv2D/merged_input", "shape": [1, 1, 320, 256], "dtype": "float32"}, {"name": "aspp0/BatchNorm/FusedBatchNorm/Offset", "shape": [256], "dtype": "float32"}, {"name": "concat_projection/Conv2D/merged_input", "shape": [1, 1, 512, 256], "dtype": "float32"}, {"name": "concat_projection/BatchNorm/FusedBatchNorm/Offset", "shape": [256], "dtype": "float32"}, {"name": "logits/semantic/weights", "shape": [1, 1, 256, 21], "dtype": "float32"}, {"name": "logits/semantic/biases", "shape": [21], "dtype": "float32"}, {"name": "ResizeBilinear_1/size", "shape": [2], "dtype": "int32"}, {"name": "strided_slice_7", "shape": [2], "dtype": "int32"}, {"name": "Assert/Assert/data_1", "shape": [], "dtype": "int32"}, {"name": "SemanticPredictions/begin", "shape": [3], "dtype": "int32"}, {"name": "SemanticPredictions/size/0", "shape": [], "dtype": "int32"}, {"name": "strided_slice_3/stack", "shape": [1], "dtype": "int32"}, {"name": "strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "strided_slice_4/stack_1", "shape": [1], "dtype": "int32"}, {"name": "strided_slice_4/stack", "shape": [1], "dtype": "int32"}]}]}
--------------------------------------------------------------------------------
/image-segmenter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@codait/max-image-segmenter",
3 | "version": "0.3.0",
4 | "description": "Identify objects in an image, additionally assigning each pixel of the image to a particular object.",
5 | "main": "dist/max.imgseg.cjs.js",
6 | "module": "dist/max.imgseg.es.js",
7 | "jsdelivr": "dist/max.imgseg.min.js",
8 | "unpkg": "dist/max.imgseg.min.js",
9 | "scripts": {
10 | "clean": "rimraf dist && mkdirp dist",
11 | "rollup": "rollup --config rollup.config.js",
12 | "uglify": "uglifyjs dist/max.imgseg.js -mc --source-map --output dist/max.imgseg.min.js",
13 | "copy": "ncp model dist/model",
14 | "build": "npm run clean && npm run rollup && npm run uglify",
15 | "test": "standard && npm run build && jasmine test/test.js"
16 | },
17 | "files": [
18 | "dist",
19 | "model"
20 | ],
21 | "author": "va barbosa (https://github.com/vabarbosa/)",
22 | "license": "Apache-2.0",
23 | "keywords": [
24 | "image segmenter",
25 | "object detection",
26 | "model asset exchange",
27 | "max",
28 | "tensorflow.js",
29 | "tensorflowjs",
30 | "tensorflow",
31 | "tf.js",
32 | "tfjs",
33 | "machine learning"
34 | ],
35 | "repository": {
36 | "type": "git",
37 | "url": "git+https://github.com/CODAIT/max-tfjs-models.git"
38 | },
39 | "bugs": {
40 | "url": "https://github.com/CODAIT/max-tfjs-models/issues"
41 | },
42 | "homepage": "https://github.com/CODAIT/max-tfjs-models/tree/master/image-segmenter#readme",
43 | "dependencies": {
44 | "@tensorflow/tfjs-node": "^2.0.1"
45 | },
46 | "devDependencies": {
47 | "canvas": "^2.6.1",
48 | "jasmine": "^3.5.0",
49 | "jimp": "^0.14.0",
50 | "mkdirp": "^1.0.4",
51 | "ncp": "^2.0.0",
52 | "rimraf": "^3.0.2",
53 | "rollup": "^2.23.0",
54 | "@rollup/plugin-json": "^4.1.0",
55 | "@rollup/plugin-replace": "^2.3.3",
56 | "standard": "^14.3.4",
57 | "uglify-es": "^3.3.9"
58 | },
59 | "standard": {
60 | "ignore": [
61 | "dist"
62 | ]
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/image-segmenter/rollup.config.js:
--------------------------------------------------------------------------------
1 | import replace from '@rollup/plugin-replace'
2 | import json from '@rollup/plugin-json'
3 |
4 | const jsonPlugin = json({
5 | include: 'package.json',
6 | preferConst: true,
7 | indent: ' ',
8 | compact: true,
9 | namedExports: ['version']
10 | })
11 |
12 | export default [
13 | {
14 | input: 'src/image-segmenter.js',
15 | output: [
16 | {
17 | format: 'iife',
18 | compact: true,
19 | name: 'imageSegmenter',
20 | file: 'dist/max.imgseg.js'
21 | },
22 | {
23 | format: 'es',
24 | compact: true,
25 | name: 'imageSegmenter',
26 | file: 'dist/max.imgseg.es.js'
27 | }
28 | ],
29 | plugins: [
30 | replace({
31 | 'process.rollupBrowser': true
32 | }),
33 | jsonPlugin
34 | ]
35 | }, {
36 | input: 'src/image-segmenter.js',
37 | output: [
38 | {
39 | format: 'cjs',
40 | compact: true,
41 | name: 'imageSegmenter',
42 | file: 'dist/max.imgseg.cjs.js'
43 | }
44 | ],
45 | plugins: [
46 | replace({
47 | 'process.rollupBrowser': false
48 | }),
49 | jsonPlugin
50 | ]
51 | }
52 | ]
53 |
--------------------------------------------------------------------------------
/image-segmenter/src/image-segmenter-input.js:
--------------------------------------------------------------------------------
1 | /* globals tf, Image */
2 |
3 | const IMAGESIZE = 512
4 |
5 | const computeTargetSize = function (width, height) {
6 | const resizeRatio = IMAGESIZE / Math.max(width, height)
7 |
8 | return {
9 | width: Math.round(resizeRatio * width),
10 | height: Math.round(resizeRatio * height)
11 | }
12 | }
13 |
14 | const getImageData = function (imageInput) {
15 | if (process.rollupBrowser) {
16 | return new Promise((resolve, reject) => {
17 | if (typeof imageInput === 'string') {
18 | const img = new Image()
19 | img.onload = () => resolve(img)
20 | img.onerror = err => reject(err)
21 | img.src = imageInput
22 | } else {
23 | resolve(imageInput)
24 | }
25 | })
26 | } else {
27 | return Promise.resolve(imageInput)
28 | }
29 | }
30 |
31 | const imageToTensor = function (imageData) {
32 | return tf.tidy(() => {
33 | const imgTensor = tf.browser.fromPixels(imageData)
34 | const targetSize = computeTargetSize(imgTensor.shape[0], imgTensor.shape[1])
35 | return imgTensor.resizeBilinear([targetSize.width, targetSize.height]).expandDims()
36 | })
37 | }
38 |
39 | /**
40 | * convert image to Tensor input required by the model
41 | *
42 | * @param {HTMLImageElement} imageInput - the image element
43 | */
44 | const preprocess = function (imageInput) {
45 | return getImageData(imageInput)
46 | .then(imageToTensor)
47 | .then(inputTensor => {
48 | return Promise.resolve(inputTensor)
49 | })
50 | .catch(err => {
51 | console.error(err)
52 | return Promise.reject(err)
53 | })
54 | }
55 |
56 | export { preprocess }
57 |
--------------------------------------------------------------------------------
/image-segmenter/src/image-segmenter-map.js:
--------------------------------------------------------------------------------
1 | const labels = [
2 | 'background',
3 | 'airplane',
4 | 'bicycle',
5 | 'bird',
6 | 'boat',
7 | 'bottle',
8 | 'bus',
9 | 'car',
10 | 'cat',
11 | 'chair',
12 | 'cow',
13 | 'dining table',
14 | 'dog',
15 | 'horse',
16 | 'motorbike',
17 | 'person',
18 | 'potted plant',
19 | 'sheep',
20 | 'sofa',
21 | 'train',
22 | 'tv'
23 | ]
24 |
25 | const colors = [
26 | [0, 0, 0],
27 | [128, 0, 0],
28 | [0, 128, 0],
29 | [128, 128, 0],
30 | [0, 0, 128],
31 | [128, 0, 128],
32 | [0, 128, 128],
33 | [128, 128, 128],
34 | [64, 0, 0],
35 | [192, 0, 0],
36 | [64, 128, 0],
37 | [192, 128, 0],
38 | [64, 0, 128],
39 | [192, 0, 128],
40 | [64, 128, 128],
41 | [192, 128, 128],
42 | [0, 64, 0],
43 | [128, 64, 0],
44 | [0, 192, 0],
45 | [128, 192, 0],
46 | [0, 64, 128],
47 | [128, 64, 128],
48 | [0, 192, 128],
49 | [128, 192, 128],
50 | [64, 64, 0],
51 | [192, 64, 0],
52 | [64, 192, 0],
53 | [192, 192, 0],
54 | [64, 64, 128],
55 | [192, 64, 128],
56 | [64, 192, 128],
57 | [192, 192, 128],
58 | [0, 0, 64],
59 | [128, 0, 64],
60 | [0, 128, 64],
61 | [128, 128, 64],
62 | [0, 0, 192],
63 | [128, 0, 192],
64 | [0, 128, 192],
65 | [128, 128, 192],
66 | [64, 0, 64],
67 | [192, 0, 64],
68 | [64, 128, 64],
69 | [192, 128, 64],
70 | [64, 0, 192],
71 | [192, 0, 192],
72 | [64, 128, 192],
73 | [192, 128, 192],
74 | [0, 64, 64],
75 | [128, 64, 64],
76 | [0, 192, 64],
77 | [128, 192, 64],
78 | [0, 64, 192],
79 | [128, 64, 192],
80 | [0, 192, 192],
81 | [128, 192, 192],
82 | [64, 64, 64],
83 | [192, 64, 64],
84 | [64, 192, 64],
85 | [192, 192, 64],
86 | [64, 64, 192],
87 | [192, 64, 192],
88 | [64, 192, 192],
89 | [192, 192, 192],
90 | [32, 0, 0],
91 | [160, 0, 0],
92 | [32, 128, 0],
93 | [160, 128, 0],
94 | [32, 0, 128],
95 | [160, 0, 128],
96 | [32, 128, 128],
97 | [160, 128, 128],
98 | [96, 0, 0],
99 | [224, 0, 0],
100 | [96, 128, 0],
101 | [224, 128, 0],
102 | [96, 0, 128],
103 | [224, 0, 128],
104 | [96, 128, 128],
105 | [224, 128, 128],
106 | [32, 64, 0],
107 | [160, 64, 0],
108 | [32, 192, 0],
109 | [160, 192, 0],
110 | [32, 64, 128],
111 | [160, 64, 128],
112 | [32, 192, 128],
113 | [160, 192, 128],
114 | [96, 64, 0],
115 | [224, 64, 0],
116 | [96, 192, 0],
117 | [224, 192, 0],
118 | [96, 64, 128],
119 | [224, 64, 128],
120 | [96, 192, 128],
121 | [224, 192, 128],
122 | [32, 0, 64],
123 | [160, 0, 64],
124 | [32, 128, 64],
125 | [160, 128, 64],
126 | [32, 0, 192],
127 | [160, 0, 192],
128 | [32, 128, 192],
129 | [160, 128, 192],
130 | [96, 0, 64],
131 | [224, 0, 64],
132 | [96, 128, 64],
133 | [224, 128, 64],
134 | [96, 0, 192],
135 | [224, 0, 192],
136 | [96, 128, 192],
137 | [224, 128, 192],
138 | [32, 64, 64],
139 | [160, 64, 64],
140 | [32, 192, 64],
141 | [160, 192, 64],
142 | [32, 64, 192],
143 | [160, 64, 192],
144 | [32, 192, 192],
145 | [160, 192, 192],
146 | [96, 64, 64],
147 | [224, 64, 64],
148 | [96, 192, 64],
149 | [224, 192, 64],
150 | [96, 64, 192],
151 | [224, 64, 192],
152 | [96, 192, 192],
153 | [224, 192, 192],
154 | [0, 32, 0],
155 | [128, 32, 0],
156 | [0, 160, 0],
157 | [128, 160, 0],
158 | [0, 32, 128],
159 | [128, 32, 128],
160 | [0, 160, 128],
161 | [128, 160, 128],
162 | [64, 32, 0],
163 | [192, 32, 0],
164 | [64, 160, 0],
165 | [192, 160, 0],
166 | [64, 32, 128],
167 | [192, 32, 128],
168 | [64, 160, 128],
169 | [192, 160, 128],
170 | [0, 96, 0],
171 | [128, 96, 0],
172 | [0, 224, 0],
173 | [128, 224, 0],
174 | [0, 96, 128],
175 | [128, 96, 128],
176 | [0, 224, 128],
177 | [128, 224, 128],
178 | [64, 96, 0],
179 | [192, 96, 0],
180 | [64, 224, 0],
181 | [192, 224, 0],
182 | [64, 96, 128],
183 | [192, 96, 128],
184 | [64, 224, 128],
185 | [192, 224, 128],
186 | [0, 32, 64],
187 | [128, 32, 64],
188 | [0, 160, 64],
189 | [128, 160, 64],
190 | [0, 32, 192],
191 | [128, 32, 192],
192 | [0, 160, 192],
193 | [128, 160, 192],
194 | [64, 32, 64],
195 | [192, 32, 64],
196 | [64, 160, 64],
197 | [192, 160, 64],
198 | [64, 32, 192],
199 | [192, 32, 192],
200 | [64, 160, 192],
201 | [192, 160, 192],
202 | [0, 96, 64],
203 | [128, 96, 64],
204 | [0, 224, 64],
205 | [128, 224, 64],
206 | [0, 96, 192],
207 | [128, 96, 192],
208 | [0, 224, 192],
209 | [128, 224, 192],
210 | [64, 96, 64],
211 | [192, 96, 64],
212 | [64, 224, 64],
213 | [192, 224, 64],
214 | [64, 96, 192],
215 | [192, 96, 192],
216 | [64, 224, 192],
217 | [192, 224, 192],
218 | [32, 32, 0],
219 | [160, 32, 0],
220 | [32, 160, 0],
221 | [160, 160, 0],
222 | [32, 32, 128],
223 | [160, 32, 128],
224 | [32, 160, 128],
225 | [160, 160, 128],
226 | [96, 32, 0],
227 | [224, 32, 0],
228 | [96, 160, 0],
229 | [224, 160, 0],
230 | [96, 32, 128],
231 | [224, 32, 128],
232 | [96, 160, 128],
233 | [224, 160, 128],
234 | [32, 96, 0],
235 | [160, 96, 0],
236 | [32, 224, 0],
237 | [160, 224, 0],
238 | [32, 96, 128],
239 | [160, 96, 128],
240 | [32, 224, 128],
241 | [160, 224, 128],
242 | [96, 96, 0],
243 | [224, 96, 0],
244 | [96, 224, 0],
245 | [224, 224, 0],
246 | [96, 96, 128],
247 | [224, 96, 128],
248 | [96, 224, 128],
249 | [224, 224, 128],
250 | [32, 32, 64],
251 | [160, 32, 64],
252 | [32, 160, 64],
253 | [160, 160, 64],
254 | [32, 32, 192],
255 | [160, 32, 192],
256 | [32, 160, 192],
257 | [160, 160, 192],
258 | [96, 32, 64],
259 | [224, 32, 64],
260 | [96, 160, 64],
261 | [224, 160, 64],
262 | [96, 32, 192],
263 | [224, 32, 192],
264 | [96, 160, 192],
265 | [224, 160, 192],
266 | [32, 96, 64],
267 | [160, 96, 64],
268 | [32, 224, 64],
269 | [160, 224, 64],
270 | [32, 96, 192],
271 | [160, 96, 192],
272 | [32, 224, 192],
273 | [160, 224, 192],
274 | [96, 96, 64],
275 | [224, 96, 64],
276 | [96, 224, 64],
277 | [224, 224, 64],
278 | [96, 96, 192],
279 | [224, 96, 192],
280 | [96, 224, 192],
281 | [224, 224, 192]
282 | ]
283 |
284 | export { labels, colors }
285 |
--------------------------------------------------------------------------------
/image-segmenter/src/image-segmenter-model.js:
--------------------------------------------------------------------------------
1 | /* globals tf */
2 |
3 | let modelPath = null
4 |
5 | if (!process.rollupBrowser) {
6 | modelPath = `file://${__dirname}/../model/model.json`
7 | } else {
8 | modelPath = 'https://s3.us.cloud-object-storage.appdomain.cloud/codait-cos-max/max-image-segmenter/tfjs/0.1.0/model.json'
9 | }
10 | let model = null
11 | let warmed = false
12 |
13 | /**
14 | * load the image segmenter model
15 | */
16 | const load = function (initialize) {
17 | if (!model) {
18 | // console.log('loading model...')
19 | // console.time('model load')
20 | return tf.loadGraphModel(modelPath)
21 | .then(m => {
22 | // console.timeEnd('model load')
23 | model = m
24 | if (istrue(initialize)) {
25 | warmup()
26 | }
27 | return Promise.resolve(model)
28 | })
29 | .catch(err => {
30 | // console.timeEnd('model load')
31 | console.error(err)
32 | return Promise.reject(err)
33 | })
34 | } else if (istrue(initialize) && !warmed) {
35 | warmup()
36 | return Promise.resolve(model)
37 | } else {
38 | return Promise.resolve(model)
39 | }
40 | }
41 |
42 | /**
43 | * run the model to get a prediction
44 | */
45 | const run = function (imageTensor) {
46 | if (!imageTensor) {
47 | console.error('no image provided')
48 | throw new Error('no image provided')
49 | } else if (!model) {
50 | console.error('model not available')
51 | throw new Error('model not available')
52 | } else {
53 | // console.log('running model...')
54 | return tf.tidy(() => {
55 | // console.time('model inference')
56 | const results = model.predict(imageTensor.toInt())
57 | // console.timeEnd('model inference')
58 | warmed = true
59 | return results
60 | })
61 | }
62 | }
63 |
64 | /**
65 | * run inference on the TensorFlow.js model
66 | */
67 | const inference = function (imageTensor) {
68 | return load(false).then(() => {
69 | try {
70 | const results = run(imageTensor)
71 | return Promise.resolve(results)
72 | } catch (err) {
73 | return Promise.reject(err)
74 | }
75 | })
76 | }
77 |
78 | const warmup = function () {
79 | try {
80 | run(tf.zeros([1, 512, 512, 3]))
81 | } catch (err) { }
82 | }
83 |
84 | const istrue = function (param) {
85 | return param === null ||
86 | typeof param === 'undefined' ||
87 | (typeof param === 'string' && param.toLowerCase() === 'true') ||
88 | (typeof param === 'boolean' && param)
89 | }
90 |
91 | if (process.rollupBrowser) {
92 | const init = document.currentScript.getAttribute('data-init-model')
93 | if (istrue(init)) {
94 | load(true)
95 | }
96 | }
97 |
98 | export { load, inference }
99 |
--------------------------------------------------------------------------------
/image-segmenter/src/image-segmenter-output.js:
--------------------------------------------------------------------------------
1 | import { labels } from './image-segmenter-map.js'
2 |
3 | const predictedObjs = function (segArray) {
4 | const segLabels = {}
5 | segArray.forEach(arr => {
6 | arr.forEach(seg => {
7 | if (!segLabels[labels[seg]]) {
8 | segLabels[labels[seg]] = true
9 | }
10 | })
11 | })
12 | return Object.keys(segLabels)
13 | }
14 |
15 | /**
16 | * convert model Tensor output to image data for previewing
17 | *
18 | * @param {Tensor} inferenceResults - the output from running the model
19 | */
20 | const postprocess = function (inferenceResults) {
21 | return inferenceResults.unstack()[0].array()
22 | .then(segArray => {
23 | return Promise.resolve({
24 | segmentationMap: segArray,
25 | objectsDetected: predictedObjs(segArray),
26 | imageSize: {
27 | width: segArray[0].length,
28 | height: segArray.length
29 | }
30 | })
31 | })
32 | }
33 |
34 | export { postprocess }
35 |
--------------------------------------------------------------------------------
/image-segmenter/src/image-segmenter.js:
--------------------------------------------------------------------------------
1 | import { preprocess } from './image-segmenter-input.js'
2 | import { load, inference } from './image-segmenter-model.js'
3 | import { postprocess } from './image-segmenter-output.js'
4 | import { labels as labelsMap, colors as colorsMap } from './image-segmenter-map.js'
5 | import { version } from '../package.json'
6 |
7 | if (!process.rollupBrowser) {
8 | global.tf = require('@tensorflow/tfjs-node')
9 | }
10 |
11 | const processInput = function (inputImage) {
12 | return preprocess(inputImage)
13 | }
14 |
15 | const loadModel = function (init) {
16 | return load(init)
17 | }
18 |
19 | const runInference = function (inputTensor) {
20 | return inference(inputTensor)
21 | }
22 |
23 | const processOutput = function (inferenceResults) {
24 | return postprocess(inferenceResults)
25 | }
26 |
27 | const predict = function (inputImage) {
28 | return processInput(inputImage)
29 | .then(runInference)
30 | .then(processOutput)
31 | .catch(err => {
32 | console.error(err)
33 | })
34 | }
35 |
36 | export {
37 | predict,
38 | processInput,
39 | loadModel,
40 | runInference,
41 | processOutput,
42 | labelsMap,
43 | colorsMap,
44 | version
45 | }
46 |
--------------------------------------------------------------------------------
/image-segmenter/test/group.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CODAIT/max-tfjs-models/7104d423078d05adb80249ceed565211fcaa116e/image-segmenter/test/group.jpg
--------------------------------------------------------------------------------
/image-segmenter/test/test.js:
--------------------------------------------------------------------------------
1 | /* globals describe, it, expect, beforeAll, jasmine, tf */
2 |
3 | const jimp = require('jimp')
4 | const nodeCanvas = require('canvas')
5 | const imageSegmenter = require('../dist/max.imgseg.cjs.js')
6 |
7 | const imagePath = `${__dirname}/group.jpg`
8 |
9 | const createCanvasElement = function (imageInput) {
10 | let canvas = null
11 | return nodeCanvas.loadImage(imageInput).then(img => {
12 | canvas = nodeCanvas.createCanvas(img.width, img.height)
13 | const ctx = canvas.getContext('2d')
14 | return ctx.drawImage(img, 0, 0)
15 | }).then(() => {
16 | return canvas
17 | })
18 | }
19 |
20 | describe('Image Segmenter', function () {
21 | const input = jimp.read(imagePath)
22 | .then(imageData => imageData.getBufferAsync(jimp.MIME_PNG))
23 | .then(imageBuffer => createCanvasElement(imageBuffer))
24 |
25 | it('version returns a valid version number', function () {
26 | expect(imageSegmenter.version).toMatch(/(\d+\.){2}(\d+)/)
27 | })
28 |
29 | it('processInput() resizes to a maximum of 512px length/width', function () {
30 | return input.then(imageElement => imageSegmenter.processInput(imageElement))
31 | .then(result => expect(result.shape).toContain(512))
32 | })
33 |
34 | it('runInference() returns a tf.Tensor', function () {
35 | return imageSegmenter.runInference(tf.zeros([1, 512, 512, 3]))
36 | .then(result => expect(result).toEqual(jasmine.any(tf.Tensor)))
37 | })
38 |
39 | describe('predict results are consistent', function () {
40 | var prediction
41 |
42 | beforeAll(async function () {
43 | prediction = await input.then(imageElement => imageSegmenter.predict(imageElement))
44 | })
45 |
46 | it('predict() works returns object containing segmentationMap, objectsDetected, imageSize', function () {
47 | expect(Object.keys(prediction)).toEqual(jasmine.arrayContaining(['segmentationMap', 'objectsDetected', 'imageSize']))
48 | })
49 |
50 | it('segmentationMap has same dimensions as imageSize', function () {
51 | expect(prediction.imageSize.height).toEqual(prediction.segmentationMap.length)
52 | expect(prediction.imageSize.width).toEqual(prediction.segmentationMap[0].length)
53 | })
54 |
55 | it('test image has multiple objects detected', function () {
56 | expect(prediction.objectsDetected.length).toBeGreaterThan(1)
57 | })
58 | })
59 | })
60 |
--------------------------------------------------------------------------------