luoyetx / deep-landmark

Predict facial landmarks with Deep CNNs powered by Caffe.
BSD 3-Clause "New" or "Revised" License
282 stars 156 forks source link

about test time #1

Open yyytq opened 8 years ago

yyytq commented 8 years ago

thank you very much for your code sharing. Is it possible to tell me the test time of the three levels? or can you give a proportion of the time cost of different level? thx again!!!

luoyetx commented 8 years ago

you can test the model via python2.7 test/test.py 1 for level-1 and 2,3 for level-2 & level-3, it will give you error and speed test over test dataset. And don't forget to set the model path correctly in common/cnns.py

yyytq commented 8 years ago

yeah. i test it. but i don't know if there is something wrong, the whole time for the network is about 1+ s per image, which i think is too long. i wonder if you ever saved the result of the test time for each level?

luoyetx commented 8 years ago

I test the model on a 2.2 GHz CPU, it doesn't perform that bad, Actually I got the result below.

level1: 218fps
level2: 80fps
level3; 50fps
yyytq commented 8 years ago

thank you very much for your sharing! !! i will check my work again~~(>_<)~~

sshhuu110 commented 8 years ago

@luoyetx First of all thanks for sharing the code.

Can this code run in Linux OS Ubuntu?

When I was running this code, I got below error

Traceback (most recent call last): File "dataset/level1.py", line 16, in from common import shuffle_in_unison_scary, logger, createDir, processImage ImportError: No module named common

Please suggest how to run this code in Ubuntu? Thanks in advance !!!

luoyetx commented 8 years ago

@sshhuu110 I'm using CentOS but I don't think the OS is the problem. I think you run your script like python2.7 level1.py, but you should run the script under the root directory of the project like python2.7 dataset/level1.py. You can refer to this scipt bootstrap.sh.

sshhuu110 commented 8 years ago

@luoyetx Thanks, The code is running. But how does it take to run on a CPU. What is the training time?

luoyetx commented 8 years ago

all prototxt files are generate by python code generate.py. The default device is GPU.

About the training time. It really depends on the GPU. And you should tuning the CNNs carefully which can cost much time.

sshhuu110 commented 8 years ago

I changed it to CPU, I started running on Friday and it is still running. Any suggestions, is it normal training time?

luoyetx commented 8 years ago

I don't recommend you to use CPU which will be very slow. What's more, you should change the max_iter in solver.prototxt.template under prototxt. The default max_iter is very large and you may run many days under CPU :joy:

yyytq commented 8 years ago

@luoyetx @sshhuu110 sorry to interrupt you . I also have the same problem when run in Linux T^T i just use the script as bootstrap.sh. do your guys have any suggestions?

sshhuu110 commented 8 years ago

@yyytq Now, I could able to run it on Linux OS and with only CPU.

What is the exact error are u facing?

yyytq commented 8 years ago

@sshhuu110 just the first error you meet.

File "dataset/level1.py", line 16, in from common import shuffle_in_unison_scary, logger, createDir, processImage ImportError: No module named common

i have changed the script, but the error remain T^T

luoyetx commented 8 years ago

@yyytq you may consider to modify PYTHONPATH environment. I don't know why you encounter this problem but I have no error on CentOS.

sshhuu110 commented 8 years ago

@yyytq I did some thing like this export PYTHONPATH=$HOME/dirWithScripts/:$PYTHONPATH export PYTHONPATH=$HOME/common/:$PYTHONPATH

sshhuu110 commented 8 years ago

@yytq Since these functions are in utils.py and utils.py is in common folder. I think we should also add common folder path to PYTHONPATH. This will solve your problem :)

sshhuu110 commented 8 years ago

@yyytq

I think this must be dataset related problem, either you don't have data sets or train and test data set may not be set to correct paths. Check once again

On Tue, Jan 26, 2016 at 8:45 PM, yyytq notifications@github.com wrote:

@sshhuu110 https://github.com/sshhuu110 Thank you very much...but other problem occurs......😂😂

File "dataset/level1.py", line168, in generate('dataset/train/trainImageList.txt', 'train',argument=True) File"dataset/level1.py",line38,in generate Image=cv2.imread(imagepath, cv2.CV_LOAD_IMAGE_GRAYSCALE) AttributeError : 'module ' object has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'

I tried to change cv2.CV_LOAD_IMAGE_GRAYSCALE to '0' or cv2.IMREAD_GRAYSCALE but didn't work😭

— Reply to this email directly or view it on GitHub https://github.com/luoyetx/deep-landmark/issues/1#issuecomment-174996283 .

yyytq commented 8 years ago

@sshhuu110 i'm sure the path is right.....

As i also encounter the error that can't found caffe .. i add the caffe path before 'import caffe' so that it can run did you also encounter this problem? if not…… I'll thinking if it is the problem of my software environment.....

sshhuu110 commented 8 years ago

@yytq I have faced the "can't found caffe" problem also.

For that in level.py file in train folder you have to change cmd path to your caffe path like below

cmds = []
for t in models[level-1]:
    cmd = 'mkdir model/{0}_{1}'.format(level, t)
    os.system(cmd)
    cmd = '/home/username/Desktop/caffe-master/build/tools/caffe train --solver prototxt/{0}_{1}_solver.prototxt'.format(level, t)
    # w(os.system(cmd))
    cmds.append('/home/username/Desktop/caffe-master/build/tools/caffe train --solver prototxt/{0}_{1}_solver.prototxt'.format(level, t))
yyytq commented 8 years ago

@sshhuu110 yeah . i have solved this by myself.... but still troubled by the 'CV_LOAD_IMAGEGRAYSCALE' T^T can you tell me that if you do some other changes except those mentioned below? so that i can make my mental preparations beforehand ~~o(><)o ~~ or……if it is possible to send me the files that can run in Ubuntu directly?

sshhuu110 commented 8 years ago

@yytq I had not got this "CV_LOAD_IMAGE_GRAYSCALE" problem

I did only the changes I have mentioned

attached level1 level2 level3 level.py files FYR

On Wed, Jan 27, 2016 at 3:56 PM, yyytq notifications@github.com wrote:

@sshhuu110 https://github.com/sshhuu110 yeah . i have solved this by myself.... but still troubled by the 'CV_LOAD_IMAGEGRAYSCALE' T^T can you tell me that if you do some other changes except those mentioned below? so that i can make my mental preparations beforehand ~~o(><)o ~~ or……if it is possible to send me the files that can run in Ubuntu directly?

— Reply to this email directly or view it on GitHub https://github.com/luoyetx/deep-landmark/issues/1#issuecomment-175470371 .

yyytq commented 8 years ago

@sshhuu110 okay!thank you a lot !!

pidanxhq commented 8 years ago

@sshhuu110 hi ,I have faced the "can't found caffe" problem, and i changed code as below cmd = '/home/data/caffe-master/tools/caffe train --solver prototxt/{0}_{1}_solver.prototxt'.format(level, t)

w(os.system(cmd))

    cmds.append('/home/data/caffe-master/tools/caffe train --solver prototxt/{0}_{1}_solver.prototxt'.format(level, t))

it showed "sh: 1:"/home/data/caffe-master/tools/caffe: not found",do you know how to solve this problem

huinsysu commented 6 years ago

@yyytq hi,have you solved the problem "'module' object has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'"?I meet it too.Thanks a lot!

huinsysu commented 6 years ago

@yyytq Hi,I have solved it! Just replace "CV_LOAD_IMAGE_GRAYSCALE" in the code with "IMREAD_GRAYSCALE".