-
Notifications
You must be signed in to change notification settings - Fork 0
/
Packages-to-install
70 lines (32 loc) · 3.11 KB
/
Packages-to-install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
[NOTE: The lines you find "$" gives the commands that are to be typed in the terminal}
This is an in-depth procedure to follow to get your Raspberry Pi to install Open-CV that will work with Computer Vision for Object Identification. Turn on a Raspberry Pi 4 Model B running a fresh version of Raspberry Pi 'Buster' OS and connect it to the Internet. Buster OS is very much required.
Open up the Terminal by pressing the Terminal Button found on the top left of the button. Copy and paste each command into your Pi’s terminal, press Enter, and allow it to finish before moving onto the next command. If ever prompted, “Do you want to continue? (y/n)” press Y and then the Enter key to continue the process.
$sudo apt-get update && sudo apt-get upgrade
We must now expand the swapfile before running the next set of commands. To do this type into terminal this line.
$sudo nano /etc/dphys-swapfile
The change the number on CONF_SWAPSIZE = 100 to CONF_SWAPSIZE=2048. Having done this press Ctrl-X, Y, and then Enter Key to save these changes. This change is only temporary and you should change it back after completing this. To have these changes affect anything we must restart the swapfile by entering the following command to the terminal. Then we will resume Terminal Commands as normal.
$sudo apt-get install build-essential cmake 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 libgtk2.0-dev libgtk-3-dev
$sudo apt-get install libatlas-base-dev gfortran
$sudo pip3 install numpy
$wget -O opencv.zip https://github.com/opencv/opencv/archive/4.4.0.zip
$wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.4.0.zip
$unzip opencv.zip
$unzip opencv_contrib.zip
$cd ~/opencv-4.4.0/
$mkdir build
$cd build
$cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-4.4.0/modules \
-D BUILD_EXAMPLES=ON ..
$make -j $(nproc)
This | make | Command will take over an hour to install and there will be no indication of how much longer it will take. It may also freeze the monitor display. Be ultra patient and it will work. Once complete you are most of the way done. If it fails at any point and you receive a message like | make: *** [Makefile:163: all] Error 2 | just re-type and enter the above line | make -j $(nproc) |. Do not fear it will remember all the work it has already done and continue from where it left off. Once complete we will resume terminal commands.
$sudo make install && sudo ldconfig
$sudo reboot
At this point the majority of the installation process is complete and you can now change back the Swapfile so that the CONF_SWAPSIZE = 100.
I have used the famous coco dataset for the object detection, you can use the data set u want for a much more precise detection.