Practical Computer Vision
上QQ阅读APP看书,第一时间看更新

Libraries and installation

Before we begin, it is required that we install each library. There are two major methods of installing a library:

  • We download the source code and build binaries by compiling the code
  • We can directly download binaries and put them in relevant directories

While downloading pre-built binaries is a faster method, however, due to the difference of platforms or non-availability of binaries may force to build a library from source. If readers are using different OS then the mentioned in the following sections, they might come across such a situation. Once installed a library, it can be used with programs or other libraries. 

Since it is crucial to have libraries that are not affected by other installations, we will be using Python-based environments in most of the book. This helps in keeping track of libraries installed and also separates different environment if we would like to have multiple. Here environment refers to installed libraries with particular versions and their dependencies.

For building a library from source, we will use CMake tool. The instructions to install are as shown in further sections. This helps in building cross-platform software by linking to relevant compilers on each platform as well as to their dependencies. This comes with GUI too but for convenience, we will be using command-line cmake.

For deep learning, which we will see later in this book, a GPU is highly recommended. To run our programs using GPUs, we need to install both CUDA and cuDNN binaries provided by Nvidia. Further details of installation for each of the platforms, such as Linux, Mac OS, or Windows, are available from Nvidia.

Let's begin by installing the required packages in order.