takuya-takeuchi / DlibDotNet

Dlib .NET wrapper written in C++ and C# for Windows, MacOS, Linux and iOS
MIT License
488 stars 135 forks source link

question: get faces count on image? #246

Open Hakentha opened 3 years ago

Hakentha commented 3 years ago

Hi! Is to fast load image and then get the locations. but if i use count on ienumerable of locations is too slow. Is any way to do faster?

Im using c#.

Thank you!!

takuya-takeuchi commented 3 years ago

if i use count on ienumerable of locations is too slow.

IEnumerable does what like delayed evaluation. When you call FaceLocation method, FRDN does not do FaceLocation. You retrieve face location data at the precise moment FaceLocation will be executed.

Hakentha commented 3 years ago

i use loadimagefile to get imagedata. Then i useFaceLocations( <imagedata from loadimagefile> ) I get an ienumerable which is a enum with the locations of faces from the image. If i use count or lenght i can get the number of faces. But when a use it, the process is very slow. 500 images, i can get imageData and locations in 2 or 3 seconds. but when i use the count is 56 seconds.

Thankyou for ur response.

takuya-takeuchi commented 3 years ago

@Hakentha Sorry. I don't mean what you say. What do you think problems?

Hakentha commented 3 years ago

Thank you for ur response, i apreciate it. I use Paralell. I can get 500 image class with LoadImageFile function, in less than 3 seconds. I can get 500 images Locations with FaceLocations function and cnn, in less than 1 second. But i cant get the number of faces of that 500 images; in less than 1 minute...

Its dificult to explain, but the quick question: ¿its a way to get the number of faces, in a image file quickly?

Thank you so much!!!