|
@@ -7,6 +7,7 @@
|
|
|
|
|
|
<annotation-box v-if="current"
|
|
|
:image="image"
|
|
|
+ :supports="model.supports"
|
|
|
:position="current"/>
|
|
|
|
|
|
<annotation-box v-for="(result, index) in predictions"
|
|
@@ -18,6 +19,7 @@
|
|
|
:socket="socket"
|
|
|
:box-url="mediaUrl + '/' + result.id"
|
|
|
:labels="project.labels"
|
|
|
+ :supports="model.supports"
|
|
|
@move="move"
|
|
|
@resize="resize"/>
|
|
|
</div>
|
|
@@ -29,7 +31,7 @@ import AnnotationBox from "@/components/media/annotation-box";
|
|
|
export default {
|
|
|
name: "annotated-image",
|
|
|
components: {AnnotationBox},
|
|
|
- props: ['project', 'data', 'socket'],
|
|
|
+ props: ['data', 'project', 'model', 'socket'],
|
|
|
mounted: function () {
|
|
|
window.addEventListener("resize", this.resizeEvent);
|
|
|
|
|
@@ -78,15 +80,18 @@ export default {
|
|
|
.filter(k => 'x' in k);
|
|
|
},
|
|
|
events: function () {
|
|
|
- return {
|
|
|
- 'touchstart': this.press,
|
|
|
- 'touchmove': this.track,
|
|
|
- 'touchend': this.release,
|
|
|
- 'mousedown': this.press,
|
|
|
- 'mousemove': this.track,
|
|
|
- 'mouseup': this.release,
|
|
|
- 'dragstart': e => e.stopPropagation()
|
|
|
- }
|
|
|
+ if (this.model.supports.includes('bounding-boxes') || this.model.supports.includes('labeled-bounding-boxes'))
|
|
|
+ return {
|
|
|
+ 'touchstart': this.press,
|
|
|
+ 'touchmove': this.track,
|
|
|
+ 'touchend': this.release,
|
|
|
+ 'mousedown': this.press,
|
|
|
+ 'mousemove': this.track,
|
|
|
+ 'mouseup': this.release,
|
|
|
+ 'dragstart': e => e.stopPropagation()
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return {}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|