|
@@ -170,6 +170,17 @@ export default {
|
|
|
this.selectedBoundingBox = this.predictions.length;
|
|
|
|
|
|
this.selectedBoundingBox -= 1;
|
|
|
+ } else if (event.key === 'v') {
|
|
|
+ navigator.clipboard.readText().then(text => {
|
|
|
+ const obj = JSON.parse(text);
|
|
|
+ if (obj.type === 'bounding-box' || obj.type === 'labeled-bounding-box') {
|
|
|
+ if (this.data.type === 'video')
|
|
|
+ obj.frame = this.video.frame;
|
|
|
+
|
|
|
+ this.socket.post(this.mediaUrl, obj).then(this.update);
|
|
|
+ console.log('paste', obj);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
update: function () {
|
|
@@ -267,17 +278,18 @@ export default {
|
|
|
},
|
|
|
release: function () {
|
|
|
if (this.start && !this.extremeClicking) {
|
|
|
- if (this.callback)
|
|
|
+ if (this.callback) {
|
|
|
this.callback(this.current);
|
|
|
- else
|
|
|
- this.socket.post(this.mediaUrl, this.current);
|
|
|
+ this.update();
|
|
|
+ } else {
|
|
|
+ this.socket.post(this.mediaUrl, this.current)
|
|
|
+ .then(this.update);
|
|
|
+ }
|
|
|
|
|
|
this.start = false;
|
|
|
this.fixed = false;
|
|
|
this.current = false;
|
|
|
this.callback = false;
|
|
|
-
|
|
|
- this.update();
|
|
|
}
|
|
|
},
|
|
|
move: function (event, position, callback) {
|