Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change file ending for facial trained models to f68 #8

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/motion_sense/facial_landmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ void FacialLandmark::startStreaming(){
}
dlib::cv_image<dlib::bgr_pixel> cimg(temp);
std::vector<dlib::rectangle> faces = detector(cimg);
//print_line("delected x faces: " + itos(faces.size()));
print_line("delected x faces: " + itos(faces.size()));

PoolVector<Vector2> pts;
if(faces.size()>0) {
dlib::full_object_detection dobj = (_model->get_data())(cimg, faces[0]);
dlib::rectangle r = dobj.get_rect();

PoolVector<Vector2> pts = utils::to_3dVec2(dobj);

emit_signal("facial_detect", Variant(utils::to_gRect(r)), Variant(pts));
}
//print_line("took X ms time processing: " + itos(os-> get_ticks_msec() -startTime));
Expand Down
4 changes: 2 additions & 2 deletions modules/motion_sense/facial_landmark_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ RES ResourceFormatFacialLandmark::load(const String &p_path, const String &p_ori

void ResourceFormatFacialLandmark::get_recognized_extensions(List<String> *p_extensions) const {

p_extensions->push_back("dat");
p_extensions->push_back("f68");
}
String ResourceFormatFacialLandmark::get_resource_type(const String &p_path) const {

if (p_path.get_extension().to_lower() == "dat")
if (p_path.get_extension().to_lower() == "f68")
return "FacialLandmarkModel";
return "";
}
Expand Down
4 changes: 3 additions & 1 deletion modules/motion_sense/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ PoolVector<Vector2> utils::to_3dVec2( dlib::full_object_detection &dobj ){
for( unsigned long i = 0; i < dobj.num_parts(); i++){
//shift it left cannot seem to find the faces in godot
long x = (dobj.part(i).x()-r.left());
long y = height - (dobj.part(i).y() - r.top());
//long y = height - (dobj.part(i).y() - r.top());
long y = (dobj.part(i).y()-r.top());
pts.set(i, Vector2(x, y));

}
return pts;
}