Luca96 / dlib-minified-models

A set of minified (but still accurate) models for Dlib
Apache License 2.0
69 stars 23 forks source link

test shape predictor #4

Closed razziel1508 closed 4 years ago

razziel1508 commented 5 years ago

HI, i followed the tutorial and make my owns predictors, thanks a lot. The issue comes when i try to tested. The Error of the model is so bigger (262!). I try to measure your eyebrown predictor an have 272. I use the labels_ibug_300W_test.xml of the tutorial. My predictors already work, but with medium quality. Best regards.

Luca96 commented 5 years ago

Hi, when you measured the accuracy of the eye-eyebrows (EE22) model, did you run the following code from the training_script?

  ...  
  train_xml = "eye_eyebrows_22_train.xml"
  test_xml = "eye_eyebrows_22_test.xml"
  dat = "eye_eyebrows_22.dat"
  slice_xml(train_labels, train_xml, parts)
  slice_xml(test_labels, test_xml, parts)

  # training
  ...

  # compute traning and test error
  measure_model_error(dat, train_xml)
  measure_model_error(dat, test_xml)

because I've measured the test error and got 8.40 as depicted here.

Also I've check the predictions, and their quality is quite good. Keep in mind that the model I've made, are built to be fast (during inference) and lightweight in size. So, I had to trade accuracy for speed and size.

Anyway, getting a better accuracy is a matter of changing the training parameters.

razziel1508 commented 5 years ago

Thank you!, i followed the scripts of the Medium page and only the part of creating the slice_xml file to train comes, therefore the comparison was with the complete set. i fixed this and reach predicts with an error between 8 and 11.

Now I have another little problem, I train and test my predictors on my desktop computer and it works fine. When the attempts move the files to my notebook or a jetson, the files get corrupted, and I tried to compress them and use different storage devices, always when loading them mark:

Tracking (latest recent calls): File "video_facial_landmarks.py", line 30, in predictor = dlib.shape_predictor (args ["shape_predictor"]) RuntimeError: error deserializing the short object while deserializing a floating point number. while deserializing a dlib matrix: while the object of type std :: vector is deserialized while the object of type std :: vector is deserialized while the object of type std :: vector is deserialized

Thanks a lot for you tutorials, best regards.

Luca96 commented 5 years ago

Well, is a strange issue because I've build some models (included the one in the repo) on a desktop platform, and when I've tested them on an Android device they worked fine.

Maybe the desktop version of Dlib encodes the model with a different format, than the notebook/jetson version. You can check the version of the libraries, and also compilation flags and eventual missing libraries (but it should not be the case).

If the issue still persist, I think that you should contact the Dlib author and eventually open an issue on the Dlib repository.