How to use the roots function from protobufjs
Find comprehensive JavaScript protobufjs.roots code examples handpicked from public code repositorys.
GitHub: bahree/netron
![bahree profile picture](/bahree.png?size=40)
38 39 40 41 42 43 44 45 46 47
let meta_graph = null; const identifier = context.identifier; const extension = identifier.split('.').pop().toLowerCase(); if (extension === 'pbtxt' || identifier.toLowerCase().endsWith('.uff.txt')) { try { uff.proto = protobuf.roots.uff.uff; const reader = prototxt.TextReader.create(context.text); const field = reader.field; reader.field = (token, module) => { if (token === 'descriptors' || token === 'graphs' || token == 'referenced_data') {
+ 3 other calls in file
GitHub: sundawei/netron
![sundawei profile picture](/sundawei.png?size=40)
21 22 23 24 25 26 27 28 29 30
return; } var desc = null; var identifier = context.identifier; try { paddle.proto = protobuf.roots.paddle.paddle.framework.proto; desc = paddle.proto.ProgramDesc.decode(context.buffer); } catch (error) { callback(new paddle.Error("File format is not paddle.ProgramDesc (" + error.message + ") in '" + identifier + "'."), null);
GitHub: maniacs-oss/netron
![maniacs-oss profile picture](/maniacs-oss.png?size=40)
64 65 66 67 68 69 70 71 72 73
host.require('./tf-proto', (err) => { if (err) { callback(err, null); return; } tf.proto = protobuf.roots.tf.tensorflow; var graph = null; var metaGraph = null; var savedModel = null; var format = null;
GitHub: simonleungbit/netron
![simonleungbit profile picture](/simonleungbit.png?size=40)
33 34 35 36 37 38 39 40 41 42
host.require('./caffe-proto', (err) => { if (err) { callback(err, null); return; } caffe.proto = protobuf.roots.caffe.caffe; caffe.Metadata.open(host, (err, metadata) => { var extension = context.identifier.split('.').pop(); if (extension == 'pbtxt' || extension == 'prototxt') { var tags = context.tags('pbtxt');
GitHub: divideconcept/netron
![divideconcept profile picture](/divideconcept.png?size=40)
66 67 68 69 70 71 72 73 74 75
if (extension == 'pbtxt' || extension == 'prototxt') { const open_text = (predict, init) => { let predict_net = null; let init_net = null; try { caffe2.proto = protobuf.roots.caffe2.caffe2; const reader = prototxt.TextReader.create(predict); reader.field = function(tag, message) { if (message instanceof caffe2.proto.DeviceOption) { message[tag] = this.skip();
+ 7 other calls in file
GitHub: Beesitech/netron
![Beesitech profile picture](/Beesitech.png?size=40)
42 43 44 45 46 47 48 49 50 51
var model = null; var identifier = context.identifier; var extension = identifier.split('.').pop().toLowerCase(); if (extension == 'pbtxt' || extension == 'prototxt') { try { onnx.proto = protobuf.roots.onnx.onnx; model = onnx.proto.ModelProto.decodeText(context.text); } catch (error) { host.exception(error, false);
+ 3 other calls in file
GitHub: ibelem/netron
![ibelem profile picture](/ibelem.png?size=40)
16 17 18 19 20 21 22 23 24 25
open(context, host) { return host.require('./coreml-proto').then(() => { var identifier = context.identifier; var decodedBuffer = null; try { coreml.proto = protobuf.roots.coreml.CoreML.Specification; decodedBuffer = coreml.proto.Model.decode(context.buffer); } catch (error) { throw new coreml.Error("File format is not coreml.Model (" + error.message + ") in '" + identifier + "'.");
GitHub: jiapei100/netron
![jiapei100 profile picture](/jiapei100.png?size=40)
23 24 25 26 27 28 29 30 31 32
return host.require('./bigdl-proto').then(() => { return bigdl.Metadata.open(host).then((metadata) => { const identifier = context.identifier; try { // https://github.com/intel-analytics/BigDL/blob/master/spark/dl/src/main/resources/serialization/bigdl.proto bigdl.proto = protobuf.roots.bigdl.com.intel.analytics.bigdl.serialization; let module = bigdl.proto.BigDLModule.decode(context.buffer); return new bigdl.Model(metadata, module); } catch (error) {
protobufjs.load is the most popular function in protobufjs (282 examples)