This is the Jupyter notebook version of the following book:
Michael Beyeler
Machine Learning for OpenCV: A practical introduction to the world of machine learning and image processing using OpenCV and Python
14 July 2017
Packt Publishing Ltd., London, England
Paperback: 382 pages
ISBN 978-178398028-4
The content is available on GitHub. The code is released under the MIT license.
There are at least two ways you can run the code:
- Using Binder (no installation required).
- Using Jupyter Notebook on your local machine.
The code in this book was tested with Python 3.5, although older versions of Python should work as well (such as Python 2.7).
Binder allows you to run Jupyter notebooks in an interactive Docker container. No installation required!
Launch the project: mbeyeler/opencv-machine-learning
You basically want to follow the installation instructions in Chapter 1 of the book.
In short:
-
Download and install Python Anaconda.
-
Add Conda-Forge to your trusted channels (to simplify installation of OpenCV on Windows platforms):
$ conda config --add channels conda-forge
-
Create a conda environment for Python 3 with all required packages:
$ conda create -n Python3 python=3.5 --file requirements.txt
-
Activate the conda environment. On Linux / Mac OS X:
$ source activate Python3
On Windows:
$ activate Python3
You can learn more about conda environments in the Managing Environments section of the conda documentation.
-
Fork and clone the GitHub repo:
-
Click the
Fork
button in the top-right corner of this page. -
Clone the repo, where
YourUsername
is your actual GitHub user name:$ git clone https://github.com/YourUsername/opencv-machine-learning
-
-
Launch Jupyter notebook:
$ jupyter notebook
This will open up a browser window in your current directory. Navigate to the folder
opencv-machine-learning
. The README file has a table of contents. Else navigate to thenotebooks
folder, click on the notebook of your choice, and selectKernel > Restart & Run All
from the top menu.
This book was inspired in many ways by the following authors and their corresponding publications:
- Jake VanderPlas, Python Data Science Handbook: Essential Tools for Working with Data. O'Reilly, ISBN 978-149191205-8, 2016, https://github.com/jakevdp/PythonDataScienceHandbook
- Andreas Muller and Sarah Guido, Introduction to Machine Learning with Python: A Guide for Data Scientists. O'Reilly, ISBN 978-144936941-5, 2016, https://github.com/amueller/introduction_to_ml_with_python
- Sebastian Raschka, Python Machine Learning. Packt, ISBN 978-178355513-0, 2015, https://github.com/rasbt/python-machine-learning-book
These books all come with their own open-source code - check them out when you get a chance!