You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was able to run the code of alignment and training successfully on Mac Os.
The only issue regarding the training code (in my case at least) was in the MapShape function in utils_train.cpp file.
Just change the function MapShape to the following and the training will work (I had to cast the x and y values to int)
Hi, no the project as it is compile correctly on mac os (using my own CMakeLists.txt). However when I run it the code crushes in main_train.cpp -> TrainModel -> CreateTestInitShapes line -> in the CreateTestInitShapes function the line "cv::kmeans(all_landmarks ...." causes memory leak (malloc: *** error for object : pointer being freed was not allocated). I can't figure out why. I need maybe to dig more in the cv::kmeans source code. When casting to int the error disappears.
By the way I had the same issue when I run the training code on Android using JNI, it crushes at the same line with an error related to the memory. Do you have any ideas?
The model I trained after casting to int doesn't seem to work.
Hi, I was able to run the code of alignment and training successfully on Mac Os.
The only issue regarding the training code (in my case at least) was in the MapShape function in utils_train.cpp file.
Just change the function MapShape to the following and the training will work (I had to cast the x and y values to int)
vectorcv::Point2d MapShape(cv::Rect original_face_rect,
const vectorcv::Point2d original_landmarks, cv::Rect new_face_rect)
{
vectorcv::Point2d result;
for (const cv::Point2d &landmark: original_landmarks)
{
result.push_back(landmark);
result.back() -= cv::Point2d(original_face_rect.x, original_face_rect.y);
result.back().x = result.back().x * (int)
((float)(new_face_rect.width) / original_face_rect.width);
result.back().y = result.back().y * (int)
((float)(new_face_rect.height) / original_face_rect.height);
result.back() += cv::Point2d(new_face_rect.x, new_face_rect.y);
}
return result;
}
The text was updated successfully, but these errors were encountered: