Lutz Roeder 4 лет назад
Родитель
Сommit
8a3fe58494
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      source/tflite.js

+ 5 - 5
source/tflite.js

@@ -17,7 +17,7 @@ tflite.ModelFactory = class {
             let model = null;
             let model = null;
             const attachments = new Map();
             const attachments = new Map();
             switch (this._format(context)) {
             switch (this._format(context)) {
-                case 'json': {
+                case 'tflite.flatbuffers.json': {
                     try {
                     try {
                         const obj = context.open('json');
                         const obj = context.open('json');
                         const reader = new flatbuffers.TextReader(obj);
                         const reader = new flatbuffers.TextReader(obj);
@@ -29,7 +29,7 @@ tflite.ModelFactory = class {
                     }
                     }
                     break;
                     break;
                 }
                 }
-                case 'flatbuffers': {
+                case 'tflite.flatbuffers': {
                     const stream = context.stream;
                     const stream = context.stream;
                     try {
                     try {
                         const reader = flatbuffers.BinaryReader.open(stream);
                         const reader = flatbuffers.BinaryReader.open(stream);
@@ -62,7 +62,7 @@ tflite.ModelFactory = class {
     _format(context) {
     _format(context) {
         const tags = context.tags('flatbuffers');
         const tags = context.tags('flatbuffers');
         if (tags.get('file_identifier') === 'TFL3') {
         if (tags.get('file_identifier') === 'TFL3') {
-            return 'flatbuffers';
+            return 'tflite.flatbuffers';
         }
         }
         const identifier = context.identifier;
         const identifier = context.identifier;
         const extension = identifier.split('.').pop().toLowerCase();
         const extension = identifier.split('.').pop().toLowerCase();
@@ -73,13 +73,13 @@ tflite.ModelFactory = class {
             if (reader.root === 0x00000018) {
             if (reader.root === 0x00000018) {
                 const version = reader.uint32_(reader.root, 4, 0);
                 const version = reader.uint32_(reader.root, 4, 0);
                 if (version === 3) {
                 if (version === 3) {
-                    return 'flatbuffers';
+                    return 'tflite.flatbuffers';
                 }
                 }
             }
             }
         }
         }
         const obj = context.open('json');
         const obj = context.open('json');
         if (obj && obj.subgraphs && obj.operator_codes) {
         if (obj && obj.subgraphs && obj.operator_codes) {
-            return 'json';
+            return 'tflite.flatbuffers.json';
         }
         }
         return '';
         return '';
     }
     }