Giter Site home page Giter Site logo

application-no201700130's Introduction

Application-No201700130

Task 1 is to find th 18 landmarks of mouth shape and then unroll it to a 36 dimensional vector and then apply Pricipal Component Analysis on the vector for dimensionality reduction. To do the above task we must follow the following steps :

  1. create a rectangular mask to detect the face from the picture. The function rect_to_bb does that.
  2. We need to identify the important landmarks int face and store them. This is done inside the landmark function which produces a shape object that detects 68 landmark points for the face.(The mouth can be accessed through points [48, 68]. The right eyebrow through points [17, 22]. The left eyebrow through points [22, 27]. The right eye using [36, 42]. The left eye with [42, 48]. The nose using [27, 35]. And the jaw via [0, 17]). Since we just need 18 land marks for the mouth area so we convert the shape object to a numpy matrix using shape_to_np() function after which we store the mouth landmarks in a variable called lip.
  3. Then we apply PCA for all the images. For each image wefind the 18 landmark points as stated above and then unroll it to a 36D vector which is stored in S[]. After which PCA for 20 component is applied and the value is stored in S_PCA.

Task 2 is to calculate weighted median. To do that we must follow the following steps :

  1. Calculate sigma, for this we must calculate the magnitude of each vector obtained by the subtraction of S_i and S_target.Then we can calculate using equation 12.
  2. Calculate the weights of each training example(equation 11).
  3. Calculate the weighted Median.

Variables used : N = total number of candidates n = total number of good candidates S[][] = Nx36 matrices which contains the mouth space of N candidates in form a 36 dimensional vector S_target[] = 36x1 vector which contains mouth shape of the target candidate.(assumed it is already provided) w[] = nx1 vector which contains the weight of each candidate alpha = innitialised to 0.9(as mentioned in the paper) sigma = variable to calculate weights. I_i[] = an array of images loaded from the dataset I_k = target image(assumed it is already provided). median_img = contains the weighted median image(calculated via equation 9). lip[] = contains 18 landmark point for the mouth region S_PCA = contain the 20 PCA coefficients. path = contains the path of the dataset.(needs to be provided.

How to run the code?

  1. Download the dataset from the given link https://drive.google.com/file/d/0B5t0y0bbW7lZU0JTVlZxNHZ3VGs/view?usp=sharing.
  2. Install all the dependencies.
  3. In the variable path give the path of the dataset in your computer.
  4. Provide the values of S_target and I_k.
  5. Compile and run.

application-no201700130's People

Contributors

shrutinaagarwal avatar

Watchers

 avatar  avatar

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.