User Manual Orange Pi Zero 3

  Features   |  Use   |    Linux     |  Linux SDK   |  Android   |  Android SRC   |

RU          EN  

Chapt 3. Instructions for use of Debian/Ubuntu Server and Xfce desktop system
Страница:   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    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122  


3.27.2. Manually install face_recognition

  • 1) First create a new ~/.pip directory, then add the pip.conf configuration file, and set the mirror source of pip to Tsinghua source in it, the commands to be executed are as follows
    orangepi@orangepi:~$ mkdir -p ~/.pip
    orangepi@orangepi:~$ cat <<EOF > ~/.pip/pip.conf
    [global]

    timeout = 6000 index-url = https://pypi.tuna.tsinghua.edu.cn/simple trusted-host = pypi.tuna.tsinghua.edu.cn EOF

  • 2) Then install dependencies

    orangepi@orangepi:~$ sudo apt update
    orangepi@orangepi:~$ sudo apt install -y python3-pip libopencv-dev \
    python3-opencv imagemagick python3-scipy python3-setuptools python3-wheel \
    python3-dev cmake python3-testresources

  • 3) Then update pip3

    orangepi@orangepi:~$ python3 -m pip install -U pip setuptools wheel

  • 4) Before installing face_recognition, you first need to install the dlib library. Since the compilation and installation of the dlib library on the development board is relatively slow, I saved a compiled dlib whl file on gitee, and you can install it directly after downloading.

    The download address of the dlib whl file is as follows https://gitee.com/leeboby/python_whl

    a. First download the python_whl warehouse to the Linux system of the development board

    orangepi@orangepi:~$ git clone --depth=1 https://gitee.com/leeboby/python_whl

    b. In the python_whl folder, you can see that there are multiple versions of dlib installation packages. The Linux systems corresponding to different versions of dlib are as follows

    Ubuntu20.04 dlib-19.24.0-cp38-cp38-linux_aarch64.whl
    Ubuntu22.04 dlib-19.24.0-cp310-cp310-linux_aarch64.whl
    Debian11 dlib-19.24.0-cp39-cp39-linux_aarch64.whl

    c. Then you can start installing dlib, the command is as follows a) Ubuntu20.04

    orangepi@orangepi:~$ cd python_whl
    orangepi@orangepi:~/python_whl$ python3 -m pip install dlib-19.24.0-cp38-cp38-linux_aarch64.whl

    b) Ubuntu22.04

    orangepi@orangepi:~$ cd python_whl
    orangepi@orangepi:~/python_whl$ python3 -m pip install dlib-19.24.0-cp310-cp310-linux_aarch64.whl

    c) Debian11

    orangepi@orangepi:~$ cd python_whl
    orangepi@orangepi:~/python_whl$ python3 -m pip install dlib-19.24.0-cp39-cp39-linux_aarch64.whl
    

    d. After installation, if the version number of dlib can be printed normally by using the following command, it means that dlib is installed correctly

    orangepi@orangepi:~/python_whl$ python3 -c "import dlib; print(dlib.__version__)" \ 19.24.0

  • 5) Then install face_recognition_models-0.3.0-py2.py3-none-any.whl

    orangepi@orangepi:~/python_whl$ python3 -m pip install face_recognition_models-0.3.0-py2.py3-none-any.whl

  • 6) Then install face_recognition

    orangepi@orangepi:~$ python3 -m pip install face_recognition

  • 7) Then you need to reopen a terminal to find and run the two commands face_detection and face_recognition

    a. The face_recognition command is used to recognize whose face is in a single image or a folder of images.

    b. The face_detection command is used to locate the face in a single picture or a picture folder

    orangepi@orangepi:~$ which face_detection
    /usr/local/bin/face_detection
    orangepi@orangepi:~$ which face_recognition
    /usr/local/bin/face_recognition

    If you can't find the above two commands after reopening the terminal, please try to manually import environment variables, and then test again

    orangepi@orangepi:~$ export PATH=/home/orangepi/.local/bin:$PATH

     <         > 


  • Страница:   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    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122