Sfoglia il codice sorgente

Add Darknet test file (#277)

Lutz Roeder 5 anni fa
parent
commit
9d08b2f758
2 ha cambiato i file con 10 aggiunte e 3 eliminazioni
  1. 3 3
      source/darknet.js
  2. 7 0
      test/models.json

+ 3 - 3
source/darknet.js

@@ -365,8 +365,8 @@ darknet.Graph = class {
                         layer.out_w = params.w;
                         layer.out_c = params.c;
                         layer.out = layer.in;
-                        load_batch_normalize_weights(weights, section, '', layer.out);
-                        layer.outputs[0].type = new darknet.TensorType('float32', make_shape([ layer.ouputs ], 'batchnorm'));
+                        load_batch_normalize_weights(layer, '', layer.out_c);
+                        layer.outputs[0].type = new darknet.TensorType('float32', make_shape([ layer.out_w, layer.out_h, layer.out_c ], 'batchnorm'));
                         break;
                     }
                     case 'activation': {
@@ -374,7 +374,7 @@ darknet.Graph = class {
                         layer.out_w = params.w;
                         layer.out_c = params.c;
                         layer.out = layer.in;
-                        layer.outputs[0].type = new darknet.TensorType('float32', make_shape([ layer.ouputs ], 'activation'));
+                        layer.outputs[0].type = new darknet.TensorType('float32', make_shape([ layer.out_w, layer.out_h, layer.out_c ], 'activation'));
                         break;
                     }
                     case 'max':

+ 7 - 0
test/models.json

@@ -1854,6 +1854,13 @@
     "error":  "Unexpected '[convolutional]' section. First section must be [net] or [network] in 'vgg_bn_ssd300.cfg'.",
     "link":   "https://github.com/lutzroeder/netron/issues/277"
   },
+  {
+    "type":   "darknet",
+    "target": "xyolo.test.cfg",
+    "source": "https://github.com/lutzroeder/netron/files/6026689/xyolo.test.cfg.zip[xyolo.test.cfg]",
+    "format": "Darknet",
+    "link":   "https://github.com/lutzroeder/netron/issues/277"
+  },
   {
     "type":   "darknet",
     "target": "yolo-coco.cfg",