1. Post #1
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    Well I sent my module to about 10 people and they have done absolutely nothing with it, so I'm just going to go ahead and release it.

    This module automatically chooses the first webcam it can find. (The current API is messed up and won't let me list all the cameras available).

    To make sure faceAPI works with your processor and camera, download the examples on the faceAPI website. There might be some drivers that you would need to run this module that is included with the example on the faceAPI website.

    Source
    Download

    faceAPI.GetVersion() -- Returns the string of the current version of faceAPI the module uses.
    faceAPI.GetHeadPos() -- Returns the current position of your head.
    faceAPI.GetHeadAng() -- Returns the current angle of your head.
    FACEAPI_ENABLED -- Global that is set if the module is properly ran.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 5Useful Useful x 2Lua King Lua King x 1 (list)

  2. Post #2
    Gold Member

    October 2010
    457 Posts
    I think this might be useful.
    If someone could give me some code to move the players head angle, that would be nice!
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Dumb Dumb x 8Funny Funny x 1 (list)

  3. Post #3
    Jvs
    PENISCorp's First Employee
    Jvs's Avatar
    June 2009
    1,598 Posts
    I think this might be useful.
    If someone could give me some code to move the players head angle, that would be nice!
    Are you kidding me? It's in the example file.
    if !CLIENT then return end
    
    require("faceapi")
    
    function faceAPI_demoCalcView(pl, pos, angles, fov)
    
    	local WorldPos,WorldAng = LocalToWorld(faceAPI.GetHeadPos()*300+Vector(130,0,0),faceAPI.GetHeadAng(),pos,angles)
    	// I add 130 forward since faceAPI's head center is a bit too close.
    
        local view = {}
        view.origin = WorldPos
        view.angles = WorldAng
        view.fov = fov
     
        return view
    end
     
    hook.Add("CalcView", "faceAPI_demoCalcView", faceAPI_demoCalcView)
    
    Reply With Quote Edit / Delete Reply Windows XP Italy Show Events Informative Informative x 1 (list)

  4. Post #4
    Gold Member
    ZpankR's Avatar
    September 2006
    600 Posts
    I've installed the whole thing correctly but I get this error when requiring faceapi:

    Code:
    error loading module 'faceapi' from file 'c:\program files (x86)\steam\steamapps\<snip>\garrysmod\garrysmod\lua\includes\modules\gm_faceapi.dll':
    	Impossível localizar o módulo especificado. (Impossible to locate the specified module)

  5. Post #5
    FlapadarV2's Avatar
    December 2010
    1,802 Posts
    I've installed the whole thing correctly but I get this error when requiring faceapi:

    Code:
    error loading module 'faceapi' from file 'c:\program files (x86)\steam\steamapps\<snip>\garrysmod\garrysmod\lua\includes\modules\gm_faceapi.dll':
    	Impossível localizar o módulo especificado. (Impossible to locate the specified module)
    Install VS2010 redistributables.

    http://www.microsoft.com/download/en...s.aspx?id=5555

  6. Post #6
    Gold Member
    ZpankR's Avatar
    September 2006
    600 Posts
    Ah thanks I thought I had that already.

    Yeah I do. Tried repairing the install but to no avail.

  7. Post #7
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    I've installed the whole thing correctly but I get this error when requiring faceapi:

    Code:
    error loading module 'faceapi' from file 'c:\program files (x86)\steam\steamapps\<snip>\garrysmod\garrysmod\lua\includes\modules\gm_faceapi.dll':
    	Impossível localizar o módulo especificado. (Impossible to locate the specified module)
    Stupid question, and I apologize for asking this, but did you check the folder to see if that file was in there?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 2Disagree Disagree x 1 (list)

  8. Post #8
    Gold Member

    April 2011
    384 Posts
    The error is ERROR! module 'xxx' not found! in red if it's not there.
    Reply With Quote Edit / Delete Reply Windows 7 Netherlands Show Events Agree Agree x 1 (list)

  9. Post #9
    Grocel's Avatar
    October 2008
    1,239 Posts
    Ah thanks I thought I had that already.

    Yeah I do. Tried repairing the install but to no avail.
    Did you install the FaceApi drivers?

  10. Post #10
    Gold Member
    ZpankR's Avatar
    September 2006
    600 Posts
    Did you install the FaceApi drivers?
    I did, it's awkward because it works on my desktop PC but not on my laptop, and they're practically the same. Thanks anyway.

  11. Post #11
    danielga's Avatar
    July 2007
    286 Posts
    This module automatically chooses the first webcam it can find. (The current API is messed up and won't let me list all the cameras available).
    Reply With Quote Edit / Delete Reply Windows 7 Portugal Show Events Informative Informative x 7 (list)

  12. Post #12
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    Thanks for the heads up man, but that is kind of a fib. faceAPI doesn't list all the cameras, but you can select any camera you want even if it's not the first one, faceAPI just won't give you the info on the camera type.

    Edited:

    I did, it's awkward because it works on my desktop PC but not on my laptop, and they're practically the same. Thanks anyway.
    faceAPI doesn't work with certain processors, maybe that's the problem. I wouldn't know.

  13. Post #13
    danielga's Avatar
    July 2007
    286 Posts
    faceAPI just won't give you the info on the camera type.
    You could probably get around it using DirectShow or MediaFoundation to enumerate all the input devices (http://paste.rohitab.com/560 line 138) and get all their info. But it will be a hell of a work and probably won't compensate it. You'll have to test around it. You could also give the API minimal information so you have less work.
    Reply With Quote Edit / Delete Reply Windows 7 Portugal Show Events Lua King Lua King x 2 (list)

  14. Post #14

    July 2011
    234 Posts
    What am I supposed to do here? I installed it all into the right foldiers, but the head tracking does not work ingame. Did I miss something?
    Reply With Quote Edit / Delete Reply Windows 7 Sweden Show Events Dumb Dumb x 4 (list)

  15. Post #15
    Jvs
    PENISCorp's First Employee
    Jvs's Avatar
    June 2009
    1,598 Posts
    What am I supposed to do here? I installed it all into the right foldiers, but the head tracking does not work ingame. Did I miss something?
    You are probably missing the most important thing about this module,the faceapi.
    This module is just a middle man between the faceapi and gmod.
    Go and download the faceapi before complaining that it doesn't work.
    http://www.seeingmachines.com/produc...api/downloads/

  16. Post #16

    July 2011
    234 Posts
    You are probably missing the most important thing about this module,the faceapi.
    This module is just a middle man between the faceapi and gmod.
    Go and download the faceapi before complaining that it doesn't work.
    http://www.seeingmachines.com/produc...api/downloads/
    Shit. Massive derp. I'll install it and check again.

    Edited:

    Alright, it works!

    Although shaky as hell.

  17. Post #17
    Gold Member
    Hentie's Avatar
    May 2010
    2,129 Posts
    Here's my modified version of the example, it only moves the angle of your view, but it's smoother.
    if !CLIENT then return end
    
    require("faceapi")
    
    function faceAPI_demoCalcView(pl, pos, angles, fov)
    
    	lastHeadAng = lastHeadAng or angles
    
    	local headAng = faceAPI.GetHeadAng()
    	local newHeadAng = Angle(faceAPI.GetHeadAng().p*3,faceAPI.GetHeadAng().y*3,faceAPI.GetHeadAng().r)
    	local finalHeadAng = LerpAngle(0.05,lastHeadAng,newHeadAng)
    
    	local WorldPos,WorldAng = LocalToWorld(faceAPI.GetHeadPos()*300+Vector(130,0,0),finalHeadAng,pos,angles)
    	// I add 130 forward since faceAPI's head center is a bit too close.
    
        local view = {}
        view.origin = pos
        view.angles = WorldAng
        view.fov = fov
    	
    	lastHeadAng = finalHeadAng
     
        return view
    end
     
    hook.Add("CalcView", "faceAPI_demoCalcView", faceAPI_demoCalcView)

  18. Post #18
    Gold Member
    D3TBS's Avatar
    March 2011
    8,735 Posts
    hmm ok guys so I downloaded the files and faceapi from the website everything is correctly installed i think. The webcam turns on ingame and the mouse is moving pretty weird. What else do I have to do?
    Reply With Quote Edit / Delete Reply Windows Vista Portugal Show Events Funny Funny x 1 (list)

  19. Post #19
    Gold Member
    dingusnin's Avatar
    February 2010
    2,028 Posts
    Maybe make it increment and remove the need of a mouse .... and maybe make +attack1 and +attack2 work when we blink with our eyes!
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Funny Funny x 3 (list)

  20. Post #20
    JonBons's Avatar
    November 2010
    95 Posts
    I can't wait to dive more into this, couple mistakes I made while testing it but it was fun.
    I'm thinking of doing some stuff with vehicles, not sure yet.

    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 2 (list)

  21. Post #21
    Grocel's Avatar
    October 2008
    1,239 Posts
    Maybe make it increment and remove the need of a mouse .... and maybe make +attack1 and +attack2 work when we blink with our eyes!
    I think that would only work with the commercial license.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Funny Funny x 2 (list)

  22. Post #22
    Dennab
    May 2010
    1,020 Posts
    I can't wait to dive more into this, couple mistakes I made while testing it but it was fun.
    I'm thinking of doing some stuff with vehicles, not sure yet.

    I think I'm going to be sick... *vomits*
    Reply With Quote Edit / Delete Reply Windows Vista United States Show Events Dumb Dumb x 1 (list)

  23. Post #23
    Gold Member
    D3TBS's Avatar
    March 2011
    8,735 Posts
    I can't wait to dive more into this, couple mistakes I made while testing it but it was fun.
    I'm thinking of doing some stuff with vehicles, not sure yet.

    you must have no neck whatsoever
    Reply With Quote Edit / Delete Reply Windows Vista Portugal Show Events Funny Funny x 2 (list)

  24. Post #24
    Gold Member
    D3TBS's Avatar
    March 2011
    8,735 Posts
    any help?
    Reply With Quote Edit / Delete Reply Windows Vista Portugal Show Events Dumb Dumb x 4 (list)