Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/train-object-classification.py @ 522:ce40a89bd6ae
added functions for classification refactored from Sohail s work for TRB/TRC (to be tested)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 18 Jun 2014 23:36:56 -0400 |
| parents | 4ad5123d969e |
| children | da1352b89d02 |
comparison
equal
deleted
inserted
replaced
| 521:3707eeb20f25 | 522:ce40a89bd6ae |
|---|---|
| 4 import sys, argparse | 4 import sys, argparse |
| 5 from cv2 import SVM_RBF, SVM_C_SVC | 5 from cv2 import SVM_RBF, SVM_C_SVC |
| 6 | 6 |
| 7 import cvutils, moving, ml | 7 import cvutils, moving, ml |
| 8 | 8 |
| 9 | |
| 10 # todo update with argparse | |
| 11 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') | 9 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') |
| 12 parser.add_argument('-d', dest = 'directoryName', help = 'parent directory name for the directories containing the samples for the different road users', required = True) | 10 parser.add_argument('-d', dest = 'directoryName', help = 'parent directory name for the directories containing the samples for the different road users', required = True) |
| 13 parser.add_argument('--kernel', dest = 'kernelType', help = 'kernel type for the support vector machine (SVM)', default = SVM_RBF, type = long) | 11 parser.add_argument('--kernel', dest = 'kernelType', help = 'kernel type for the support vector machine (SVM)', default = SVM_RBF, type = long) |
| 14 parser.add_argument('--svm', dest = 'svmType', help = 'SVM type', default = SVM_C_SVC, type = long) | 12 parser.add_argument('--svm', dest = 'svmType', help = 'SVM type', default = SVM_C_SVC, type = long) |
| 15 parser.add_argument('-s', dest = 'rescaleSize', help = 'rescale size of image samples', default = 64, type = int) | 13 parser.add_argument('-s', dest = 'rescaleSize', help = 'rescale size of image samples', default = 64, type = int) |
