menpo / conda-dlib

Conda recipe for the dlib pacakge
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

Anaconda dlib package not linking png support #2

Closed Amal-Vincent closed 9 years ago

Amal-Vincent commented 9 years ago

The error is:

Unable to load image in file lfpw/trainset/image_0457.png.
You must #define DLIB_PNG_SUPPORT and link to libpng to read PNG files.
Do this by following the instructions at http://dlib.net/compile.html.

When I try to execute the function shown in the image I get the above error, I thought libpng came inbuilt with anaconda?

screenshot from 2015-08-11 17 50 35

patricksnape commented 9 years ago

Hey Amal - bear with me, I'm just remedying this. Anaconda does comes with libpng but it has to be wired up properly in the build script. It's a bit annoying due to how DLL binding happens on Windows so I had taken it out. I don't use the XML reader so I didn't realise this was happening!

Amal-Vincent commented 9 years ago

Thanks @patricksnape opencv and dlib, on anaconda are a real life saver for me, is it possible to configure dlib with AVX_instructions, I am making a face landmark detection program and speed of execution is imperative. screenshot from 2015-08-11 17 51 29

Amal-Vincent commented 9 years ago

Hope that you come up with the fix for the libpng soon enough, also will similar problems occur with libjpeg, my training set happens to contain jpeg files as well

patricksnape commented 9 years ago

Hi Amal, try updating your conda package - it should work now. In terms of AVX, I'm afraid the automated builds do not support AVX. You will have to build it yourself, I will update the README to try and help you build it yourself. Let me know if the new png/jpeg support works!

Amal-Vincent commented 9 years ago

screenshot from 2015-08-13 13 36 04 Thanks a lot @patricksnape the png support seems to work.

However unfortunately for me there are too many images for training and I seem to run out of RAM and the system crashes. Seems like I will have to find some other way to train. Could you let me know on how to make the build myself, maybe the AVX support will speed it up and I will not have to train the new file for the facial feature estimation. Will simply editing the the .sh file in the recipe folder of the archive do the job

patricksnape commented 9 years ago

HI @Amal-Vincent, I've updated the README to attempt to help you with this. Given your screenshot, I can see that the way you have edited the build.sh is correct. So just follow the instructions to build it.

AVX will not help your RAM requirements in any way. If you cannot use a local machine with more RAM, or buy more RAM for your machine, may I suggest you try a high-memory instance on EC2?

I'm closing this issue now as it seems resolved (by #3)

Amal-Vincent commented 9 years ago

Thanks a lot @patricksnape I compiled it yesterday with AVX on, had to recompile opencv as well, anyway there is a slight increase in frame rate, I am no computer expert so I have no idea why. And as far as buying more RAM is concerned I cannot afford it. What is EC2 by the way, I am a newbie in the field. And regards once again to you and your team(if you do not work alone), you have no idea how these packages make life easy for me.

patricksnape commented 9 years ago

Amazon EC2 - cheap cloud computing. Why are you retraining a model - why not just use the model that Davis provides?

Amal-Vincent commented 9 years ago

@patricksnape I just require the eye region and nose for my application so, I intend to achieve better processing speed and frame rate(at least I hope to), currently I am getting something below 15 fps even with AVX. Thanks once again sir.

Amal-Vincent commented 9 years ago

Hey @patricksnape I finally sped it up, all I needed to do was replace frontal face detector of dlib with simple HAAR, and that did the job. I feel like crying out Eureka!!! Thanks for all your help