patrikhuber / superviseddescent

C++11 implementation of the supervised descent optimisation method
http://patrikhuber.github.io/superviseddescent/
Apache License 2.0
402 stars 188 forks source link

Run rcr-train on my own data #47

Closed Adra8373 closed 5 years ago

Adra8373 commented 7 years ago

Hi

I have a question in regards to rcr-train, can I run this code for my own data I mean for different images and feature points?

Also, how do you calculate the mean? Is it the mean for the feature points of the images of the training set?

Regards

patrikhuber commented 7 years ago

Yes, surely you can run it on your own images. I ran it on various images from ibug (LFPW, HELEN, etc.). You can run it on any feature points, you may need to adapt the rcr-train app slightly if not using ibug points.

Is it the mean for the feature points of the images of the training set?

Yes, that will do fine. It doesn't matter too much.

Adra8373 commented 7 years ago

Hi

Thanks for replying, I need to know how do you store the mean (the form of the mean file), please?

patrikhuber commented 7 years ago

I think it's a text file with all x and then all y coords or [x, y, x, y, ...]. Isn't it in the repo? I think you can easily find out.

Adra8373 commented 7 years ago

Hi

No it is not in the repo, anyway I run the code on my own data but I got this error could you help me please: Loaded a list of 51 landmarks to train the model. Assertion failed: num_landmarks == model_landmarks_list.size(), file c:\phd\code s\superviseddescent\superviseddescent-master\include\rcr\helpers.hpp, line 70

patrikhuber commented 7 years ago

I don't know that off the top of my head - You'll just have to debug and read the code. It should be really simple.

The mean is in the repo btw. https://github.com/patrikhuber/superviseddescent/blob/master/apps/rcr/data/mean_ibug_lfpw_68.txt

Adra8373 commented 7 years ago

Hi

the problem is in model_landmarks_list { size=68 } std::vector<std::basic_string<char,std::char_traits,std::allocator >,std::allocator<std::basic_string<char,std::char_traits,std::allocator > > >

It is 68 while my landmarks are just 51. I do not why it is 68

Adra8373 commented 7 years ago

ok I solved it by change that

vector ibug_landmark_ids; // full 68 point list for (int ibug_id = 1; ibug_id <= 51; ++ibug_id) { ibug_landmark_ids.emplace_back(std::to_string(ibug_id)); }

Adra8373 commented 7 years ago

Hi

I have some questions about the speed and the training and testing data. For the speed, yesterday I run the rcr-train for 5 images with 51 feature points, it took about more than six hours, is it normal?

For the dataset, when you train 3000 images, how many images did you use for the testing dataset?

Regards

patrikhuber commented 7 years ago

I think I've trained it with 68 landmarks and 3000 images and it took a few hours or so. Probably you're not doing a release build with optimisation flags? If that doesn't help you can try training with less landmarks (e.g. 20) just to see whether it's much faster then (it should take under an hour then).

Adra8373 commented 7 years ago

Another question

How many images' feature points did you use to calculate the mean, please?

patrikhuber commented 7 years ago

68?

Adra8373 commented 7 years ago

Many thanks for replying. I mean how many images have you used to calculate the mean (are they 3000 images as well? )?

How many images have you used for the testing dataset?

Regards

patrikhuber commented 7 years ago

I think I used a few hundred to compute the mean, as mentioned above it doesn't matter much.

I used all the test images from all IBUG sets... I think HELEN and LFPW or something - maybe around 500? You can check their data if you want to use it.

Adra8373 commented 7 years ago

Many thanks

Adra8373 commented 7 years ago

Hi When I try to use my own track model with 4dface project. It gives bad results, although it works very good with rcr-track project. Is that related to the ibug2did.txt and model_contours.json?

patrikhuber commented 7 years ago

I really don't know from your problem description. Your idea might be right, if you changed the landmarking scheme, yes. You'll have to investigate. Sorry I can't be of much more help.