So now that you have the app running, let's look at the TensorFlow Lite specific code.
Feb 15, 2017. $ sudo pip3 install numpy $ sudo apt-get install python3-matplotlib. And it is done! We have everything in place to start our AI journey to the Edge! Image Classification Inference. Create a fresh Jupyter Notebook and follow bellow steps, or download the complete notebook from GitHub. Import Libraries. If pip is already installed on your Mac, you will see a lot of options as shown below. Then type pip3 install tensorflow as shown below. This will take some time after which Tensorflow will get installed on your Mac as shown below. To confirm that Tensorflow has been installed on your Mac, open IDLE and type import tensorflow as tf as shown below.
Setup
The first block of interest is the initializer for the
ModelDataHandler :
There are a few lines that should be discussed in more detail.
The following line creates the TFLite interpreter:
![]() Tensorflow Install On Mac
The interpreter is responsible for passing raw data inputs through the TensorFlow graph. We pass the interpreter the path to our model on disk, and the interpreter then loads it as a FlatBufferModel.
The last line loads the label list:
Tensorflow Download Ans Setup Macro
All this does is load strings from a text file into memory.
Tensorflow Download Ans Setup Machine LearningTensorflow Download Ans Setup Mac Os
The second block of interest is the
runModel method. It takes a CVPixelBuffer as input, runs the interpreter and returns the text to print in the app.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |