Dimitri Korsch 3 anni fa
parent
commit
397df2b741

+ 25 - 14
webui/src/components/media/annotation-box.vue

@@ -69,20 +69,6 @@ export default {
 
       return 'unknown';
     },
-    style: function () {
-      let color = this.color();
-
-      return {
-        backgroundColor: `rgba(${color}, ${this.shine ? 0.6 : 0.3})`,
-        borderColor: `rgba(${color}, ${this.shine ? 0.8 : 0.4})`,
-        top: this.position.y * 100 + '%',
-        left: this.position.x * 100 + '%',
-        width: this.position.w * 100 + '%',
-        height: this.position.h * 100 + '%'
-      }
-    },
-  },
-  methods: {
 
     color: function() {
       let box = this.box;
@@ -107,8 +93,33 @@ export default {
 
         case 'pipeline':
           return this.colors.pipeline;
+
+        default:
+          return this.colors.default;
+      }
+
+    },
+
+    alpha: function () {
+      return this.shine ? 0.6 : 0.3;
+    },
+
+    style: function () {
+      let color = this.color;
+      let alpha = this.alpha;
+
+      return {
+        backgroundColor: `rgba(${color}, ${alpha})`,
+        borderColor: `rgba(${color}, ${Math.min(1, alpha * 1.5)})`,
+        top: this.position.y * 100 + '%',
+        left: this.position.x * 100 + '%',
+        width: this.position.w * 100 + '%',
+        height: this.position.h * 100 + '%'
       }
     },
+  },
+  methods: {
+
 
     doubleLeftClick(event) {
       console.debug("double left click", event);

+ 1 - 1
webui/src/components/media/annotation-overlay.vue

@@ -179,7 +179,7 @@ export default {
       }
       if (this.interaction === 'confirm-box') {
         if (this.imageLabelResult)
-          this.$emit("confirmImage", this.imageLabelResult.identifier);
+          this.$emit("confirm", this.imageLabelResult.identifier);
 
       }
       if (this.interaction === 'remove-box') {