Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
using dlib in FPC/Lazarus for face recognition?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Find child controls by na...
by
Handoko
[
Today
at 04:17:05 am]
Demoscene The Champs Crac...
by
Gigatron
[
Today
at 02:26:07 am]
Linux Workspaces -- StayO...
by
dbannon
[
Today
at 02:13:13 am]
Assign (textfile) not com...
by
teresa
[
Today
at 01:56:13 am]
How to: create DLL file f...
by
KodeZwerg
[
Today
at 12:57:56 am]
Slow copying of small str...
by
jamie
[
Today
at 12:37:04 am]
location of non visual co...
by
VisualLab
[April 17, 2024, 11:58:55 pm]
For-in loop over constant...
by
Joanna
[April 17, 2024, 11:57:15 pm]
Lazarus editor feature re...
by
440bx
[April 17, 2024, 11:49:08 pm]
InstallAware Using Lazaru...
by
VisualLab
[April 17, 2024, 11:08:24 pm]
How would you define a fi...
by
wp
[April 17, 2024, 11:04:00 pm]
Directx9 with mylogo insi...
by
KodeZwerg
[April 17, 2024, 11:03:54 pm]
Lazarus for Windows on aa...
by
Wallaby
[April 17, 2024, 10:25:46 pm]
Azure sql database will n...
by
dseligo
[April 17, 2024, 10:15:27 pm]
[SOLVED] TDbf table, Leve...
by
1HuntnMan
[April 17, 2024, 10:03:16 pm]
Doomed name
by
Martin_fr
[April 17, 2024, 09:09:52 pm]
lazarus-project_3.2.0-0_a...
by
midigark
[April 17, 2024, 06:09:40 pm]
Text orientation in TMemo...
by
wp
[April 17, 2024, 05:51:25 pm]
TBGRABitmap.TextSize retu...
by
circular
[April 17, 2024, 05:24:04 pm]
BUG REPORT: Unable to gen...
by
gasensor
[April 17, 2024, 05:10:20 pm]
[solved]FP IDE(FP.exe) fa...
by
gasensor
[April 17, 2024, 04:45:40 pm]
Inherits forms and releas...
by
ASerge
[April 17, 2024, 03:37:45 pm]
The weird Rewrite bug
by
Kays
[April 17, 2024, 01:23:40 pm]
FpDebug unexpected Assemb...
by
440bx
[April 17, 2024, 12:54:43 pm]
Arabic text, problem on L...
by
Zaher
[April 17, 2024, 12:34:05 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: using dlib in FPC/Lazarus for face recognition? (Read 6051 times)
jus
New Member
Posts: 26
using dlib in FPC/Lazarus for face recognition?
«
on:
June 22, 2021, 06:13:18 pm »
Hi,
i'm very impressed from the facial recognition library in python. It seems that the python facial recognition library is based on
dlib.net
library. Does someone know how to use the dlib library in Lazarus?
«
Last Edit: July 01, 2021, 07:48:00 pm by jus
»
Logged
jamie
Hero Member
Posts: 6130
Re: using dlib in FPC/Lazarus ?
«
Reply #1 on:
June 23, 2021, 01:06:28 am »
If you could provide a sample of some feature utilized from that LIB in other languages I am sure it could be duplicated.
Logged
The only true wisdom is knowing you know nothing
jus
New Member
Posts: 26
Re: using dlib in FPC/Lazarus ?
«
Reply #2 on:
June 23, 2021, 01:26:30 pm »
Hi Jamie,
I mean the following methods from python for
facial recognition library
:
Code: Python
[Select]
[+]
[-]
import
face_recognition
face_recognition.
face_encodings
face_recognition.
compare_faces
face_recognition.
faces_distance
Logged
Leledumbo
Hero Member
Posts: 8757
Programming + Glam Metal + Tae Kwon Do = Me
Re: using dlib in FPC/Lazarus ?
«
Reply #3 on:
June 25, 2021, 01:32:24 am »
Quote from: jus on June 22, 2021, 06:13:18 pm
Does someone know how to use the dlib library in Lazarus?
Usually if the library has a C interface, just port the interface and you're done. But, dlib isn't one of them. It has either C++ or Python only, no flat C interface available.
I think you better off with TensorFlow as it has various Pascal/Delphi wrappers already, but choosing which one is an adventure itself
References:
https://github.com/zsoltszakaly/tensorflowforpascal
https://macpgmr.github.io/MacXPlatform/PascalForTensorFlow.html
https://forum.lazarus.freepascal.org/index.php/topic,39049.0.html
Logged
Follow this if you want me to answer:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F
http://pascalgeek.blogspot.com
https://bitbucket.org/leledumbo
https://github.com/leledumbo
Code first, think later - Natural programmer B)
devEric69
Hero Member
Posts: 648
Re: using dlib in FPC/Lazarus ?
«
Reply #4 on:
June 25, 2021, 10:57:27 am »
AFAIK, the Python example imports a part of the library written in C\C++ and named "Dlib" (
dlib.net
: C++ toolkit for machine learning algorithms
), part concerning the "face detection" problem: Cf.
http://dlib.net/face_detection_ex.cpp.html
.
It should be possible to do the import in Object Pascal of the C header files (Object Pascal can do that) as dlib/image_processing/frontal_face_detector.h, in order to use this library in Lazarus.
«
Last Edit: June 25, 2021, 11:03:55 am by devEric69
»
Logged
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.
jus
New Member
Posts: 26
Re: using dlib in FPC/Lazarus ?
«
Reply #5 on:
June 30, 2021, 01:25:33 am »
First of all thanx for your answers. Because the dlib.net library is written in C I downloaded the Visual Studio Community 2019 and made a DLL, which exports the function as a flat function.
I have attached a sample project with 2 DLLs( for 32bit and 64bit). Furthermore you need to download and decompress the following files in the same directory as the project1.exe:
dlib_face_recognition_resnet_model_v1.dat ...
http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat.bz2
shape_predictor_5_face_landmarks.dat ...
http://dlib.net/files/shape_predictor_5_face_landmarks.dat.bz2
dlibwrapper32bit.dll ...
https://github.com/lcynet/facerecognition/raw/master/Lazarus/dlibwrapper32bit.dll
dlibwrapper64bit.dll ...
https://github.com/lcynet/facerecognition/raw/master/Lazarus/dlibwrapper64bit.dll
bald_guys.jpg ...
https://github.com/lcynet/facerecognition/raw/master/Lazarus/bald_guys.jpg
I have posted a Delphi version in the german
Delphipraxis.net
forum too.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
using dlib in FPC/Lazarus for face recognition?
TinyPortal
© 2005-2018