if __name__ == '__main__':

    size = [160,96] #x,y x=height y= width
    train = False
    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')