Skip to content

Commit

Permalink
update models peerDependencies to be individual npm instead of union (#…
Browse files Browse the repository at this point in the history
…237)

cla: yes
* update all models deps to be individual npm instead of union

* fixed test

* addressed comments

* udpate the demo deps

* fix test

* updated the minor versions and peer deps

* update all demo deps

* addressed comments

* remove DS_Store files

* fixed the typo
  • Loading branch information
pyu10055 committed Jun 19, 2019
1 parent 4b2d643 commit 6d16029
Show file tree
Hide file tree
Showing 40 changed files with 171 additions and 273 deletions.
4 changes: 2 additions & 2 deletions body-pix/demos/package.json
Expand Up @@ -9,8 +9,8 @@
"node": ">=8.9.0"
},
"dependencies": {
"@tensorflow-models/body-pix": "1.0.1",
"@tensorflow/tfjs": "1.1.0",
"@tensorflow-models/body-pix": "1.1.0",
"@tensorflow/tfjs": "1.2.1",
"stats.js": "0.17.0"
},
"scripts": {
Expand Down
6 changes: 2 additions & 4 deletions body-pix/demos/yarn.lock
Expand Up @@ -755,10 +755,8 @@
"@parcel/utils" "^1.11.0"
physical-cpu-count "^2.0.0"

"@tensorflow-models/body-pix@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@tensorflow-models/body-pix/-/body-pix-1.0.1.tgz#bcf0b680b14dd65f7249a922d16a5afb132c1549"
integrity sha512-s63eE+ns6ArGZ6MiX7t95yzUPUxdUkEUFwG8jWkhAlDSANiqFFM1rmNcIp2iF2ldojftFRr2y7vwHGocFYrDdQ==
"@tensorflow-models/body-pix@file:.yalc/@tensorflow-models/body-pix":
version "1.0.1-5c8afa55"

"@tensorflow/tfjs-converter@1.1.0":
version "1.1.0"
Expand Down
8 changes: 5 additions & 3 deletions body-pix/package.json
@@ -1,6 +1,6 @@
{
"name": "@tensorflow-models/body-pix",
"version": "1.0.1",
"version": "1.1.0",
"description": "Pretrained BodyPix model in TensorFlow.js",
"main": "dist/index.js",
"jsnext:main": "dist/body-pix.esm.js",
Expand All @@ -13,10 +13,12 @@
"url": "https://github.com/tensorflow/tfjs-models.git"
},
"peerDependencies": {
"@tensorflow/tfjs": "^1.1.0"
"@tensorflow/tfjs-core": "~1.2.1",
"@tensorflow/tfjs-converter": "~1.2.1"
},
"devDependencies": {
"@tensorflow/tfjs": "^1.1.0",
"@tensorflow/tfjs-core": "~1.2.1",
"@tensorflow/tfjs-converter": "~1.2.1",
"@types/jasmine": "~2.5.53",
"jasmine": "~3.2.0",
"jasmine-core": "~3.1.0",
Expand Down
7 changes: 4 additions & 3 deletions body-pix/src/body_pix_model.ts
Expand Up @@ -16,7 +16,8 @@
* =============================================================================
*/

import * as tf from '@tensorflow/tfjs';
import * as tfconv from '@tensorflow/tfjs-converter';
import * as tf from '@tensorflow/tfjs-core';

import {checkpoints} from './checkpoints';
import {decodePartSegmentation, toMask} from './decode_part_map';
Expand Down Expand Up @@ -235,8 +236,8 @@ export const mobilenetLoader = {

const baseUrl = checkpoint.url;

const model =
await tf.loadGraphModel(`${baseUrl}model.json`) as tf.GraphModel;
const model = await tfconv.loadGraphModel(`${baseUrl}model.json`) as
tfconv.GraphModel;

const weights = new ModelWeights(model);

Expand Down
2 changes: 1 addition & 1 deletion body-pix/src/body_pix_test.ts
Expand Up @@ -15,7 +15,7 @@
* =============================================================================
*/

import * as tf from '@tensorflow/tfjs';
import * as tf from '@tensorflow/tfjs-core';
import {describeWithFlags, NODE_ENVS} from '@tensorflow/tfjs-core/dist/jasmine_util';

import {BodyPix, load, mobilenetLoader} from './body_pix_model';
Expand Down
2 changes: 1 addition & 1 deletion body-pix/src/decode_part_map.ts
Expand Up @@ -15,7 +15,7 @@
* =============================================================================
*/

import * as tf from '@tensorflow/tfjs';
import * as tf from '@tensorflow/tfjs-core';

/**
* Takes the sigmoid of the part heatmap output and generates a 2d one-hot
Expand Down
2 changes: 1 addition & 1 deletion body-pix/src/mobilenet.ts
Expand Up @@ -15,7 +15,7 @@
* =============================================================================
*/

import * as tf from '@tensorflow/tfjs';
import * as tf from '@tensorflow/tfjs-core';
import {ModelWeights} from './model_weights';

export type MobileNetMultiplier = 0.25|0.50|0.75|1.0|1.01;
Expand Down
7 changes: 4 additions & 3 deletions body-pix/src/model_weights.ts
Expand Up @@ -15,12 +15,13 @@
* =============================================================================
*/

import * as tf from '@tensorflow/tfjs';
import * as tfconv from '@tensorflow/tfjs-converter';
import * as tf from '@tensorflow/tfjs-core';

export class ModelWeights {
private graphModel: tf.GraphModel;
private graphModel: tfconv.GraphModel;

constructor(graphModel: tf.GraphModel) {
constructor(graphModel: tfconv.GraphModel) {
this.graphModel = graphModel;
}

Expand Down
2 changes: 1 addition & 1 deletion body-pix/src/types.ts
@@ -1,4 +1,4 @@
import * as tf from '@tensorflow/tfjs';
import * as tf from '@tensorflow/tfjs-core';

export type BodyPixInput =
ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|tf.Tensor3D;
Expand Down
2 changes: 1 addition & 1 deletion body-pix/src/util.ts
@@ -1,4 +1,4 @@
import * as tf from '@tensorflow/tfjs';
import * as tf from '@tensorflow/tfjs-core';

import {BodyPixInput} from './types';

Expand Down
46 changes: 8 additions & 38 deletions body-pix/yarn.lock
Expand Up @@ -2,15 +2,15 @@
# yarn lockfile v1


"@tensorflow/tfjs-converter@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-converter/-/tfjs-converter-1.1.0.tgz#1d6f58347e9b3826c02090e06e6590b0c4df2d4e"
integrity sha512-gUkoRoYm9yrVVQNp8nD+pEWOPUNhayCSrUHNItSfIm8Lzbgx6brVxVdz5T8V0kT0yh67Pp9Er/LIlf54p7KikA==
"@tensorflow/tfjs-converter@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-converter/-/tfjs-converter-1.2.1.tgz#996e9e2e7d0f03717e7fc1211176ee43049b38ac"
integrity sha512-HKWlGV9uSWMUaogo6TyS/x2xdgO/du/vXPj91iGnm+t44Jl++1PXYD0LKD1LdNLR2RhUS3TJv6HuqDmYOO8EYw==

"@tensorflow/tfjs-core@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.1.0.tgz#028c69291e19c328c4c30e18d29b09135c22cb44"
integrity sha512-loPpHGVjiyEb+Ixlsj8prQ/r4exekITn7vM4WEyHUouFKx0/CuoB2FQ0m6DSb/6ApvucxTWGGNTRRo4HK4Ma0Q==
"@tensorflow/tfjs-core@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.2.1.tgz#0ff54aa7fd412b8c17e39f6ec5a97bf032e8f530"
integrity sha512-cpSHl+tP7cketq0cAyJPbIGxNlPV7mR6lkMLLDvZAmZUTBSyBufCdJg/KwgjHMZksE/KqjL4/RyccOGBAQcb7g==
dependencies:
"@types/seedrandom" "2.4.27"
"@types/webgl-ext" "0.0.30"
Expand All @@ -20,29 +20,6 @@
optionalDependencies:
rollup-plugin-visualizer "~1.1.1"

"@tensorflow/tfjs-data@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-data/-/tfjs-data-1.1.0.tgz#8d9a0175497930061532c8d43b419b25b26b9bbf"
integrity sha512-0+PfAsaZs/pmaxiLunb4c1rPRdu47+CYe5kxpu2P8Xn3k+vhlBYMu+zsVgs5RrTRFLWVzVeH9muA1SJLkMGZPA==
dependencies:
"@types/node-fetch" "^2.1.2"
node-fetch "~2.1.2"

"@tensorflow/tfjs-layers@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-layers/-/tfjs-layers-1.1.0.tgz#fd221c254d2fca13e93e83669bdde3140e7a0434"
integrity sha512-a0gXjOWvGi9gc2q8/gK79zfD5WqEZnAhZfpm6b7AoKXjDUBq4GgdbbWCfv2nYBlmMoXgRSRSV44UmJVExep0uw==

"@tensorflow/tfjs@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs/-/tfjs-1.1.0.tgz#77809dc336655a7ff0bbf76527cc3d7b9e68e330"
integrity sha512-CxcFzl2KtknO3f12xuuv8kq8usMA7xGWpJajubIlYBp4KoBDhiDimP/DwBlTvFZq5RT5riHGtA4BWjMj6rnDcw==
dependencies:
"@tensorflow/tfjs-converter" "1.1.0"
"@tensorflow/tfjs-core" "1.1.0"
"@tensorflow/tfjs-data" "1.1.0"
"@tensorflow/tfjs-layers" "1.1.0"

"@types/estree@0.0.38":
version "0.0.38"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.38.tgz#c1be40aa933723c608820a99a373a16d215a1ca2"
Expand All @@ -53,13 +30,6 @@
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.5.54.tgz#a6b5f2ae2afb6e0307774e8c7c608e037d491c63"
integrity sha512-B9YofFbUljs19g5gBKUYeLIulsh31U5AK70F41BImQRHEZQGm4GcN922UvnYwkduMqbC/NH+9fruWa/zrqvHIg==

"@types/node-fetch@^2.1.2":
version "2.3.2"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.3.2.tgz#e01893b176c6fa1367743726380d65bce5d6576b"
integrity sha512-yW0EOebSsQme9yKu09XbdDfle4/SmWZMK4dfteWcSLCYNQQcF+YOv0kIrvm+9pO11/ghA4E6A+RNQqvYj4Nr3A==
dependencies:
"@types/node" "*"

"@types/node@*":
version "11.13.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.6.tgz#37ec75690830acb0d74ce3c6c43caab787081e85"
Expand Down
4 changes: 2 additions & 2 deletions coco-ssd/demo/package.json
Expand Up @@ -9,8 +9,8 @@
"node": ">=8.9.0"
},
"dependencies": {
"@tensorflow-models/coco-ssd": "1.0.1",
"@tensorflow/tfjs": "1.1.0",
"@tensorflow-models/coco-ssd": "1.1.0",
"@tensorflow/tfjs": "1.2.1",
"stats.js": "^0.17.0"
},
"scripts": {
Expand Down
6 changes: 2 additions & 4 deletions coco-ssd/demo/yarn.lock
Expand Up @@ -651,10 +651,8 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==

"@tensorflow-models/coco-ssd@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@tensorflow-models/coco-ssd/-/coco-ssd-1.0.1.tgz#7b038f08d7e23528c52491e4e80b946bcf30bae8"
integrity sha512-3oHdEYUAvQu6rbCu08K0j2tI3K+C/p9HVi8OWs2mrhAj8/b91nEz/ZKqmRG10AJffOJCFM5T0FWzr5xadBxOdw==
"@tensorflow-models/coco-ssd@file:.yalc/@tensorflow-models/coco-ssd":
version "1.0.2-b75c3e2b"

"@tensorflow/tfjs-converter@1.1.0":
version "1.1.0"
Expand Down
8 changes: 5 additions & 3 deletions coco-ssd/package.json
@@ -1,6 +1,6 @@
{
"name": "@tensorflow-models/coco-ssd",
"version": "1.0.2",
"version": "1.1.0",
"description": "Object detection model (coco-ssd) in TensorFlow.js",
"main": "dist/index.js",
"unpkg": "dist/coco-ssd.min.js",
Expand All @@ -13,10 +13,12 @@
"url": "https://github.com/tensorflow/tfjs-models.git"
},
"peerDependencies": {
"@tensorflow/tfjs": "^1.1.0"
"@tensorflow/tfjs-core": "~1.2.1",
"@tensorflow/tfjs-converter": "~1.2.1"
},
"devDependencies": {
"@tensorflow/tfjs": "^1.1.0",
"@tensorflow/tfjs-core": "~1.2.1",
"@tensorflow/tfjs-converter": "~1.2.1",
"@types/jasmine": "~2.8.8",
"babel-core": "~6.26.0",
"babel-plugin-transform-runtime": "~6.23.0",
Expand Down
8 changes: 5 additions & 3 deletions coco-ssd/src/index.ts
Expand Up @@ -15,7 +15,9 @@
* =============================================================================
*/

import * as tf from '@tensorflow/tfjs';
import * as tfconv from '@tensorflow/tfjs-converter';
import * as tf from '@tensorflow/tfjs-core';

import {CLASSES} from './classes';

const BASE_PATH = 'https://storage.googleapis.com/tfjs-models/savedmodel/';
Expand Down Expand Up @@ -54,7 +56,7 @@ export async function load(

export class ObjectDetection {
private modelPath: string;
private model: tf.GraphModel;
private model: tfconv.GraphModel;

constructor(base: ObjectDetectionBaseModel) {
this.modelPath = `${BASE_PATH}${this.getPrefix(base)}/model.json`;
Expand All @@ -65,7 +67,7 @@ export class ObjectDetection {
}

async load() {
this.model = await tf.loadGraphModel(this.modelPath);
this.model = await tfconv.loadGraphModel(this.modelPath);

// Warmup the model.
const result = await this.model.executeAsync(tf.zeros([1, 300, 300, 3])) as
Expand Down
6 changes: 4 additions & 2 deletions coco-ssd/src/ssd_test.ts
Expand Up @@ -14,13 +14,15 @@
* limitations under the License.
* =============================================================================
*/
import * as tf from '@tensorflow/tfjs';
import * as tfconv from '@tensorflow/tfjs-converter';
import * as tf from '@tensorflow/tfjs-core';
import {describeWithFlags, NODE_ENVS} from '@tensorflow/tfjs-core/dist/jasmine_util';

import {load} from './index';

describeWithFlags('ObjectDetection', NODE_ENVS, () => {
beforeEach(() => {
spyOn(tf, 'loadGraphModel').and.callFake(() => {
spyOn(tfconv, 'loadGraphModel').and.callFake(() => {
const model = {
executeAsync: (
x: tf
Expand Down
46 changes: 8 additions & 38 deletions coco-ssd/yarn.lock
Expand Up @@ -2,15 +2,15 @@
# yarn lockfile v1


"@tensorflow/tfjs-converter@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-converter/-/tfjs-converter-1.1.0.tgz#1d6f58347e9b3826c02090e06e6590b0c4df2d4e"
integrity sha512-gUkoRoYm9yrVVQNp8nD+pEWOPUNhayCSrUHNItSfIm8Lzbgx6brVxVdz5T8V0kT0yh67Pp9Er/LIlf54p7KikA==
"@tensorflow/tfjs-converter@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-converter/-/tfjs-converter-1.2.1.tgz#996e9e2e7d0f03717e7fc1211176ee43049b38ac"
integrity sha512-HKWlGV9uSWMUaogo6TyS/x2xdgO/du/vXPj91iGnm+t44Jl++1PXYD0LKD1LdNLR2RhUS3TJv6HuqDmYOO8EYw==

"@tensorflow/tfjs-core@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.1.0.tgz#028c69291e19c328c4c30e18d29b09135c22cb44"
integrity sha512-loPpHGVjiyEb+Ixlsj8prQ/r4exekITn7vM4WEyHUouFKx0/CuoB2FQ0m6DSb/6ApvucxTWGGNTRRo4HK4Ma0Q==
"@tensorflow/tfjs-core@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.2.1.tgz#0ff54aa7fd412b8c17e39f6ec5a97bf032e8f530"
integrity sha512-cpSHl+tP7cketq0cAyJPbIGxNlPV7mR6lkMLLDvZAmZUTBSyBufCdJg/KwgjHMZksE/KqjL4/RyccOGBAQcb7g==
dependencies:
"@types/seedrandom" "2.4.27"
"@types/webgl-ext" "0.0.30"
Expand All @@ -20,29 +20,6 @@
optionalDependencies:
rollup-plugin-visualizer "~1.1.1"

"@tensorflow/tfjs-data@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-data/-/tfjs-data-1.1.0.tgz#8d9a0175497930061532c8d43b419b25b26b9bbf"
integrity sha512-0+PfAsaZs/pmaxiLunb4c1rPRdu47+CYe5kxpu2P8Xn3k+vhlBYMu+zsVgs5RrTRFLWVzVeH9muA1SJLkMGZPA==
dependencies:
"@types/node-fetch" "^2.1.2"
node-fetch "~2.1.2"

"@tensorflow/tfjs-layers@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-layers/-/tfjs-layers-1.1.0.tgz#fd221c254d2fca13e93e83669bdde3140e7a0434"
integrity sha512-a0gXjOWvGi9gc2q8/gK79zfD5WqEZnAhZfpm6b7AoKXjDUBq4GgdbbWCfv2nYBlmMoXgRSRSV44UmJVExep0uw==

"@tensorflow/tfjs@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs/-/tfjs-1.1.0.tgz#77809dc336655a7ff0bbf76527cc3d7b9e68e330"
integrity sha512-CxcFzl2KtknO3f12xuuv8kq8usMA7xGWpJajubIlYBp4KoBDhiDimP/DwBlTvFZq5RT5riHGtA4BWjMj6rnDcw==
dependencies:
"@tensorflow/tfjs-converter" "1.1.0"
"@tensorflow/tfjs-core" "1.1.0"
"@tensorflow/tfjs-data" "1.1.0"
"@tensorflow/tfjs-layers" "1.1.0"

"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
Expand All @@ -53,13 +30,6 @@
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.16.tgz#a6cb24b1149d65293bd616923500014838e14e7d"
integrity sha512-056oRlBBp7MDzr+HoU5su099s/s7wjZ3KcHxLfv+Byqb9MwdLUvsfLgw1VS97hsh3ddxSPyQu+olHMnoVTUY6g==

"@types/node-fetch@^2.1.2":
version "2.3.2"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.3.2.tgz#e01893b176c6fa1367743726380d65bce5d6576b"
integrity sha512-yW0EOebSsQme9yKu09XbdDfle4/SmWZMK4dfteWcSLCYNQQcF+YOv0kIrvm+9pO11/ghA4E6A+RNQqvYj4Nr3A==
dependencies:
"@types/node" "*"

"@types/node@*":
version "11.13.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.6.tgz#37ec75690830acb0d74ce3c6c43caab787081e85"
Expand Down
3 changes: 2 additions & 1 deletion knn-classifier/demo/package.json
Expand Up @@ -9,8 +9,9 @@
"node": ">=8.9.0"
},
"dependencies": {
"@tensorflow-models/knn-classifier": "1.2.0",
"@tensorflow-models/mobilenet": "^1.0.1",
"@tensorflow/tfjs": "^1.1.0",
"@tensorflow/tfjs": "^1.2.1",
"stats.js": "^0.17.0"
},
"scripts": {
Expand Down

0 comments on commit 6d16029

Please sign in to comment.