Skip to content

Commit

Permalink
refactor(visual_recognition): v4 changes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dpopp07 committed Mar 28, 2019
1 parent dc5f859 commit 3957e2d
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 401 deletions.
22 changes: 22 additions & 0 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,28 @@ The following services have been deprecated for an extended period of time and w


### Visual Recognition Compatibility
#### createClassifier
- Parameter `{classname}_positive_examples` changed to map `positive_examples`

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:
```json
"positive_examples": {
"car": <car examples>,
"boat": <boat examples>
}
```

#### updateClassifier
- Parameter `{classname}_positive_examples` changed to map `positive_examples`

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:
```json
"positive_examples": {
"car": <car examples>,
"boat": <boat examples>
}
```

#### classify
- Parameter name changed: `image_file` -> `images_file`
- Parameter `parameters` is no longer supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe.skip('visual_recognition_integration_custom_classifiers @slow', functio

const visual_recognition = new VisualRecognitionV3(
Object.assign({}, auth.visual_recognition_rc.v3, {
version: '2018-03-19',
version: '2019-03-27',
})
);

Expand Down
2 changes: 1 addition & 1 deletion test/integration/visual_recognition.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('visual_recognition_integration', function() {

const visual_recognition = new VisualRecognitionV3(
Object.assign({}, auth.visual_recognition_rc.v3, {
version: '2018-10-01',
version: '2019-03-27',
})
);

Expand Down
Loading

0 comments on commit 3957e2d

Please sign in to comment.