Skip to content

Commit

Permalink
Caffe2 .pbtxt detection (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Jan 28, 2019
1 parent 796bfec commit f6e469c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/caffe2.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ caffe2.ModelFactory = class {
}
}
}
if (identifier.endsWith('predict_net.pbtxt') || identifier.endsWith('predict_net.prototxt') ||
identifier.endsWith('init_net.pbtxt') || identifier.endsWith('init_net.prototxt')) {
if (extension == 'pbtxt' || extension == 'prototxt') {
if (identifier.endsWith('predict_net.pbtxt') || identifier.endsWith('predict_net.prototxt')) {
return true;
}
tags = context.tags('pbtxt');
if (tags.op) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ view.View = class {
setTimeout(() => {
if (graph && graph != this._activeGraph) {
var nodes = graph.nodes;
if (nodes.length > 1500) {
if (nodes.length > 1400) {
if (!this._host.confirm('Large model detected.', 'This graph contains a large number of nodes and might take a long time to render. Do you want to continue?')) {
this._host.event('Graph', 'Render', 'Skip', nodes.length);
this.show(null);
Expand Down
9 changes: 8 additions & 1 deletion test/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@
"format": "Caffe2",
"link": "https://github.com/jolibrain/deepdetect/tree/master/templates/caffe2"
},

{
"type": "caffe2",
"target": "bvlc_alexnet/predict_net.pb,bvlc_alexnet/init_net.pb",
Expand Down Expand Up @@ -731,6 +730,14 @@
"format": "Caffe2",
"link": "https://github.com/zyddawn/caffe2-models"
},
{
"type": "caffe2",
"target": "generalized_rcnn/net.pbtxt",
"source": "https://github.com/lutzroeder/netron/files/2801714/net.pbtxt.txt",
"format": "Caffe2",
"render": "skip",
"link": "https://github.com/lutzroeder/netron/issues/223"
},
{
"type": "caffe2",
"target": "inception_v1/predict_net.pb,inception_v1/init_net.pb",
Expand Down

0 comments on commit f6e469c

Please sign in to comment.