Add CustomOptions for supporting ADAS models (#1227)
author최성진/동작제어Lab(SR)/Principal Engineer/삼성전자 <lotieye.choi@samsung.com>
Wed, 16 May 2018 02:49:55 +0000 (11:49 +0900)
committer김정현/동작제어Lab(SR)/Senior Engineer/삼성전자 <jh0822.kim@samsung.com>
Wed, 16 May 2018 02:49:55 +0000 (11:49 +0900)
This commit introduces CustomOptions to support ADAS model in print_op tool file.

- add custom_options as well as builtin_options_type

Signed-off-by: SungJin Choi <lotieye.choi@samsung.com>
tools/extract_weights_from_tflite/print_op.py

index 69962bf..1db3c22 100755 (executable)
@@ -37,7 +37,13 @@ tensors = j['subgraphs'][0]['tensors']
 operators = j['subgraphs'][0]['operators']
 
 for o in operators:
-    print "Layer: ", o['builtin_options_type']
+    if o.has_key("builtin_options_type"):
+        print "Layer: ", o['builtin_options_type']
+    elif o.has_key("custom_options"):
+        print "Layer: CustomOptions"
+    else:
+        print "Layer: NotSupportedOptions"
+        continue
     print "    Input shapes ---"
     for inp in o['inputs']:
         print "      ", tensors[inp]['shape']