Skip to content

Commit 3957e2d

Browse files
committed
refactor(visual_recognition): v4 changes
BREAKING CHANGE: For `updateClassifier` and `createClassifier`, the parameter `{classname}_positive_examples` is changed to a map called `positive_examples` with classnames as keys. See the migration guide, UPGRADE-4.0.md, for more information.
1 parent dc5f859 commit 3957e2d

File tree

5 files changed

+175
-401
lines changed

5 files changed

+175
-401
lines changed

UPGRADE-4.0.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,28 @@ The following services have been deprecated for an extended period of time and w
298298

299299

300300
### Visual Recognition Compatibility
301+
#### createClassifier
302+
- Parameter `{classname}_positive_examples` changed to map `positive_examples`
303+
304+
Instead of passing in multiple parameters like `car_positive_examples` and `boat_positive_examples`, the method now takes a single map with the classnames as the keys:
305+
```json
306+
"positive_examples": {
307+
"car": <car examples>,
308+
"boat": <boat examples>
309+
}
310+
```
311+
312+
#### updateClassifier
313+
- Parameter `{classname}_positive_examples` changed to map `positive_examples`
314+
315+
Instead of passing in multiple parameters like `car_positive_examples` and `boat_positive_examples`, the method now takes a single map with the classnames as the keys:
316+
```json
317+
"positive_examples": {
318+
"car": <car examples>,
319+
"boat": <boat examples>
320+
}
321+
```
322+
301323
#### classify
302324
- Parameter name changed: `image_file` -> `images_file`
303325
- Parameter `parameters` is no longer supported

test/integration/visual_recognition.custom_classifiers.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe.skip('visual_recognition_integration_custom_classifiers @slow', functio
2020

2121
const visual_recognition = new VisualRecognitionV3(
2222
Object.assign({}, auth.visual_recognition_rc.v3, {
23-
version: '2018-03-19',
23+
version: '2019-03-27',
2424
})
2525
);
2626

test/integration/visual_recognition.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('visual_recognition_integration', function() {
1313

1414
const visual_recognition = new VisualRecognitionV3(
1515
Object.assign({}, auth.visual_recognition_rc.v3, {
16-
version: '2018-10-01',
16+
version: '2019-03-27',
1717
})
1818
);
1919

0 commit comments

Comments
 (0)