|
@@ -9,7 +9,7 @@
|
|
:label="label"
|
|
:label="label"
|
|
@label="label = $event"
|
|
@label="label = $event"
|
|
:labels="labels"
|
|
:labels="labels"
|
|
- @infoBox="toggleInfoBox()"
|
|
|
|
|
|
+ @infoBox="toggleInfoBox"
|
|
:zoomBox="zoomBox"
|
|
:zoomBox="zoomBox"
|
|
@unzoom="zoomBox=false; interaction=false"
|
|
@unzoom="zoomBox=false; interaction=false"
|
|
@prevzoom="$refs.overlay.prevZoom()"
|
|
@prevzoom="$refs.overlay.prevZoom()"
|
|
@@ -57,8 +57,7 @@
|
|
:width="300"
|
|
:width="300"
|
|
:margin="10"
|
|
:margin="10"
|
|
:labels="labels"
|
|
:labels="labels"
|
|
- @closed="infoBoxClosed"
|
|
|
|
- />
|
|
|
|
|
|
+ @closed="infoBoxClosed"/>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -93,13 +92,13 @@ export default {
|
|
|
|
|
|
// get model
|
|
// get model
|
|
this.$root.socket.get(`/projects/${this.$root.project.identifier}/model`)
|
|
this.$root.socket.get(`/projects/${this.$root.project.identifier}/model`)
|
|
- .then(response => response.json())
|
|
|
|
- .then(model => {
|
|
|
|
- this.supported.labeledImages = model.supports.includes('labeled-images');
|
|
|
|
- this.supported.labeledBoundingBoxes = model.supports.includes('labeled-bounding-boxes');
|
|
|
|
- this.supported.boundingBoxes = this.supported.labeledBoundingBoxes
|
|
|
|
- || model.supports.includes('bounding-boxes');
|
|
|
|
- });
|
|
|
|
|
|
+ .then(response => response.json())
|
|
|
|
+ .then(model => {
|
|
|
|
+ this.supported.labeledImages = model.supports.includes('labeled-images');
|
|
|
|
+ this.supported.labeledBoundingBoxes = model.supports.includes('labeled-bounding-boxes');
|
|
|
|
+ this.supported.boundingBoxes = this.supported.labeledBoundingBoxes
|
|
|
|
+ || model.supports.includes('bounding-boxes');
|
|
|
|
+ });
|
|
},
|
|
},
|
|
destroyed: function () {
|
|
destroyed: function () {
|
|
window.removeEventListener('resize', this.resize);
|
|
window.removeEventListener('resize', this.resize);
|
|
@@ -184,8 +183,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
- toggleInfoBox: function() {
|
|
|
|
|
|
+ toggleInfoBox: function () {
|
|
let infoBox = this.$refs.info;
|
|
let infoBox = this.$refs.info;
|
|
infoBox.toggle();
|
|
infoBox.toggle();
|
|
if (infoBox.visible)
|
|
if (infoBox.visible)
|
|
@@ -195,16 +193,13 @@ export default {
|
|
this.$refs.overlay.deselectAllBoxes()
|
|
this.$refs.overlay.deselectAllBoxes()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
- selectCrop: function(event) {
|
|
|
|
- this.$refs.info.show(event);
|
|
|
|
|
|
+ selectCrop: function (event) {
|
|
|
|
+ this.$refs.info.show(event);
|
|
},
|
|
},
|
|
-
|
|
|
|
- infoBoxClosed: function() {
|
|
|
|
|
|
+ infoBoxClosed: function () {
|
|
this.interaction = false;
|
|
this.interaction = false;
|
|
this.$refs.overlay.deselectAllBoxes()
|
|
this.$refs.overlay.deselectAllBoxes()
|
|
},
|
|
},
|
|
-
|
|
|
|
resize: function () {
|
|
resize: function () {
|
|
const rect = this.$refs.root.getBoundingClientRect();
|
|
const rect = this.$refs.root.getBoundingClientRect();
|
|
|
|
|
|
@@ -281,11 +276,11 @@ export default {
|
|
},
|
|
},
|
|
getLabels: function () {
|
|
getLabels: function () {
|
|
this.$root.socket.get(`/projects/${this.$root.project.identifier}/labels`)
|
|
this.$root.socket.get(`/projects/${this.$root.project.identifier}/labels`)
|
|
- .then(response => response.json())
|
|
|
|
- .then(labels => {
|
|
|
|
- this.labels = [];
|
|
|
|
- labels.forEach(this.addLabelToList);
|
|
|
|
- });
|
|
|
|
|
|
+ .then(response => response.json())
|
|
|
|
+ .then(labels => {
|
|
|
|
+ this.labels = [];
|
|
|
|
+ labels.forEach(this.addLabelToList);
|
|
|
|
+ });
|
|
},
|
|
},
|
|
addLabelToList: function (label) {
|
|
addLabelToList: function (label) {
|
|
if (label['project_id'] !== this.$root.project.identifier)
|
|
if (label['project_id'] !== this.$root.project.identifier)
|
|
@@ -324,10 +319,10 @@ export default {
|
|
this.zoomBox = false;
|
|
this.zoomBox = false;
|
|
|
|
|
|
this.$root.socket.get(`/data/${newVal.identifier}/results`)
|
|
this.$root.socket.get(`/data/${newVal.identifier}/results`)
|
|
- .then(response => response.json())
|
|
|
|
- .then(results => {
|
|
|
|
- this.results = results;
|
|
|
|
- })
|
|
|
|
|
|
+ .then(response => response.json())
|
|
|
|
+ .then(results => {
|
|
|
|
+ this.results = results;
|
|
|
|
+ })
|
|
let infoBox = this.$refs.info;
|
|
let infoBox = this.$refs.info;
|
|
if (infoBox == undefined)
|
|
if (infoBox == undefined)
|
|
return;
|
|
return;
|