DlibDotNet icon indicating copy to clipboard operation
DlibDotNet copied to clipboard

question: get faces count on image?

Open Hakentha opened this issue 4 years ago • 4 comments

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!!

Hakentha avatar Feb 26 '21 19:02 Hakentha

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.

takuya-takeuchi avatar Feb 27 '21 06:02 takuya-takeuchi

i use loadimagefile to get imagedata. Then i use FaceLocations( <imagedata from loadimagefile> ) I get an ienumerable<Location> 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.

Hakentha avatar Feb 27 '21 23:02 Hakentha

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

  • FaceLocations method takes too long time for per image
    • FaceLocation (Hog) does not use GPU so you may improve performance by using Cnn and GPU.
    • Or make small image before do FaceLocation
  • IEnumerables<Location> .Count takes too long time
    • Delayed evaluation and it is specification of CLI.

takuya-takeuchi avatar Feb 28 '21 04:02 takuya-takeuchi

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!!!

Hakentha avatar Mar 01 '21 01:03 Hakentha