Skip to main content

Info

ldm.py 2018-05-25

Author: Zhao Mingming <471106585@qq.com>

Copyright: This module has been placed in the public domain.

version:0.1.0 - add compare2dir

version:0.1.1 - add face_rec_ms version:0.1.3 - add compare2imglist

Classes: - LDM: you can use a function to get landmarks and face feature with no other libs

Functions:

  • face_feature: the feature of face in the image for face recognition

  • landmarks: get the landmarks and face in the image

  • face_rec: return the face similarity of the face in two images

  • has_same_person: return a int(>0) if there have a same person in two images,otherwise 0

  • compare2dir: compare the face in the images of the two dirs,and return the rate ,score_avg,class_id1,class_id2

  • compare2imglist: compare the face in the imglist ,and return the rate ,score_avg,class_id1,class_id2

How To Use This Module

funny cat picture
  1. example code:

imagepath="closed_eye/9.jfif"
img=io.imread(imagepath)
img1=img
imagepath="closed_eye/14.jfif"
img2=io.imread(imagepath)

ldmer=ldm.LDM()
print img.shape[0]
ldl,facel,txt=ldmer.landmarks(img)
print txt

for ld in ldl:
    print 10*'-'
    print 'nose:'
    print ld['nose']
for face in facel:
    print 10*'-'
    print 'face:'
    print face.top()
    print face.left()
    print face.width()
    print face.height()
    print face.bottom()
    print face.right()
    x,y,w,h=[face.top(),face.left(),face.width(),face.height()]
    print x,y,w,h
print "feature:"
ffl=ldmer.face_feature(img,facel)
for ff in ffl:
    print help(ff)
    print 'ff='+str(ff)
    print 'len(ff)='+str(len(ff))
    print 'ff[0]='+str(ff[0])
    print 'ff[127]='+str(ff[127])

print "face compare:"
print ldmer.face_rec(img1,img2)
print ldmer.has_same_person(img1,img2)
print ldmer.has_same_person(img2,img2)

print "face number:"
print ldmer.face_number(img,facel)

Refresh

add a function : ldmer.imread(imgpath) modify the return value number to: has_flag,max_score=ldmer.has_same_person(img1,img2)

Release files for ldm 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ldm 0.1.3
File Size Uploaded
ldm-0.1.3.tar.gz 6.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ldm 0.1.3
File Interpreter ABI Platform
ldm-0.1.3-py2.7.egg Legacy Egg format - - Details
ldm-0.1.3-py2-none-any.whl Python 2 none any Details

Total release size: 25.8 kB

Release files / ldm-0.1.3.tar.gz

Download URL ldm-0.1.3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
65969b847a3f0c5d0038fd811768b308bafde4d632c03ee81cc8ac9dc8583334
BLAKE2b-256 checksum
How to use checksums
940e5b3f37208189540ffc4648a841543393de7bd1451fcaaf21ede40b4e580c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.4.5

Release files / ldm-0.1.3-py2.7.egg

Download URL ldm-0.1.3-py2.7.egg
Size 11.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
02fdb035b3c2ef55fe1a08071ed3222c8d66e08a155a244d1420b604e757a458
BLAKE2b-256 checksum
How to use checksums
83f2d1d4101133442eb51da066a5b2c1cd379f663a330a429409d98688e3e3f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.4.5

Release files / ldm-0.1.3-py2-none-any.whl

Download URL ldm-0.1.3-py2-none-any.whl
Size 7.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
21eda2f2b22f851207a541cf51ef93cdd2adc060d07b4a1d260edbaf0be9ae9b
BLAKE2b-256 checksum
How to use checksums
20b5d43cac57883122588bf3d3e0a39f6cbe0c0ad8144fdd3bf61c6f2c21f863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.4.5

Release history Release notifications | RSS feed

This release

0.1.3 This release

3 release files

0.1.2

1 release file

0.1.1

3 release files

0.1.0

3 release files

0.0.9

3 release files

0.0.8

3 release files

0.0.7

3 release files

0.0.6

3 release files

0.0.5

3 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page