Bläddra i källkod

Add Hailo test file (#1313)

Lutz Roeder 1 år sedan
förälder
incheckning
b335048c01
3 ändrade filer med 18 tillägg och 3 borttagningar
  1. 4 0
      source/hailo-metadata.json
  2. 7 3
      source/hailo.js
  3. 7 0
      test/models.json

+ 4 - 0
source/hailo-metadata.json

@@ -1038,6 +1038,10 @@
     "name": "silu",
     "category": "Activation"
   },
+  {
+    "name": "leaky",
+    "category": "Activation"
+  },
   {
     "name": "layer_normalization",
     "category": "Normalization"

+ 7 - 3
source/hailo.js

@@ -68,6 +68,7 @@ hailo.Graph = class {
             value.name = name;
             return value;
         });
+        const inputs = new Set();
         for (const layer of layers) {
             switch (layer.type) {
                 case 'input_layer': {
@@ -75,9 +76,12 @@ hailo.Graph = class {
                         const shape = Array.isArray(layer.output_shapes) && layer.output_shapes.length > 0 ? layer.output_shapes[0] : null;
                         const type = shape ? new hailo.TensorType('?', new hailo.TensorShape(shape)) : null;
                         const output = layer.output[i];
-                        const name = `${layer.name}\n${output}`;
-                        const argument = new hailo.Argument('input', [values.map(name, type)]);
-                        this.inputs.push(argument);
+                        if (!inputs.has(output)) {
+                            const name = `${layer.name}\n${output}`;
+                            const argument = new hailo.Argument('input', [values.map(name, type)]);
+                            this.inputs.push(argument);
+                            inputs.add(output);
+                        }
                     }
                     break;
                 }

+ 7 - 0
test/models.json

@@ -2122,6 +2122,13 @@
     "format":   "Hailo Archive v3.23.0",
     "link":     "https://github.com/lutzroeder/netron/issues/1058"
   },
+  {
+    "type":     "hailo",
+    "target":   "VD_M_sRGB_4k_Apr03.har",
+    "source":   "https://github.com/user-attachments/files/16163445/VD_M_sRGB_4k_Apr03.har.zip[VD_M_sRGB_4k_Apr03.har]",
+    "format":   "Hailo Archive v3.26.0",
+    "link":     "https://github.com/lutzroeder/netron/issues/1058"
+  },
   {
     "type":     "hickle",
     "target":   "googlenet.h5",