Git Product home page Git Product logo

goldenface's Introduction

GoldenFace OPENSOURCE SOFTWARE

An Image Processing Library About Calculating Face Golden Ratio, Facial Cosine Similarity and More

How does it work

The golden face library creates face vectors using biomath principles and calculates the facial golden ratio.

Biomath golden ratio prenciples:

alt text

Facial golden ratio analysis of goldenface library:

alt text

Ümit Aksoylu 2021 © M.I.T License Please check example.py for practical usage.

Installing Library:

pip install GoldenFace

Required Libraries (Dependencies)

  • opencv-python
  • opencv-contrib-python==4.4.0.46

Core Functions

Reading a face image as goldenFace object:

umitFace = GoldenFace.goldenFace("umit.png")

Printing face vectors:

print(umitFace.face2Vec())

Printing Geometric Facial Golden Ratio (Between 0-100):

print(umitFace.geometricRatio())

Printing Facial Cosine Similarity With A Golden Face (Between 1.0-0):

print(umitFace.similarityRatio())

Saving a goldenFace objects vectors as json file:

umitFace.saveFaceVec("umitFaceVectors.json")

Reading a face as vectors from json file:

loadedFace = functions.loadFaceVec("face.json")

Calculating face similarity between two face:

print(umitFace.faceSimilarity(loadedFace))

Get Info From GoldenFace Object

Get all facial landmark points

print(umitFace.getLandmarks())

Get all facial important points

print(umitFace.getFacialPoints())

Get face borders

print(umitFace.getFaceBorder())

Calculating Functions

Calculate Trichion-Glabella-Subnazale-Menton Deflection on face

print(umitFace.calculateTGSM())

Calculate Column Parsed line Deflection on face

print(umitFace.calculateVFM())

Calculate Trichion-Zygoma-Menton Deflection

print(umitFace.calculateVFM())

Calculate Trichion-Subnazale-Menton Deflection

print(umitFace.calculateTSM())

Calculate Lateral cantus-Chelion Deflection

print(umitFace.calculateLC())

Drawing Functions

These functions allow you to draw landmarks/ border lines on face

color = (255,255,0)

Draw a cover on face

umitFace.drawFaceCover(color)

Draw border lines on face

umitFace.drawLandmark(color)

Draw Trichion-Zygoma-Menton line on face

umitFace.drawTZM(color)

Draw Trichion-Glabella-Subnazale-Menton line on face

umitFace.drawTGSM(color)

Draw Column Parsed line on face

umitFace.drawVFM(color)

Draw Trichion-Subnazale-Menton line on face

umitFace.drawTSM(color)

Draw Lateral cantus-Chelion

umitFace.drawLC(color)

Draw facial golden ratio mask on face

umitFace.drawMask(color)

Draw facial important points on face

umitFace.drawFacialPoints(color)

Draw all landmark points on face

umitFace.drawLandmarks(color)

Write processed goldenFace object as image:

umitFace.writeImage("umit_analyzed.jpeg")

goldenface's People

Contributors

160201043 avatar aksoylu avatar rimmhedhbi 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.