本文整理汇总了Python中Features.getRandomNegativeFeatures方法的典型用法代码示例。如果您正苦于以下问题:Python Features.getRandomNegativeFeatures方法的具体用法?Python Features.getRandomNegativeFeatures怎么用?Python Features.getRandomNegativeFeatures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Features
的用法示例。
在下文中一共展示了Features.getRandomNegativeFeatures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: import Features [as 别名]
# 或者: from Features import getRandomNegativeFeatures [as 别名]
detect = True
if len(sys.argv) > 1:
path = sys.argv[1]
currentFolder = os.getcwd()
if train == True:
print "Start reading positive images"
pos = Features.getPositiveFeatures(currentFolder+'\\PositiveImages')
print "Start reading negative images"
neg = Features.getRandomNegativeFeatures(currentFolder+'\\NegativeImages',2,size)
svm = TrainSVM.trainSVM(pos,neg)
neg = None
pos = None
TrainSVM.saveSVM(currentFolder+'\\SVMs','human.xml', svm)
if detect == True:
print 'Start detecting'
svm = DetectSVM.loadSVM(currentFolder +'\\SVMs','human.xml')
npImage = cv2.imread(currentFolder +'\\testImages\\test1-1.png',cv2.CV_LOAD_IMAGE_COLOR)
#npImage = cv2.imread(currentFolder +'\\testImages\\test.jpg',cv2.CV_LOAD_IMAGE_COLOR)
#detections = DetectSVM.detectHumansTest(npImage)