15 cs_command += ' -w 19 -h 19' 16 print cs_command 17 os.system(cs_command) 18
19 nonface_dir_list = os.listdir('testtrain/non-face') 20 nonface_dir = 'testtrain/non-face/' 21 nonface_file = file('nonface.idx','w') 22 for i in range(0,len(nonface_dir_list)):
23 nonface_dir_list[i] = nonface_dir + nonface_dir_list[i] 24 if len(nonface_dir_list) - 1 != i: 25 nonface_dir_list[i] += '\\n'
26 nonface_file.write(nonface_dir_list[i]) 27 nonface_file.close() 28
29 ht_command = 'Haartrain.exe -data my_face_classifier -vec face.vec -w 19 -h 19 -bg nonface.idx -nstages 5 -nsplits 3 -minhitrate 0.999 -maxfalsealarm 0.5 -mem 2000 -eqw 1 -mode ALL -bt GAB -npos ' 30 ht_command += '%d'%len(face_dir_list) 31 ht_command += ' -nneg '
32 ht_command += '%d'%len(nonface_dir_list) 33 print ht_command 34 os.system(ht_command)