Code Monkey home page Code Monkey logo

facesubstitution's People

Contributors

arturoc avatar kylemcdonald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facesubstitution's Issues

SIGABRT on Tracker::Load

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

Missing Clone.h

Hello,

Trying to build this example app, but xCode complains about missing Clone.h which i can't find in src directory.

thanks

"'toC' not declared in the scope"

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

Face Substitution Not Working in android

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

LNK2019

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!

Which versions of Ofx, OfxCV and OfxFacetracker do I need to compile?

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

More of a question than an issue so far code:blocks 10.05 and poco.net

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?

image drag crashes app (and more)

hello,

i am trying FaceSubstitution example app and i have some issues :

  • I am not sure where to put my images. Reading code i imagine this is in bin/data/faces ?
  • according to the code, images must be jpg or png ? but which size ? alpha layer accepted ? do they must have a specific name ?
  • i tried with a png with alpha. when hit the UP key, app crashes.

capture d ecran 2015-05-08 a 15 45 29

  • when i drag/drop an image onto the app, the app crashes

iOS possibility?

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,

compatibility with newest version of ofxCv and ofxFaceTracker

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?

GLSL runs really slow!

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

Exposing setter functions in ofxFaceTrackerThreaded

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.

Compilation error : convexhull function

Hi, I was trying to compile the facesubstitution using xcode 4.6.3 with opencv 2.4.6 installed. However, the semantic issue was: No matching function for call to "conveHull". Are there errors related to my xcode version and opencv version? Please see attached files. Thanks.

error
sub-error1
sub-error2
sub-error3
sub-error4

How to compile the work

I know little about the software.
How can compile the work in windows.
Thanks for the help in advance.

FaceSubstitution build error (drawHighlightString was not declared)

Update: Jan 14 4pm start
I added an image (jpg) of the Mona Lisa to the data/faces directory and the program runs now.

facesub1

dst

Update: Jan 14 4pm end

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);

compiling on Fedora 21

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? =)

GBD: Data formatters temporalily unavailable error

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.

assertion failed (s.is_open())

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.

Create a custom mask without eyes and mouth

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!

opacity of overlaid face

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?

Osx build

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

A ton of Apple Mach-O Linker (id) Errors while compiling

Hey,
I downloaded all the files from the github masterbranch, but while compiling for the first time, I got a lots of "Apple Mach-O Linker (id)" - Errors (see Screenshots).

I´m using Xcode 5 on Maverick.

If somebody have ideas or solutions, please let me know ;)

thank you in advance!

bildschirmfoto 2013-11-18 um 16 39 24

windows version?

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.

"'toCv' not declared in the scope"?

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

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"

Trying to compile in VS2015 ofxCV and ofxFaceTracker works fine but FaceSubstitution not

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.

Compiling errors

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.

FaceSwap Example Request

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

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?

performance in full screen

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?

Scramble Suit example - OpenCV Error: Assertion failed (ssize.area() > 0) in resize

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

data_folder

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

Face substitution doesn't work properly when the face moves fast

Hi,

There are couple of issues I have noticed:

  1. When the face moves fast in the camera, the substitution doesn't work properly. Probably the tracking is not happening properly in all the frames.
  2. Tracking/substitution doesn't happen if the face moves sideways beyond certain angle.

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

SImulate hard light blend mode

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.

3d kinect-enabled real-time facial remapping

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.

SIGABRT when changing face image

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:

http://pastebin.com/GQDKcbjH

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?

About iOS

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;

Performance and setup environment

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:

  1. Could you please let me know the ideal environment where the facesubstitution can be tested?
  2. What is the minimum hardware requirement for the substitution? And how long does it take for some visible changes to occur? And for the complete substitution?
  3. The application was consuming around 45% of CPU. Any tips on improving the performance?

Looking forward to your response...

Regards,
Pinakee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.