Skip to content

Commit e80d693

Browse files
author
Nikhil Thorat
authored
Add publish-npm, make-version, tag-version scripts to models. (#369)
Also adds versions and unit tests to each model. We're also bumping the patch version for each of these so I can publish a new version, tag them, and then have them sync back to google.
1 parent 34814fa commit e80d693

File tree

120 files changed

+674
-324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+674
-324
lines changed

body-pix/karma.conf.js

+40-49
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc. All Rights Reserved.
3+
* Copyright 2019 Google LLC. All Rights Reserved.
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
@@ -15,53 +15,44 @@
1515
* =============================================================================
1616
*/
1717

18-
module.exports = function (config) {
19-
config.set({
20-
frameworks: ['jasmine', 'karma-typescript'],
21-
files: [
22-
"src/setup_test.ts", // Setup the environment for the tests.
23-
{pattern: 'src/**/*.ts'}
24-
],
25-
preprocessors: {
26-
'**/*.ts': ['karma-typescript'],
18+
module.exports = function(config) {
19+
config.set({
20+
frameworks: ['jasmine', 'karma-typescript'],
21+
files: [
22+
'src/setup_test.ts', // Setup the environment for the tests.
23+
{pattern: 'src/**/*.ts'}
24+
],
25+
preprocessors: {
26+
'**/*.ts': ['karma-typescript'],
27+
},
28+
karmaTypescriptConfig:
29+
{tsconfig: 'tsconfig.json', compilerOptions: {module: 'commonjs'}},
30+
reporters: ['progress', 'karma-typescript'],
31+
browsers: ['Chrome'],
32+
browserStack: {
33+
username: process.env.BROWSERSTACK_USERNAME,
34+
accessKey: process.env.BROWSERSTACK_KEY
35+
},
36+
reportSlowerThan: 500,
37+
browserNoActivityTimeout: 30000,
38+
customLaunchers: {
39+
bs_chrome_mac: {
40+
base: 'BrowserStack',
41+
browser: 'chrome',
42+
browser_version: 'latest',
43+
os: 'OS X',
44+
os_version: 'High Sierra'
2745
},
28-
karmaTypescriptConfig: {
29-
tsconfig: 'tsconfig.json',
30-
compilerOptions: {
31-
module: 'commonjs'
32-
}
33-
},
34-
reporters: ['progress', 'karma-typescript'],
35-
browsers: ['Chrome'],
36-
browserStack: {
37-
username: process.env.BROWSERSTACK_USERNAME,
38-
accessKey: process.env.BROWSERSTACK_KEY
39-
},
40-
reportSlowerThan: 500,
41-
browserNoActivityTimeout: 30000,
42-
customLaunchers: {
43-
bs_chrome_mac: {
44-
base: 'BrowserStack',
45-
browser: 'chrome',
46-
browser_version: 'latest',
47-
os: 'OS X',
48-
os_version: 'High Sierra'
49-
},
50-
bs_firefox_mac: {
51-
base: 'BrowserStack',
52-
browser: 'firefox',
53-
// TODO(nsthorat): Change to latest after browser stack infrastructure
54-
// stabilizes. https://github.com/tensorflow/tfjs/issues/1620
55-
browser_version: '66.0',
56-
os: 'OS X',
57-
os_version: 'High Sierra'
58-
}
59-
},
60-
client: {
61-
jasmine: {
62-
random: false
63-
},
64-
args: ['--grep', config.grep || '']
46+
bs_firefox_mac: {
47+
base: 'BrowserStack',
48+
browser: 'firefox',
49+
// TODO(nsthorat): Change to latest after browser stack infrastructure
50+
// stabilizes. https://github.com/tensorflow/tfjs/issues/1620
51+
browser_version: '66.0',
52+
os: 'OS X',
53+
os_version: 'High Sierra'
6554
}
66-
});
67-
};
55+
},
56+
client: {jasmine: {random: false}, args: ['--grep', config.grep || '']}
57+
});
58+
};

body-pix/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tensorflow-models/body-pix",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "Pretrained BodyPix model in TensorFlow.js",
55
"main": "dist/index.js",
66
"jsnext:main": "dist/body-pix.esm.js",
@@ -43,7 +43,7 @@
4343
"publish-local": "yarn build && rollup -c && yalc publish",
4444
"test": "karma start",
4545
"test-ci": "karma start --singleRun --browsers=bs_chrome_mac",
46-
"publish-npm": "yarn build && rollup -c && npm publish",
46+
"build-npm": "yarn build && rollup -c",
4747
"lint": "tslint -p . -t verbose"
4848
},
4949
"license": "Apache-2.0",

body-pix/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ export {BodyPix, load} from './body_pix_model';
1919
export {blurBodyPart, drawBokehEffect, drawMask, drawPixelatedMask, toColoredPartMask, toMask} from './output_rendering_util';
2020
export {PART_CHANNELS} from './part_channels';
2121
export {flipPoseHorizontal, resizeAndPadTo, scaleAndCropToInputTensorShape} from './util';
22+
23+
export {version} from './version';

body-pix/src/version.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @license See the LICENSE file. */
2+
3+
// This code is auto-generated, do not modify this file!
4+
const version = '2.0.4';
5+
export {version};

body-pix/src/version_test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google LLC. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
* =============================================================================
16+
*/
17+
18+
import {version} from './index';
19+
20+
describe('version', () => {
21+
it('version matches package.json', () => {
22+
// tslint:disable-next-line:no-require-imports
23+
const expected = require('../package.json').version;
24+
expect(version).toBe(expected);
25+
});
26+
});

coco-ssd/demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright 2018 Google LLC. All Rights Reserved.
1+
<!-- Copyright 2019 Google LLC. All Rights Reserved.
22
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

coco-ssd/demo/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2018 Google LLC. All Rights Reserved.
3+
* Copyright 2019 Google LLC. All Rights Reserved.
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at

coco-ssd/make_version

-35
This file was deleted.

coco-ssd/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tensorflow-models/coco-ssd",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Object detection model (coco-ssd) in TensorFlow.js",
55
"main": "dist/index.js",
66
"unpkg": "dist/coco-ssd.min.js",
@@ -37,7 +37,7 @@
3737
"build": "rimraf dist && tsc",
3838
"lint": "tslint -p . -t verbose",
3939
"publish-local": "yarn build && rollup -c && yalc push",
40-
"publish-npm": "yarn build && rollup -c && npm publish",
40+
"build-npm": "yarn build && rollup -c",
4141
"test": "yarn build && ts-node run_tests.ts"
4242
},
4343
"license": "Apache-2.0"

coco-ssd/rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2018 Google Inc. All Rights Reserved.
3+
* Copyright 2019 Google LLC. All Rights Reserved.
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at

coco-ssd/run_tests.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
33
* @license
4-
* Copyright 2018 Google LLC. All Rights Reserved.
4+
* Copyright 2019 Google LLC. All Rights Reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
@@ -19,4 +19,4 @@
1919
import * as jasmine_util from '@tensorflow/tfjs-core/dist/jasmine_util';
2020
import {runTests} from '../test_util';
2121

22-
runTests(jasmine_util);
22+
runTests(jasmine_util);

coco-ssd/src/classes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
33
* @license
4-
* Copyright 2017 Google LLC. All Rights Reserved.
4+
* Copyright 2019 Google LLC. All Rights Reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at

coco-ssd/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2018 Google LLC. All Rights Reserved.
3+
* Copyright 2019 Google LLC. All Rights Reserved.
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at

coco-ssd/src/ssd_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2018 Google LLC. All Rights Reserved.
3+
* Copyright 2019 Google LLC. All Rights Reserved.
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at

coco-ssd/src/version.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/** @license See the LICENSE file. */
2+
23
// This code is auto-generated, do not modify this file!
3-
const version = '2.0.0';
4+
const version = '2.0.1';
45
export {version};

coco-ssd/src/version_test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google LLC. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
* =============================================================================
16+
*/
17+
18+
import {version} from './index';
19+
20+
describe('version', () => {
21+
it('version matches package.json', () => {
22+
// tslint:disable-next-line:no-require-imports
23+
const expected = require('../package.json').version;
24+
expect(version).toBe(expected);
25+
});
26+
});

deeplab/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tensorflow-models/deeplab",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Semantic Segmentation in the Browser: DeepLab v3 Model",
55
"main": "dist/index.js",
66
"jsnext:main": "dist/deeplab.esm.js",
@@ -38,7 +38,7 @@
3838
"build": "rimraf dist && tsc",
3939
"test": "ts-node run_tests.ts",
4040
"publish-local": "yarn build && rollup -c && yalc push",
41-
"publish-npm": "yarn build && rollup -c && npm publish",
41+
"build-npm": "yarn build && rollup -c",
4242
"lint": "tslint -p . -t verbose"
4343
},
4444
"license": "Apache-2.0",

