arturoc / facesubstitution Goto Github PK
View Code? Open in Web Editor NEWFace substitution experiments using ofxFacetracker
License: Other
Face substitution experiments using ofxFacetracker
License: Other
I'm getting a successful build then an immediate error at line 56 in Tracker.cc
void Tracker::Load(const char* fname)
Should I direct this towards Jason? My files from him are probably several weeks old by now.
Thanks,
Jason
Hello,
Trying to build this example app, but xCode complains about missing Clone.h which i can't find in src directory.
thanks
I've been trying to compile the FaceSubstitution but keep being met with the error "'toCv' not declared in the scope." I am using the most recent version of ofxCv and dug through it and found that there is in fact something called toCv in there. I'm not the best coder in the world and I am stuck as to what is happening here. Any advice would be awesome!
Cheers,
-bp
Hello @arturoc and @kylemacdonald Please help me resolving issues in android platform I have successfully run face substitution project on android it successfully dictates face from image but when it detect face from video it draws video in revers and blurs the video play it didn't mask the face properly can you people help me to resolve issue
Hi everyone, I have some problem when I compile Face Substitution in VS2015, using OF v0.9.3.
There are some LNK errors that I can't fix, I already did all that other forums indicate, I could fix some ofxFaceTracker examples errors but sitll can't fix this in particular:
First, Why do I have to copy and paste Clone.h?
I had some issues with drawHighlightString("drag an image here", 10, 30);
so I replaced it for: ofDrawBitmapStringHighlight("drag an image here", 10, 30);
After that, I configured some properties on Output Propierties "/%(RelativeDir)/" things
And last ones, some LNK2019 and LNK2001 errors that I can't fix. Would you help me please? Thank you very much!
Getting lots of compile errors running the latest versions of Ofx, OfxCV and OfxFaceTracker. Does anyone know which versions I need in order to compile FaceSubstitution and other examples?
Another issue is if I need an older version of OSX SDK. El Capitan it seems only works with XCode 7
Hi,
I've recently tried compiling the latest version of the source using code:blocks 10.05 on windows 7. I'm getting some kind of linking/compilation error with poco. I believe I'm using the same compiler and have set the tool chains correct but I may have missed something. My question is this: what are the last known "good" versions that are known to compile for windows 7 using code:blocks et al? Is 10.05 of code:blocks compatible with the recent version of openframeworks as well as poco?
hello,
i am trying FaceSubstitution example app and i have some issues :
Hey, Arthur, thanks for the awesome library. I've got FaceSubstitution to build and work properly on my Mac. Now for iOS, if I were to use the Open Frameworks iOS version, and use the source code of this repo after adding ofxCv and OfxFaceTracker as addons, should it build fine on an iOS device?
I've been trying to tinker with this possibility today but when I tried to build on my iPad, it threw Apple LLVM 6.0 Error as well as a whole bunch of errors from core.hpp and operations.hpp regarding "Non-const static data member must be initialized out of line".
Thanks,
I successfully built the example projects in ofxCv and ofxFaceTracker using openFrameworks. Both ofxCv and ofxFaceTracker are the newest version in the website. Then I copy the FaceSubstition stuff and paste them in the folder examples with a folder name 'FaceSubstitution'. I built and run the project. The compile error include 'FaceTracker/Tracker.h: No such file or directory' and 'FACETRACKER' has not been declared.'
First, I do not know I should put the project into another site. Second, I am not sure if the newest ofxCv and ofxFaceTracker are compatible with the FaceSubstitution project.
Or I can change anything to get it run successfully?
Hi,
The FaceSubstitution/FaceSubstitution example code runs extremely slow on my machine, with a frame rate of less than 1fps.
And the FaceSubstitution/CloningWrapper example code runs also extremely slow on my machine, with a frame rate of less than 1fps.
I have found that when the two two calls to maskedBlur(src, mask, srcBlur) are commented out from FaceSubstitution/CloningWrapper/src/Cloning.cpp, my program would speed up.
Therefore, maskedBlur(ofTexture& tex, ofTexture& mask, ofFbo& result) in FaceSubstitution/CloningWrapper/src/Cloning.cpp is the function that is slowing everything down.
But I don't know why it would slow down my program. And I don't know how to solve this problem.
Do you have any idea of what is happening?
Regards,
Shaohua Wan
Kyle, Arturo,
Great work, getting my app ready for installation next week!
I'm working on attempting to expose the setters for "tweakable" properties of the threaded facetracker (rescale, iterations, tolerance... ). I've attempted to modify your ofxFaceTrackerThreaded.h to include a function like this:
void setScale(float s){
if(lock()) {
tracker->setRescale(s);
unlock();
}
}
No luck, however, I get a BAD_ACCESS error on line 323 of ofxFaceTracker.cpp.
I can set the properties by calling the function from inside the threadedFunction, but this does not allow me to easily change the value without recompiling. My knowledge of C++ and ofx is limited, so I must be missing something.
I know little about the software.
How can compile the work in windows.
Thanks for the help in advance.
Update: Jan 14 4pm start
I added an image (jpg) of the Mona Lisa to the data/faces directory and the program runs now.
Update: Jan 14 start
Changed the drawHighlightString statements to generic prints. Compiled. However, I am getting a run-time error now. There must be some missing images in my set-up for the demo to run...???
kaisark@kaisark-VBox16:~/openFrameworks-stable/apps/myApps/FaceSubstitution$ make RunRelease
HOST_OS=Linux
checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl glfw3 gl glu glew gtk+-3.0 libmpg123
[notice ] ofGstVideoGrabber: Probing devices with udev...
[notice ] ofGstVideoGrabber: Found device 80ee:0030, getting capabilities...
[notice ] ofGstVideoGrabber: detected v4l2 device: VirtualBox Webcam - FaceTime HD
[notice ] ofGstVideoGrabber: driver: uvcvideo, version: 264721
[notice ] ofGstVideoGrabber: Capabilities: 0x84200001
[notice ] ofGstVideoGrabber: initGrabber(): selected device: VirtualBox Webcam - FaceTime HD
[notice ] ofGstVideoGrabber: initGrabber(): selected format: 1280x720 video/x-raw RGB framerate: 30/1
[notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: v4l2src name=video_source device=/dev/video0 ! video/x-raw,format=RGB,width=1280,height=720,framerate=30/1 ! appsink name=ofappsink enable-last-sample=0 caps="video/x-raw, format=RGB, width=1280, height=720"
camera face not found: 28508368
drag an image here: 275027840
Update: Jan 14 end
-----------------------------------------
After successfully building CloningWrapper, I ran into the FaceSubstitution build error below. I wonder if this is a code version mismatch error between the various addons, etc??? FYI - I have built the example-blink app which runs successfully and which uses the following addons: ofxCv, ofxFaceTracker, ofxGui, ofxOpenCv, ofxOsc
I am using openFrameworks (stable) 0.9.8 on Ubuntu 16 (VM).
/home/kaisark/openFrameworks-stable/apps/myApps/FaceSubstitution/src/ofApp.cpp: In member function ‘virtual void ofApp::draw()’:
/home/kaisark/openFrameworks-stable/apps/myApps/FaceSubstitution/src/ofApp.cpp:71:54: error: ‘drawHighlightString’ was not declared in this scope
drawHighlightString("camera face not found", 10, 10);
I am trying to compile ScrambleSuit on Fedora 21
So I installed openFramworks 0.9.9,
installed all codecs and deps,
installed ofxCv and ofxFaceTracker,
cloned your repo into a subfolder in ofx/apps/,
let projectGenerator update the ScrambleSuit project for linux x64 CodeBlocks (with addons: ofxOpenCv, ofxCv, ofxFaceTracker),
cd into ScrambleSuit directory
executed make
and get this error:
src/testApp.cpp: In Elementfunktion »void testApp::drawNormalized(ofxFaceTracker&, ofBaseHasTexture&, ofFbo&)«:
src/testApp.cpp:45:6: Fehler: »class ofBaseHasTexture« hat kein Element namens »getTextureReference«
tex.getTextureReference().bind();
^
src/testApp.cpp:47:6: Fehler: »class ofBaseHasTexture« hat kein Element namens »getTextureReference«
tex.getTextureReference().unbind();
^
src/testApp.cpp: In Elementfunktion »void testApp::maskBlur(ofBaseHasTexture&, ofFbo&)«:
src/testApp.cpp:61:6: Fehler: »class ofBaseHasTexture« hat kein Element namens »getTextureReference«
tex.getTextureReference().draw(0, 0);
^
src/testApp.cpp: In Elementfunktion »void testApp::alphaBlur(ofBaseHasTexture&, ofFbo&)«:
src/testApp.cpp:85:6: Fehler: »class ofBaseHasTexture« hat kein Element namens »getTextureReference«
tex.getTextureReference().draw(0, 0);
^
Does anyone know how to solve this? =)
On Ofx 0071 Mac OSX 10.6.8 when I build the example projects (which it says are successful), the binary doesn't open, becoming unresponsive (eg. it just hangs there and needs to be force quit). I thought it may be the model data, but they are in bin/data/models.
any way to get facesub to recognize and play animated gifs?
Hi - I got the assertion error that Kyle mentioned in the readme for facetracker. I'm assuming this has something to do with putting the model files in the proper place, but I can't seem to find where that place is. I have the standard face tracker examples working fine. I created a bin/data/model folder in the FaceSubstitution example, but that didn't seem to solve the issue.
Hello,
I need a little bit of orientation
I am trying to achieve a face substitution, using a 'mask' that is a 'faceless' image. I mean, replace my actual face with a face without eyes, mouth and nose.
The first problem was, if I passed an image without face, the ofxFaceTracker object didn't recognize any face obviously!.
So I thought, I can have two version of my mask image. one with the face so I can get the source points, and another faceless to use it as the texture.
So within loadFace, I pass the face image to the srcTracker as usual, and then I update the src variable.
void ofApp::loadFace(string face){
src.loadImage(face);
if(src.getWidth() > 0) {
srcTracker.update(toCv(src));
srcPoints = srcTracker.getImagePoints();
}
/* Replace the src image to get the faceless texture */
vector<string> splitString = ofSplitString( face, "/");
vector<string> splitString2 = ofSplitString( splitString[1], ".");
string faceless = "faceless/"+splitString2[0]+ "_.jpg";
src.loadImage(faceless);
}
Then, inside the update function I set the clone strength to a high number to make my face less prominent in the image, this is more or less working, but I need help with the mask. my questions:
How modify the mask mesh??, so avoid holes in the eyes and mouth. Do I need to modify the srcPoints vector ??.
Maybe there are some better approach to achieve what I want?
Thanks for the help in advance!
Hi - I was trying to increase the opacity of the overlaid face (or reduce blending). I noticed that decreasing the strength decreases the opacity, but increasing it did not seem to make it any more opaque. Where can I adjust this?
Hi,
I'm using osx 10.8.2 and have last openframeworks
I'm trying to build facesubstitution on my computer but i have to compile ofxGstV4L2Sink and ofxV4L2Settings but it need linux/videodev2.h ? how can i build it!
regards
I saw the example of the shimmer suit and I think that is awesome! is this still being worked on?
can you provide us a windows version of this program? I can't figure out how to install these files on my windows 7. I d really appreciate it. thanks.
I've been trying to compile the FaceSubstitution but keep being met with the error "'toCv' not declared in the scope." I am using the most recent version of ofxCv and dug through it and found that there is in fact something called toCv in there. I'm not the best coder in the world and I am stuck as to what is happening here. Any advice would be awesome!
Cheers,
-bp
GPUCloning can't work in iOS, and Xcode prints error is "[error] ofShader:xxx"
what should I do,The error is seem that the file of "Clone.frag"
Hi, I have a some question. i'm new to openframeworks so forgive me nobe question. I'm compiling succeesfull the ofxFacetracker on VisualStudio Comunity 2015 I did as instruction provided- first compile ofxCV , with and expample files are working very good, after I complie ofxFaceTracker from github branch and also working very good with example files. But there is the last step to switch the source files from FaceSubstitution branch to ofxFacetracker working example and I have no idea what doing wrong but any luck with it. Can you please provide what files I need to switch to have working FaceSubstitution on ofxFaceTracker "example-eampty". I'm wokring on the project for theatre performance and also I want to bay the ofxFaceTracker licence. It's experimental project where actor looks inside the well full of water and in the reflection he sees another face.
Thank You in advance.
When trying to compile, after linking the libraries correctly and adding Jason's Tracker library, I get a "FACETRACKER not declared" error in ofxFaceTracker.
I've renamed the ofxCv Tracker.h to MyTracker.h, as suggested here: kylemcdonald/ofxFaceTracker#28
But the error remains.
The only way I can make it disappear is by adding "#include <Tracker.h>" to ofxFaceTracker.h, but then the app compiles correctly, runs and crashes with the error:
Assertion failed: (s.is_open()),Assertion failed: (s.is_open()), function Load, file /Users/andre-a/Work/Libraries/of_0071_osx_release/apps/Face Sub/FaceSubstitution/../../../addons/ofxFaceTracker/libs/Tracker/Tracker.cc, line 59.
function Load, file /Users/andre-a/Work/Libraries/of_0071_osx_release/apps/Face Sub/FaceSubstitution/../../../addons/ofxFaceTracker/libs/Tracker/Tracker.cc, line 59.
Hi Arturo,
thanks again for this amazing addon.
Do you have the intention to create a faceswap example?
I mean, when detect two faces, swap then.
I can try to do it, but do you have any suggestions?
Thanks!
ofxFaceTrackerThreaded in the Face Substitution demo on the master branch fails to accurately detect faces. In optimal conditions the face is only detected sporadically.
However, disabling the threaded version and using the ofxFaceTracker directly allows for full operation of the program. Only, in this case framerates are choppy.
What information should I provide to further diagnose this issue?
testApp.h not found in FaceSubsitution
Hi - I'm trying to use facesubstitution in full screen mode and I've noticed that if I trigger fullscreen (or even if I change the camera grabber dimensions and app dimensions, face substitution has a really hard time finding the face. Any idea why? Or if there's a way to still keep the capture dimensions small, but boost the display to full screen?
First, am able to compile the FaceSubstitution example without issue.
I believe my data folder is populated correctly. Am populating faces folder with identical images used in FaceSubstitution example which load fine. see attached
The complete error message I am getting is
[warning] ofFile: copyFrom(): copying a writable file, opening new copy as read only
[ error ] ofImage: loadImage(): couldn't load image from "/Users/foo/bin/data/301 0.234737 -0.304078 6301"
[ error ] ofPixels: format doesn't support channels
OpenCV Error: Assertion failed (ssize.area() > 0) in resize, file /Applications/OpenFrameworks/openframeworksDevelop/scripts/apothecary/build/opencv/modules/imgproc/src/imgwarp.cpp, line 1834
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Applications/OpenFrameworks/openframeworksDevelop/scripts/apothecary/build/opencv/modules/imgproc/src/imgwarp.cpp:1834: error: (-215) ssize.area() > 0 in function resize
and this line is hilighted in Tracker.cc
cv::resize(im,small_,cv::Size(TSCALE_ww,TSCALE_hh),0,0,CV_INTER_LINEAR);
I think this is a similar error
https://forum.openframeworks.cc/t/ofxavfvideoplayer-ofxcv-ofxfacetracker-movie-cropped-and-face-not-detected/20266
Hi,
There are couple of issues I have noticed:
Please let me know if there is any solution for the above two issues. I have been trying the application on Windows.
Looking forward to your response and support...
Thanks,
Pinakee
This is a modification I am trying to make to the existing code.
I have a face image with tatoos and I want this image to combine correctly with the 'live' captured face regardless of the users skin color.
Need to integrate this addon
https://github.com/Akira-Hayasaka/ofxPSBlend
Am able to compile but the blend effect is being applied to the entire image, not just the masked clone image.
Is this crazy, or would it hypothetically be possible to use a 3d texture (captured, for example, with a kinect) as the "source image," basically making this work in 3d? I imagine that would also eliminate the need to correct for weird mapping errors (e.g. when you turn your head left or right). What do you think?
I'm going to start tooling around with the code tomorrow and see if I can hack together something.
Either when dragging images to the app, or when loading through the 'faces' folder, the app will take the image some times and crash with the following error some other times:
Whilst swapping between 2 images, it'll show the 1st one ok, the 2nd one ok, but when going back to the 1st one, it crashes.
Usually it's on the 3rd image change.
Any idea why?
Clone can not work in iOS, What should I do?
Xcode prints this:
[error] ofShader: sorry,it looks like you can't run 'ARB_shader_objects';
[error] ofShader:ofShader:setupShaderFromSource();failed creating GL_FRAGMENT_SHADER shader;
[error] ofShader:please check the capabilites of your graphics card:http://www.ozone3d.net/gpu_caps_viewer;
[error] ofShader:linkProgram(): tring to link GLSL program,but no shaders created yet;
Hi,
I have built the face-substitution on windows on a Core i5 processor - HP laptop. When I run the application, somehow the facetracking doesn't happen on every frame - even I tried it standing in a bright sunshine :). I am not sure if the cam is the issue or light.
I have following queries:
Looking forward to your response...
Regards,
Pinakee
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.