Menu

[r8989]: / trunk / py4science / examples / faces / faces.py  Maximize  Restore  History

Download this file

31 lines (20 with data), 691 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
"""Simple testing script for imatch.py"""
import pylab as P
import imatch, imatch2
from imtools import ImageCollection
classifier = imatch2.FaceClassifier('data_train/')
classifier.truncate_idx = 12
imtest = ImageCollection.from_directory('data_test/')
i0 = imtest.images[0]
i1 = imtest.images[1]
classifier.verify(classifier.image_coll.images[0],0)
classifier.verify(classifier.image_coll.images[0],1)
classifier.identify(imtest.images[0])
classifier.identify(classifier.image_coll.images[1])
classifier.verify(imtest.images[0],13)
classifier.verify(imtest.images[0],37)
classifier.plot_eigenfaces()
classifier.plot_sigma()
classifier.decompose(i0)
P.show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.