Skip to content

Commit

Permalink
Remove Caffe test files
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Jun 24, 2024
1 parent a978e2b commit 99327f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 52 deletions.
21 changes: 11 additions & 10 deletions source/caffe.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ caffe.Model = class {

constructor(metadata, net) {
this.name = net.name;
let version = -1;
this.format = 'Caffe';
this.graphs = [];
let version = -1;
if (net.layers && net.layers.length > 0) {
if (net.layers.every((layer) => Object.prototype.hasOwnProperty.call(layer, 'layer'))) {
version = 0;
Expand All @@ -176,7 +177,6 @@ caffe.Model = class {
if (phases.size === 0) {
phases.add(-1);
}
this.graphs = [];
for (const phase of phases) {
const graph = new caffe.Graph(metadata, phase, net, version);
this.graphs.push(graph);
Expand Down Expand Up @@ -254,15 +254,16 @@ caffe.Graph = class {
lastLayer.chain = lastLayer.chain || [];
lastLayer.chain.push(layer);
} else {
if (layer.type === 'Input' || layer.type === 'Data') {
if (layer.input.length === 0 && layer.output.length === 1 &&
layer.input_param && layer.input_param.shape &&
layer.input_param.shape.length === 1 && layer.input_param.shape[0].dim) {
const shape = new caffe.TensorShape(layer.input_param.shape[0].dim.map((dim) => dim.toNumber()));
const type = new caffe.TensorType(null, shape);
this.inputs.push(new caffe.Argument(layer.output[0], [value(layer.output[0], type)]));
layer = null;
if (layer.type === 'Input' && layer.input.length === 0) {
for (let i = 0; i < layer.output.length; i++) {
const output = layer.output[i];
const dim = layer.input_param && layer.input_param.shape && i < layer.input_param.shape.length ? layer.input_param.shape[i].dim : null;
const shape = dim ? new caffe.TensorShape(dim.map((dim) => dim.toNumber())) : null;
const type = shape ? new caffe.TensorType(null, shape) : null;
const argument = new caffe.Argument(output, [value(output, type)]);
this.inputs.push(argument);
}
layer = null;
}
if (layer) {
nodes.push(layer);
Expand Down
42 changes: 0 additions & 42 deletions test/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,6 @@
"format": "Caffe v2",
"link": "https://github.com/lutzroeder/netron/issues/276"
},
{
"type": "caffe",
"target": "caffenet.prototxt",
"source": "https://raw.githubusercontent.com/cwlacewe/netscope/master/presets/caffenet.prototxt",
"format": "Caffe v2",
"link": "https://github.com/cwlacewe/netscope"
},
{
"type": "caffe",
"target": "cifar10_full_sigmoid_solver_bn.prototxt,cifar10_full_sigmoid_train_test_bn.prototxt",
Expand All @@ -350,13 +343,6 @@
"format": "Caffe v2",
"link": "https://github.com/lutzroeder/netron/issues/276"
},
{
"type": "caffe",
"target": "conv.prototxt",
"source": "https://raw.githubusercontent.com/BVLC/caffe/master/examples/net_surgery/conv.prototxt",
"format": "Caffe v2",
"link": "https://github.com/BVLC/caffe/tree/master/examples/net_surgery"
},
{
"type": "caffe",
"target": "deepyeast.caffemodel.zip",
Expand Down Expand Up @@ -399,13 +385,6 @@
"format": "Caffe v2",
"link": "https://github.com/cwlacewe/netscope"
},
{
"type": "caffe",
"target": "fasterRCNN_VGG.prototxt",
"source": "https://raw.githubusercontent.com/cwlacewe/netscope/master/presets/fasterRCNN_VGG.prototxt",
"format": "Caffe v2",
"link": "https://github.com/cwlacewe/netscope"
},
{
"type": "caffe",
"target": "fasterRCNN_ZynqNet.prototxt",
Expand Down Expand Up @@ -448,13 +427,6 @@
"format": "Caffe v2",
"link": "https://github.com/cwlacewe/netscope"
},
{
"type": "caffe",
"target": "inceptionv3_orig.prototxt",
"source": "https://raw.githubusercontent.com/cwlacewe/netscope/master/presets/inceptionv3_orig.prototxt",
"format": "Caffe v2",
"link": "https://github.com/cwlacewe/netscope"
},
{
"type": "caffe",
"target": "inceptionv4.prototxt",
Expand All @@ -469,27 +441,13 @@
"format": "Caffe v2",
"link": "https://github.com/cwlacewe/netscope"
},
{
"type": "caffe",
"target": "inceptionv4_resnet.prototxt",
"source": "https://raw.githubusercontent.com/cwlacewe/netscope/master/presets/inceptionv4_resnet.prototxt",
"format": "Caffe v2",
"link": "https://github.com/cwlacewe/netscope"
},
{
"type": "caffe",
"target": "lenet_consolidated_solver.prototxt",
"source": "https://raw.githubusercontent.com/BVLC/caffe/master/examples/mnist/lenet_consolidated_solver.prototxt",
"format": "Caffe v1",
"link": "https://github.com/BVLC/caffe/tree/master/examples/mnist"
},
{
"type": "caffe",
"target": "lenet.prototxt",
"source": "https://raw.githubusercontent.com/BVLC/caffe/master/examples/mnist/lenet.prototxt",
"format": "Caffe v2",
"link": "https://github.com/BVLC/caffe/tree/master/examples/mnist"
},
{
"type": "caffe",
"target": "linreg.prototxt",
Expand Down

0 comments on commit 99327f8

Please sign in to comment.