deeplab/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import * as tf from '@tensorflow/tfjs-core';
2121
import {DeepLabInput, DeepLabOutput, ModelArchitecture, ModelConfig, PredictionConfig} from './types';
2222
import {getColormap, getLabels, getURL, toInputTensor, toSegmentationImage} from './utils';
2323

24+
export {version} from './version';
2425
export {getColormap, getLabels, getURL, toSegmentationImage};
2526

2627
/**

deeplab/src/version.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @license See the LICENSE file. */
2+
3+
// This code is auto-generated, do not modify this file!
4+
const version = '0.1.1';
5+
export {version};

deeplab/src/version_test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google LLC. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
* =============================================================================
16+
*/
17+
18+
import {version} from './index';
19+
20+
describe('version', () => {
21+
it('version matches package.json', () => {
22+
// tslint:disable-next-line:no-require-imports
23+
const expected = require('../package.json').version;
24+
expect(version).toBe(expected);
25+
});
26+
});

knn-classifier/demo/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2018 Google Inc. All Rights Reserved.
3+
* Copyright 2019 Google LLC. All Rights Reserved.
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at

knn-classifier/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tensorflow-models/knn-classifier",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "KNN Classifier for TensorFlow.js",
55
"main": "dist/index.js",
66
"unpkg": "dist/knn-classifier.min.js",
@@ -34,7 +34,7 @@
3434
},
3535
"scripts": {
3636
"build": "rimraf dist && tsc",
37-
"publish-npm": "yarn build && rollup -c && npm publish",
37+
"build-npm": "yarn build && rollup -c",
3838
"publish-local": "yarn build && rollup -c && yalc push",
3939
"lint": "tslint -p . -t verbose",
4040
"test": "ts-node run_tests.ts"

knn-classifier/rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2018 Google Inc. All Rights Reserved.
3+
* Copyright 2019 Google LLC. All Rights Reserved.
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at

0 commit comments

Comments
 (0)