session.annotations.put() returns indexes of added objects (#1493)

* session.annotations.put() returns indexes of added objects

* Updated changelog
main
Boris Sekachev 6 years ago committed by GitHub
parent e6ce7758cd
commit 9740ad78dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-
### Changed
-
- cvat-core: session.annotations.put() now returns identificators of added objects (<https://github.com/opencv/cvat/pull/1493>)
### Deprecated
-

@ -806,6 +806,8 @@
object.removed = false;
});
}, importedArray.map((object) => object.clientID), objectStates[0].frame);
return importedArray.map((value) => value.clientID);
}
select(objectStates, x, y) {

@ -280,6 +280,7 @@
* @method put
* @memberof Session.annotations
* @param {module:API.cvat.classes.ObjectState[]} data
* @returns {number[]} identificators of added objects
* array of objects on the specific frame
* @throws {module:API.cvat.exceptions.PluginError}
* @throws {module:API.cvat.exceptions.DataError}

@ -88,8 +88,10 @@ describe('Feature: put annotations', () => {
zOrder: 0,
});
await task.annotations.put([state]);
const indexes = await task.annotations.put([state]);
annotations = await task.annotations.get(1);
expect(indexes).toBeInstanceOf(Array);
expect(indexes).toHaveLength(1);
expect(annotations).toHaveLength(length + 1);
});
@ -108,7 +110,9 @@ describe('Feature: put annotations', () => {
zOrder: 0,
});
await job.annotations.put([state]);
const indexes = await job.annotations.put([state]);
expect(indexes).toBeInstanceOf(Array);
expect(indexes).toHaveLength(1);
annotations = await job.annotations.get(5);
expect(annotations).toHaveLength(length + 1);
});
@ -128,7 +132,9 @@ describe('Feature: put annotations', () => {
zOrder: 0,
});
await task.annotations.put([state]);
const indexes = await task.annotations.put([state]);
expect(indexes).toBeInstanceOf(Array);
expect(indexes).toHaveLength(1);
annotations = await task.annotations.get(1);
expect(annotations).toHaveLength(length + 1);
});
@ -148,7 +154,9 @@ describe('Feature: put annotations', () => {
zOrder: 0,
});
await job.annotations.put([state]);
const indexes = await job.annotations.put([state]);
expect(indexes).toBeInstanceOf(Array);
expect(indexes).toHaveLength(1);
annotations = await job.annotations.get(5);
expect(annotations).toHaveLength(length + 1);
});

Loading…
Cancel
Save