|
| 1 | +#Installation Tutorial |
| 2 | + |
| 3 | +First, if you don't have i already you will need to install a version of Python. |
| 4 | + |
| 5 | +##Python Installation: |
| 6 | + |
| 7 | +###Linux |
| 8 | + |
| 9 | +It is very likely that you already have Python installed out of the box. To check if you have it installed (and which version it is), open a console and type the following command: |
| 10 | + |
| 11 | +command-line |
| 12 | +```$ python3 --version |
| 13 | +``` Output >> Python 3.5.1 |
| 14 | +
|
| 15 | +If you have a different 'micro version' of Python installed, e.g. 3.5.0, then you don't have to upgrade. If you don't have Python installed, or if you want a different version, you can install it as follows: |
| 16 | +
|
| 17 | +####Debian or Ubuntu |
| 18 | +command-line |
| 19 | +```$ sudo apt-get install python3.5``` |
| 20 | +
|
| 21 | +####Fedora (up to 21) |
| 22 | +command-line |
| 23 | +```$ sudo yum install python3``` |
| 24 | +
|
| 25 | +####Fedora (22+) |
| 26 | +command-line |
| 27 | +```$ sudo dnf install python3``` |
| 28 | +
|
| 29 | +openSUSE |
| 30 | +command-line |
| 31 | +```$ sudo zypper install python3``` |
| 32 | +
|
| 33 | +
|
| 34 | +### macOS ( OS X ) |
| 35 | +The macOS comes with python 2.7, but it is a good idea to install Python3. |
| 36 | +
|
| 37 | +Before you install Python on OS X, you should ensure your Mac settings allow installing packages that aren't from the App Store. Go to System Preferences (it's in the Applications folder), click "Security & Privacy," and then the "General" tab. If your "Allow apps downloaded from:" is set to "Mac App Store," change it to "Mac App Store and identified developers." |
| 38 | +
|
| 39 | +You need to go to the website https://www.python.org/downloads/release/python-351/ and download the Python installer: |
| 40 | +
|
| 41 | +Download the Mac OS X 64-bit/32-bit installer file, |
| 42 | +Double click python-3.5.1-macosx10.6.pkg to run the installer. |
| 43 | +Verify the installation was successful by opening the Terminal application and running the python3 command: |
| 44 | +
|
| 45 | +command-line |
| 46 | +```$ python3 --version``` |
| 47 | +Output>> Python 3.5.1 |
| 48 | +
|
| 49 | +###Windows |
| 50 | +
|
| 51 | +You can download Python for Windows from the website https://www.python.org/downloads/release/python-351/. After downloading the *.msi file, you should run it (double-click on it) and follow the instructions there. It is important to remember the path (the directory) where you installed Python. It will be needed later! |
| 52 | +
|
| 53 | +One thing to watch out for: on the second screen of the installation wizard, marked "Customize", make sure you scroll down to the "Add python.exe to the Path" option and select "Will be installed on local hard drive". |
| 54 | +
|
| 55 | +Don't forget to add Python to the Path |
| 56 | +
|
| 57 | +In upcoming steps, you'll be using the Windows Command Line. For now, if you need to type in some commands, go to Start menu → All Programs → Accessories → Command Prompt. (On newer versions of Windows, you might have to search for "Command Prompt" since it's sometimes hidden.) |
| 58 | +
|
| 59 | +
|
| 60 | +##Virtual environment (Optional, but recomended) |
| 61 | +
|
| 62 | +Before we install the necessary packages, we will get you to install an extremely useful tool to help keep your coding environment tidy on your computer. It's possible to skip this step, but it's highly recommended. Starting with the best possible setup will save you a lot of trouble in the future! |
| 63 | +
|
| 64 | +So, let's create a virtual environment (also called a virtualenv). Virtualenv will isolate your Python setup on a per-project basis. This means that any changes you make to one project won't affect any others you're also developing. This is similar to the Workspaces for Java developers. |
| 65 | +
|
| 66 | +All you need to do is find a directory in which you want to create the virtualenv; it is recomended that you create it inside your projects folder as it will be part of your project. |
| 67 | +
|
| 68 | +###On Unix ( Linux and macOS): |
| 69 | +
|
| 70 | +``` |
| 71 | +pip3 install virtualenv |
| 72 | +mkdir folder_name && cd folder_name |
| 73 | +python3 -m venv virtualenv_name(of your choice) |
| 74 | +``` |
| 75 | +
|
| 76 | +NOTE 1: if you only have one version of Python installed, you might not need to add the "3" in the command, thus you can use "pip instal.." instead. |
| 77 | +
|
| 78 | +NOTE 2: If you have a new installation of python, you probably already have PIP installed as well (a Python package installer) |
| 79 | +But In case PIP ins't already installed, refer to this link to install it : https://pip.pypa.io/en/latest/installing/ |
| 80 | +
|
| 81 | +
|
| 82 | +Starting the Virtualenv: |
| 83 | +
|
| 84 | +
|
| 85 | +``` |
| 86 | +$ source virtualenv_name/bin/activate |
| 87 | +``` |
| 88 | +
|
| 89 | +NOTE: sometimes source might not be available. In those cases try doing this instead: |
| 90 | +
|
| 91 | +``` |
| 92 | +$ . virtualenv_name/bin/activate |
| 93 | +``` |
| 94 | +
|
| 95 | +
|
| 96 | +
|
| 97 | +###On Windows: |
| 98 | +First, install venv: |
| 99 | +``` |
| 100 | +C:\%userprofile%\Python35-32\Scripts\pip.exe install virtualenv |
| 101 | +``` |
| 102 | +
|
| 103 | +Now, assuming you are going to create a folder inside C:\%userprofile%\projects\VirtualEnv\recogVirtual, |
| 104 | +
|
| 105 | +Creating VEnv |
| 106 | +``` |
| 107 | +C:\%userprofile%\Python35-32\Scripts\virtualenv.exe C:\%userprofile%\projects\VirtualEnv\recogVirtual |
| 108 | +``` |
| 109 | +
|
| 110 | +Activation: |
| 111 | +``` |
| 112 | +C:\%userprofile%\projetcs\VirtualEnv\recogVirtual\Scripts\activate |
| 113 | +``` |
| 114 | +
|
| 115 | +
|
| 116 | +####This is the recomended place for cloning this repository. |
| 117 | +####```git clone https://github.com/peixebabel/simple-recognition.git``` |
| 118 | +
|
| 119 | +## Installing Scikit-learn, the Python Machine learning Framework |
| 120 | +
|
| 121 | +This Library requires NumPy and SciPy. To install them, run: |
| 122 | +
|
| 123 | +``` pip3 install NumPy SciPy |
| 124 | +pip3 install -U scikit-learn ``` |
| 125 | +
|
| 126 | +
|
| 127 | +##Caffe Framework |
| 128 | +
|
| 129 | +As this part is very different for each system, you can follow a step-by-step guide here (macOS check below first): [caffe.berkeleyvision.org/installation](http://caffe.berkeleyvision.org/installation.html#prerequisites) |
| 130 | +
|
| 131 | +### macOS -> Homebrew |
| 132 | +
|
| 133 | +For the installation on the macOS, you are going to need the Homebrew Package Manager, and for that you will need the Command line tools. If you already have Xcode installed, you can just run the command ```xcode-select --install``` |
| 134 | +
|
| 135 | +Or you can download it from [developer.apple](http://developer.apple.com/) |
| 136 | +
|
| 137 | +
|
| 138 | +To install the Homebrew itself, run the following command: |
| 139 | +
|
| 140 | +``` ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` |
| 141 | +
|
| 142 | +Now you should be able to follow Caffe's tutorial. |
0 commit comments