Open patrickdaulie opened 9 years ago
how do you solve this ?
-
Can you show the code that is giving the error ?:
from SimpleCV import * import time
cam = Camera(1) # camera names = ['Alice','Bob'] # names of people to recognize outfile = "test.csv" #output file waitTime = 10 # how long to wait between each training session f = FaceRecognizer() def getFaceSet(cam,myStr=""):
# quit when we press escape.
iset = ImageSet()
count = 0
disp = Display((640,480))
while disp.isNotDone():
img = cam.getImage()
fs = img.findHaarFeatures('face')
if( fs is not None ):
fs = fs.sortArea()
face = fs[-1].crop().resize(100,100)
fs[-1].draw()
iset.append(face)
count = count + 1
img.drawText(myStr,20,20,color=Color.RED,fontsize=32)
img.save(disp)
disp.quit()
return iset
getFaceSet(cam,"Get Camera Ready! - ESC to Exit") time.sleep(5) labels = [] imgs = []
for name in names: myStr = "Training for : " + name iset = getFaceSet(cam,myStr) imgs += iset labels += [name for i in range(0,len(iset))] time.sleep(waitTime)
f = FaceRecognizer() print f.train(imgs, labels) f.save(outfile)
disp = Display((640,480)) while disp.isNotDone(): img = cam.getImage() fs = img.findHaarFeatures('face') if( fs is not None ): fs = fs.sortArea() face = fs[-1].crop().resize(100,100) fs[-1].draw() name, confidence = f.predict(face) img.drawText(name,30,30,fontsize=64) img.save(disp)
2nd Floor, Shrinath Complex, Near Bank of Baroda, Sahakar Nagar, Dargah Road, Aurangabad - 431001 Office :- 0240-6007600 ,7350724257
On Fri, Mar 20, 2015 at 2:25 AM, Rodrigo Gomes notifications@github.com wrote:
-
what operating system are you using?
you are using SimpleCV1.3 or SimpleCV2.0?
What OpenCV version are you using?
Can you show the code that is giving the error ?:
— Reply to this email directly or view it on GitHub https://github.com/sightmachine/SimpleCV/issues/663#issuecomment-83757942 .
Hiii
what operating system are you using? -- Windows - 7 - home
you are using SimpleCV1.3 or SimpleCV2.0? --simplecv1.3 superpack
What OpenCV version are you using? its come with simplecv1.3 superpack it seems 2.3
Can you show the code that is giving the error ?: from SimpleCV import * import time
cam = Camera(1) # camera names = ['Alice','Bob'] # names of people to recognize outfile = "test.csv" #output file waitTime = 10 # how long to wait between each training session f = FaceRecognizer() def getFaceSet(cam,myStr=""):
# quit when we press escape.
iset = ImageSet()
count = 0
disp = Display((640,480))
while disp.isNotDone():
img = cam.getImage()
fs = img.findHaarFeatures('face')
if( fs is not None ):
fs = fs.sortArea()
face = fs[-1].crop().resize(100,100)
fs[-1].draw()
iset.append(face)
count = count + 1
img.drawText(myStr,20,20,color=Color.RED,fontsize=32)
img.save(disp)
disp.quit()
return iset
getFaceSet(cam,"Get Camera Ready! - ESC to Exit") time.sleep(5) labels = [] imgs = []
for name in names: myStr = "Training for : " + name iset = getFaceSet(cam,myStr) imgs += iset labels += [name for i in range(0,len(iset))] time.sleep(waitTime)
f = FaceRecognizer() print f.train(imgs, labels) f.save(outfile)
disp = Display((640,480)) while disp.isNotDone(): img = cam.getImage() fs = img.findHaarFeatures('face') if( fs is not None ): fs = fs.sortArea() face = fs[-1].crop().resize(100,100) fs[-1].draw() name, confidence = f.predict(face) img.drawText(name,30,30,fontsize=64) img.save(disp)
this algorithm worked perfectly for me!
just by replacing img.findHaarFeatures ('face')
by img.findHaarFeatures ('face.xml')
but I have some recommendations that might help you. Recently I noticed a similar problem, and is probably your SimpleCV SuperPack is outdated, due to a considerable number of people are having trouble installing SimpleCV, I developed a new auto installer, but for it to work you must do some things before:
1 in its algorithm replace all img.findHaarFeatures('face')
by img.findHaarFeatures('face.xml')
2 - uninstall python and any library related to it, scipy, numpy, opencv etc, let the free windows python.
3 while the installation software is running do not move the machine, including the mouse!
here is the link:
windowsXP, 7,8,8.1
Just click SimpleCVAutoInstall.exe, and wait for the installation.
I'm waiting for your feedback.
sorry, my english is not very good, thanks.
Hello,
I'm Facing The Same Problem. I'm Using: Ubuntu 14.04LTS 32 BIT Python 2.7.6 SimpleCV 2 OpenCV 2 I'm Using Laptop Camera
Code: from SimpleCV import * import time cam = Camera(0) names = ['Jubayer','Disty'] outfile = "test.csv" waitTime = 10
def getFaceSet(cam,myStr=""): iset = ImageSet() count = 0 disp = Display((640,480)) while disp.isNotDone(): img = cam.getImage() fs = img.findHaarFeatures('face') if( fs is not None ): fs = fs.sortArea() face = fs[-1].crop().resize(100,100) fs[-1].draw() iset.append(face) count = count + 1 img.drawText(myStr,20,20,color=Color.RED,fontsize=32) img.save(disp) disp.quit() return iset
getFaceSet(cam,"Get Camera Ready! - ESC to Exit") time.sleep(5) labels = [] imgs = []
for name in names: myStr = "Training for : " + name iset = getFaceSet(cam,myStr) imgs += iset labels += [name for i in range(0,len(iset))] time.sleep(waitTime)
f = FaceRecognizer() print f.train(imgs, labels) f.save(outfile)
disp = Display((640,480)) while disp.isNotDone(): img = cam.getImage() fs = img.findHaarFeatures('face') if( fs is not None ): fs = fs.sortArea() face = fs[-1].crop().resize(100,100) fs[-1].draw() name, confidence = f.predict(face) img.drawText(name,30,30,fontsize=64)
Error Showing:
Python 2.7.6 (default, Mar 22 2014, 22:59:38) [GCC 4.8.2] on linux2 Type "copyright", "credits" or "license()" for more information.
================================ RESTART ================================
Traceback (most recent call last):
File "/home/jubayer/Desktop/F4/SimpleCV/examples/detection/TrainFacialRecognition.py", line 46, in
Any Help Please :/
Thanks Jubayer
Hello Rodrigo i follow your complete instruction then i found my system still download the CV version 2.3..
and as i found the facerecognizer is available in 2.4 and above
so i manually install the 2.4 version , update the path in system PATH and PYTHONPATH with new 2.4 ..vc10 address.
but now system gives error -
Traceback (most recent call last):
File "D:\simplecv\facedet\facetrain.py", line 1, in
OK I Updated All Like OpenCV And SampleCV Now Its Working But When I Trained 2 Face And After That When It Search For The Face Its Giving This Error ....Any Help Please ? :)
Traceback (most recent call last):
File "/home/jubayer/Desktop/SimpleCV-master/SimpleCV/examples/detection/TrainFacialRecognition.py", line 56, in
@jrahman10 in the line names = ['Jubayer','Disty']
contain two names in list?
@jrahman10 FaceRecognize does not allow you, use only a one face
for more help, please ask in http://help.simplecv.org
@administradorx Yes I Used Two Name Still Not Working With Those Error :/
Rodrigo Gomes
finally the auto install work properly on windows 7- the problem was python registry was not removed from windows . its now perfectly working on windows 7.
i want similar type of setup or guideline for installation on RPI please help
2nd Floor, Shrinath Complex, Near Bank of Baroda, Sahakar Nagar, Dargah Road, Aurangabad - 431001 Office :- 0240-6007600 ,7350724257
On Mon, Apr 13, 2015 at 12:10 AM, jrahman10 notifications@github.com wrote:
@administradorx https://github.com/administradorx Yes I Used Two Name Still Not Working With Those Error :/
— Reply to this email directly or view it on GitHub https://github.com/sightmachine/SimpleCV/issues/663#issuecomment-92099344 .
Hi,
The camera window shows the image, but when the procudure is executed there is an error : Output of the script :
ERROR: Traceback (most recent call last): File "TrainFacialRecognition.py", line 46, in
f = FaceRecognizer()
NameError: name 'FaceRecognizer' is not defined
Exception in thread Thread-1 (most likely raised during interpreter shutdown):