Coder Social home page Coder Social logo

Comments (6)

bamos avatar bamos commented on May 18, 2024

Hi @Strateus - why is there a big probability the points will be outside the range? Do you have examples where this is failing for reasonable images? I haven't extensively profiled or tested this portion of code, but the alignment code works for 13081 out of 13233 images from the LFW dataset.

This code portion checks if the boundary points of the detected landmarks are outside of the image, which should only happen in extreme cases like if somebody's face is outside of the image. There may be heuristics that can improve this, like filling in the missing portions with black pixels or using image completion.

from openface.

Strateus avatar Strateus commented on May 18, 2024

Well, i used my web camera, and added 30% margins to face, and still after warping there were points out of warped image all the time i tried, maybe 5% it was ok, but rest failed.
Anyways i would consider this check to be more thorough since you transform only on eyes and nose. Just thoughts, i elminated this check locally and will be testing it.

from openface.

bamos avatar bamos commented on May 18, 2024

Code reference:

if 0 <= l <= w and 0 <= r <= w and 0 <= b <= h and 0 <= t <= h:

from openface.

bamos avatar bamos commented on May 18, 2024

Be careful when expanding the margins since the neural network nn4.v1.t7 is trained with no margin added. I wouldn't be surprised if this severely hurts the accuracy.

You need to train a new neural network if you want to add margins.
Note that in a few experiments I ran, adding a margin didn't improve the accuracy,
which is why there is no margin in nn4.v1.t7.

Also, won't eliminating the check cause array out of bounds errors in:

cwImg = cv2.resize(warpedImg[t:b, l:r], (size, size))

from openface.

Strateus avatar Strateus commented on May 18, 2024

Yea i got the point about network. Accuracy is not my primary concern now.
As for eliminating, i did it like this:

    l = 0 if l < 0 else l
    r = w if r > w else r
    t = 0 if t < 0 else t
    b = h if b > h else b

from openface.

bamos avatar bamos commented on May 18, 2024

Fixed with the new alignment technique.

from openface.

Related Issues (20)

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.