This repository contains python scripts which performs various CV operation, with and without deep learning.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To run the scripts, you'll need some extra software :
sudo apt-get install build-essential cmake git unzip pkg-config
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libhdf5-serial-dev graphviz
sudo apt-get install libopenblas-dev libatlas-base-dev gfortran
sudo apt-get install python-tk python3-tk python-imaging-tk
And the python headers packages :
sudo apt-get install python2.7-dev python3-dev
It is strongly advised to use python virtual environment :
pip install virtualenv virtualenvwrapper
Then, we need to update the ~/.bashrc file:
echo -e "\n# virtualenv and virtualenvwrapper" >> ~/.bashrc
echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bashrc
echo "export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
And reload it with source ~/.bashrc
(only once for this shell session, for next sessions it will be loaded automaticaly)
After the global virtualenv parameters are correctly configured, you can create the environment (here with python3 bindings) with :
mkvirtualenv cv -p python3
You can name your virtualenv (here cv) as you want. To work on it, simply do workon cv
.
You will need numpy to run OpenCV : pip install numpy
To install OpenCV, simply do pip install opencv-contrib-python
OR
Follow one of this guides to install it with custom parameters : OpenCV Tutorials
pip install scipy matplotlib pillow
pip install imutils h5py requests progressbar2
pip install scikit-learn scikit-image dlib
pip install mahotas
pip install tensorflow
pip install keras
pip install picamera[array]
The pyimagesearch package used in many examples and projects is located at the project root. To be able to use the scripts, don't forget to either :
- copy/paste the folder in your projects.
- add the path to your PYTHONPATH environment variable :
- modify your ~/.bashrc file
- add
export PYTHONPATH="${PYTHONPATH}:path/to/package"
(exemple :export PYTHONPATH="${PYTHONPATH}:${HOME}/CV
- sym-link your repository
Other methods are also acceptable. Remember, the package is mandatory for running scripts.
To test your installation, try to do import keras
, import cv2
and import pyimagesearch
in a Python shell. If you don't have any error, your installation is working properly.
Note : the success of pyimagesearch import depends on the choice your made at previous step.
See the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
Thanks to pyimagesearch for the excellent tutorials and books from where a lot of exemples present in this project are inspired from.