version: python 3.7.7 OS: macOS Catalina 10.15.3 tensorflow: 2.2.0-rc1
Use python3 series.
For the python version, use pyenv etc. and install the latest version. (See other articles for pyenv.)
Install and upgrade pip.
sudo easy_install pip
sudo easy_install --upgrade six
sudo pip install --upgrade pip
Install the required libraries.
pip install Cython
pip install contextlib2
pip install pillow
pip install lxml
pip install jupyter
pip install matplotlib
Install TensorFlow.
pip install tensorflow
//version confirmation
python -c 'import tensorflow as tf; print(tf.__version__)'
2.2.0-rc1
Install protobuf.
brew install protobuf
Clone the model of TensorFlow. (Create a tensorflow directory.)
cd tensorflow
git clone https://github.com/tensorflow/models.git
Perform on Jupyter notebook.
cd ~/tensorflow/models/research/object_detection/
Jupyter notebook
The directory will be displayed on your browser. Click ʻobject_detection_tutorial.ipynb` to open the notebook.
Select Run All
from the notebook Cell.
Elements such as people are detected.
PATH_TO_TEST_IMAGES_DIR = pathlib.Path('models/research/object_detection/test_images')
The image to be analyzed is saved in the above directory. Please change the file and analyze your favorite image.
Recommended Posts