- Load TFLite by using native TF operators
- create .pb file
-
First, using google flatbuffer -- flatc,flatc can convert the tflite file to json format
-
flatbuffer:https://github.com/google/flatbuffers
-
Install it:
- download the git
- cmake -G "Unix Makefiles" //create the MakeFile
- make //create the flatc
- make install //install flatc
-
Convert to json:
- copy the structure file 'schema.fbs' from tensorflow to the root of flatbuffer
- #./flatc -t schema.fbs -- xxxxx.tflite
- and you get the json
- using func tflite2json() change json to dictionary format json
-
check your path (test_json) in Code4TFv15/TFLite2TFv15.py
-
run Change2NewJson.py and get the new json
-
run TFLite2TFv15.py and get a .pb file
-
then your can test the speed using .pb/.tflite/OpenCV.DNN
- I just test the Project Mediapipe tflite,for your own using, check the ops definition in Operators.py