1
1
Eric Tröbs 3 жил өмнө
parent
commit
a057e782d7

+ 16 - 3
webui/src/components/media/options-bar.vue

@@ -29,7 +29,8 @@
       <img alt="move and resize bounding box" src="@/assets/icons/four-directions.svg">
     </div>
 
-    <div ref="labels"
+    <div v-if="labelsEnabled"
+         ref="labels"
          class="image"
          title="label bounding box (T)"
          :class="{active: interaction === 'label-box'}"
@@ -96,9 +97,13 @@ export default {
   components: {LabelSelector},
   props: ['file', 'interaction', 'filter', 'label', 'labels'],
   created: function () {
-    // get jobs
+    // get data
     this.getJobs();
 
+    this.$root.socket.get(`/projects/${this.$root.project.identifier}/model`)
+        .then(response => response.json())
+        .then(model => this.model = model);
+
     // subscribe to changes
     this.$root.socket.on('connect', this.getJobs);
     this.$root.socket.on('create-job', this.addJob);
@@ -119,12 +124,20 @@ export default {
   data: function () {
     return {
       jobs: [],
-      labelSelector: false
+      labelSelector: false,
+      model: null
     }
   },
   computed: {
     isPredictionRunning: function () {
       return this.jobs.filter(j => !j.finished && j.type === 'Model Interaction').length > 0;
+    },
+    labelsEnabled: function () {
+      return this.model
+          && (
+              this.model.supports.includes('labeled-images')
+              || this.model.supports.includes('labeled-bounding-boxes')
+          );
     }
   },
   methods: {