И результативность такой работы...Olej писал(а): - приложение, которое ведёт распознавание...
P.S. И опять же... всё это распознавание делается на ARM одноплатнике Dragon Board 410c, миниатюрном устройстве...
Модератор: Olej
И результативность такой работы...Olej писал(а): - приложение, которое ведёт распознавание...
Интересная особенность ... наблюдение:Olej писал(а): После Dlib мы уже можем выделять местоположение лиц на фото алгоритмом HOG, Интерес представляют здесь именно групповые фото. Сами тестовые групповые фото я надёргал наугад из Интернет...Код: Выделить всё
[olej@dell step-1_find-faces]$ ./find-faces.py gr-img3.jpg I found 5 faces in the file gr-img3.jpg - Face #0 found at Left: 462 Top: 92 Right: 569 Bottom: 199 - Face #1 found at Left: 390 Top: 307 Right: 497 Bottom: 414 - Face #2 found at Left: 270 Top: 283 Right: 378 Bottom: 390 - Face #3 found at Left: 155 Top: 116 Right: 245 Bottom: 206 - Face #4 found at Left: 342 Top: 68 Right: 450 Bottom: 175 Hit enter to continue
Код: Выделить всё
olej@ACER:~/2019_WORK/own.WORK/AplitSoft/FaceDL/Nfaces$ python3 step-1_find-faces.py 1234.jpg
Traceback (most recent call last):
File "step-1_find-faces.py", line 3, in <module>
from skimage import io
File "/usr/local/lib/python3.7/dist-packages/skimage/__init__.py", line 167, in <module>
from .util.dtype import (img_as_float32,
File "/usr/local/lib/python3.7/dist-packages/skimage/util/__init__.py", line 8, in <module>
from .arraycrop import crop
File "/usr/local/lib/python3.7/dist-packages/skimage/util/arraycrop.py", line 8, in <module>
from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths' from 'numpy.lib.arraypad' (/usr/local/lib/python3.7/dist-packages/numpy/lib/arraypad.py)
Как показало достаточно долгое разбирательство:Olej писал(а):Это показывает как быстро развивается всё в области распознавания и это характерно для такой динамики развития ... к этому нужно быть готовым.
Код: Выделить всё
olej@ACER:~/2019_WORK/own.WORK/MachineLearning$ python3
Python 3.7.2+ (default, Feb 2 2019, 14:31:48)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from skimage import io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/skimage/__init__.py", line 167, in <module>
from .util.dtype import (img_as_float32,
File "/usr/local/lib/python3.7/dist-packages/skimage/util/__init__.py", line 8, in <module>
from .arraycrop import crop
File "/usr/local/lib/python3.7/dist-packages/skimage/util/arraycrop.py", line 8, in <module>
from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths' from 'numpy.lib.arraypad' (/usr/local/lib/python3.7/dist-packages/numpy/lib/arraypad.py)
>>>
Код: Выделить всё
olej@ACER:~/2019_WORK/own.WORK/AplitSoft/FaceDL/step-1_find-faces$ sudo python3 -m pip install -U scikit-image
Collecting scikit-image
Downloading https://files.pythonhosted.org/packages/b7/66/a7f7649e5abf9cf1a908134fe6b52f8c5bb4e4059e47dd497bd173a951c6/scikit_image-0.14.2-cp37-cp37m-manylinux1_x86_64.whl (25.3MB)
100% |████████████████████████████████| 25.3MB 1.6MB/s
Requirement already satisfied, skipping upgrade: six>=1.10.0 in /usr/lib/python3/dist-packages (from scikit-image) (1.12.0)
Requirement already satisfied, skipping upgrade: matplotlib>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image) (3.0.2)
Requirement already satisfied, skipping upgrade: scipy>=0.17.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image) (1.2.0)
Requirement already satisfied, skipping upgrade: PyWavelets>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image) (1.0.1)
Requirement already satisfied, skipping upgrade: pillow>=4.3.0 in /usr/local/lib/python3.7/dist-packages/Pillow-5.4.0-py3.7-linux-x86_64.egg (from scikit-image) (5.4.0)
Requirement already satisfied, skipping upgrade: dask[array]>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image) (1.0.0)
Requirement already satisfied, skipping upgrade: cloudpickle>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from scikit-image) (0.6.1)
Requirement already satisfied, skipping upgrade: networkx>=1.8 in /usr/local/lib/python3.7/dist-packages (from scikit-image) (2.2)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->scikit-image) (1.0.1)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->scikit-image) (2.7.5)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->scikit-image) (2.3.0)
Requirement already satisfied, skipping upgrade: numpy>=1.10.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->scikit-image) (1.16.1)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->scikit-image) (0.10.0)
Requirement already satisfied, skipping upgrade: toolz>=0.7.3; extra == "array" in /usr/local/lib/python3.7/dist-packages (from dask[array]>=1.0.0->scikit-image) (0.9.0)
Requirement already satisfied, skipping upgrade: decorator>=4.3.0 in /usr/local/lib/python3.7/dist-packages (from networkx>=1.8->scikit-image) (4.3.0)
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python3/dist-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->scikit-image) (40.7.1)
Installing collected packages: scikit-image
Found existing installation: scikit-image 0.14.1
Uninstalling scikit-image-0.14.1:
Successfully uninstalled scikit-image-0.14.1
Successfully installed scikit-image-0.14.2
Код: Выделить всё
olej@ACER:~/2019_WORK/own.WORK/MachineLearning$ python3
Python 3.7.2+ (default, Feb 2 2019, 14:31:48)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from skimage import io
>>>
Код: Выделить всё
olej@ACER:~/2019_WORK/own.WORK/AplitSoft/FaceDL/Nfaces$ ./find-faces.py 1234.jpg
I found 4 faces in the file 1234.jpg
- Face #0 found at Left: 305 Top: 198 Right: 341 Bottom: 234
- Face #1 found at Left: 141 Top: 94 Right: 184 Bottom: 137
- Face #2 found at Left: 417 Top: 62 Right: 453 Bottom: 98
- Face #3 found at Left: 501 Top: 130 Right: 537 Bottom: 166
Hit enter to continue
Код: Выделить всё
olej@ACER:~/2019_WORK/own.WORK/AplitSoft/FaceDL.2/Nfaces$ python find-faces.py t13/24.jpg
I found 2 faces in the file t13/24.jpg
- Face #0 found at Left: 61 Top: 94 Right: 97 Bottom: 130
- Face #1 found at Left: 257 Top: 26 Right: 293 Bottom: 62
Hit enter to continue
... или любом другом ARM: Rapsberry Pi, Orange Pi, etc.Olej писал(а): Но это вовсе не получается на одноплатном ARM DragonBoard 410c
Следующее описание (из этой же работы) - описание собственно программ распознавания лиц.Olej писал(а): О том, какие проблемы + как они решаются - я написал объёмное описание-памятку, 21 страница текста о тех сложностях, которые предстоит преодолеть и как.
И 3-е описание - Tcl/Tk совместно с Python3 (Tkinter) для придания распознавалкам GUI интерфейсов - там есть свои проблемы и заморочки.Olej писал(а):Следующее описание (из этой же работы) - описание собственно программ распознавания лиц.Olej писал(а): О том, какие проблемы + как они решаются - я написал объёмное описание-памятку, 21 страница текста о тех сложностях, которые предстоит преодолеть и как.
Код: Выделить всё
новых версиях
Код: Выделить всё
olej@R420:~/2023/Python/Find-Faces$ ./find-faces.py img3.6-5.png
Traceback (most recent call last):
File "/home/olej/2023/Python/Find-Faces/./find-faces.py", line 5, in <module>
import dlib
ModuleNotFoundError: No module named 'dlib'
Использую такую установку (это не быстро!):Код: Выделить всё
... dlib-19.24.tar.bz2 2022-05-08 07:41 12M dlib-19.24.zip 2022-05-08 07:41 16M ...
Код: Выделить всё
olej@R420:~/2023/rus.linux.net.hist/timeweb$ sudo pip install dlib
[sudo] пароль для olej:
Collecting dlib
Using cached dlib-19.24.0.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... done
Created wheel for dlib: filename=dlib-19.24.0-cp310-cp310-linux_x86_64.whl size=4437625 sha256=5268a7299ed248a3b4eb68ef6347a9f5d997c132888e905173cf1f1ac17bedfa
Stored in directory: /root/.cache/pip/wheels/7c/23/35/5b2874ddb5db1cfdfa37b4b30a7273ad3fa0c3d488e5b6cfc8
Successfully built dlib
Installing collected packages: dlib
Successfully installed dlib-19.24.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Код: Выделить всё
olej@R420:~/2023/rus.linux.net.hist/timeweb$ python
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
>>> dlib.__version__
'19.24.0'
>>> exit()
Код: Выделить всё
olej@R420:~/2023/Python/Find-Faces$ ./find-faces.py img3.6-5.png
Traceback (most recent call last):
File "/home/olej/2023/Python/Find-Faces/./find-faces.py", line 6, in <module>
from skimage import io
ModuleNotFoundError: No module named 'skimage'
olej@R420:~/2023/Python/Find-Faces$ sudo pip install skimage
Collecting skimage
Downloading skimage-0.0.tar.gz (757 bytes)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
*** Please install the `scikit-image` package (instead of `skimage`) ***
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Код: Выделить всё
olej@R420:~/2023/Python/Find-Faces$ sudo pip install scikit-image
Collecting scikit-image
Downloading scikit_image-0.19.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 1.6 MB/s eta 0:00:00
Collecting tifffile>=2019.7.26
Downloading tifffile-2022.10.10-py3-none-any.whl (210 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 210.3/210.3 KB 1.6 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17.0 in /usr/lib/python3/dist-packages (from scikit-image) (1.21.5)
Collecting networkx>=2.2
Downloading networkx-3.0-py3-none-any.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 1.7 MB/s eta 0:00:00
Collecting PyWavelets>=1.1.1
Downloading PyWavelets-1.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 1.8 MB/s eta 0:00:00
Requirement already satisfied: scipy>=1.4.1 in /usr/lib/python3/dist-packages (from scikit-image) (1.8.0)
Collecting imageio>=2.4.1
Downloading imageio-2.24.0-py3-none-any.whl (3.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 1.6 MB/s eta 0:00:00
Requirement already satisfied: packaging>=20.0 in /usr/lib/python3/dist-packages (from scikit-image) (21.3)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /usr/lib/python3/dist-packages (from scikit-image) (9.0.1)
Installing collected packages: tifffile, PyWavelets, networkx, imageio, scikit-image
Successfully installed PyWavelets-1.4.1 imageio-2.24.0 networkx-3.0 scikit-image-0.19.3 tifffile-2022.10.10
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Код: Выделить всё
olej@R420:~/2023/Python/Find-Faces$ ./find-faces.py gr-img3.jpg
I found 5 faces in the file gr-img3.jpg
- Face #0 found at Left: 462 Top: 92 Right: 569 Bottom: 199
- Face #1 found at Left: 390 Top: 307 Right: 497 Bottom: 414
- Face #2 found at Left: 270 Top: 283 Right: 378 Bottom: 390
- Face #3 found at Left: 155 Top: 116 Right: 245 Bottom: 206
- Face #4 found at Left: 342 Top: 68 Right: 450 Bottom: 175
Hit enter to continue
Проверяю что там поменялось ... за 4-5 лет:Olej писал(а): ↑22 дек 2018, 12:49Файл shape_predictor_68_face_landmarks.dat берём здесь: http://dlib.net/files/shape_predictor_6 ... ks.dat.bz2
Код: Выделить всё
olej@R420:~/2023/Python/step-2_projecting-faces$ ls -l shape_predictor*.bz2
-rw-rw-r-- 1 olej olej 5706710 янв 18 14:46 shape_predictor_5_face_landmarks.dat.bz2
-rw-rw-r-- 1 olej olej 64040097 янв 18 14:54 shape_predictor_68_face_landmarks.dat.bz2
Код: Выделить всё
olej@R420:~/2023/Python/step-2_projecting-faces$ which bzip2
/usr/bin/bzip2
[code]
olej@R420:~/2023/Python/step-2_projecting-faces$ ls -l shape_predictor*.bz2
-rw-rw-r-- 1 olej olej 5706710 янв 18 14:46 shape_predictor_5_face_landmarks.dat.bz2
-rw-rw-r-- 1 olej olej 64040097 янв 18 14:54 shape_predictor_68_face_landmarks.dat.bz2
Код: Выделить всё
olej@R420:~/2023/Python/step-2_projecting-faces$ bzip2 -d shape_predictor_68_face_landmarks.dat.bz2
olej@R420:~/2023/Python/step-2_projecting-faces$ bzip2 -d shape_predictor_5_face_landmarks.dat.bz2
Код: Выделить всё
olej@R420:~/2023/Python/step-2_projecting-faces$ ls -l shape_predictor*.dat
-rw-rw-r-- 1 olej olej 9150489 янв 18 14:46 shape_predictor_5_face_landmarks.dat
-rw-rw-r-- 1 olej olej 99693937 янв 18 14:54 shape_predictor_68_face_landmarks.dat
Код: Выделить всё
olej@R420:~/2023/Python/step-2_projecting-faces$ ./finding-face-landmarks.py male/akatsi/akatsi.1.jpg
Found 1 faces in the image file male/akatsi/akatsi.1.jpg
- Face #0 found at Left: 32 Top: 68 Right: 139 Bottom: 175
Hit enter to continue
Код: Выделить всё
olej@R420:~/2023/Python/step-2_projecting-faces$ ./finding-face-landmarks.py female/klclar/klclar.1.jpg
Found 1 faces in the image file female/klclar/klclar.1.jpg
- Face #0 found at Left: 10 Top: 67 Right: 139 Bottom: 196
Hit enter to continue
Сейчас этот форум просматривают: нет зарегистрированных пользователей и 1 гость