parser.add_argument('-l',default='exp',dest="loss_type",type=str,choices={'log','exp'},help="The type of the loss function. Logit and Exponential functions are the avaliable options")
parser.add_argument('-s',default='indep',dest="selection_type",choices={'indep','shared'},type=str,help="The feature selection type for the LUT based trainer. For multivarite case the features can be selected by sharing or independently ")
parser.add_argument('-n',default=256,dest="num_entries",type=int,help="The number of entries in the LookUp table. It is the range of the feature values, e.g. if LBP features are used this values is 256.")
parser.add_argument('-f',default='lbp',dest="feature_type",type=str,choices={'lbp','dlbp','tlbp','mlbp'},help="The type of block based feature to be extracted from the images.")
parser=argparse.ArgumentParser(description=" The arguments for the boosting. ")
parser.add_argument('-t',default='LutTrainer',dest="trainer_type",type=str,choices={'StumpTrainer','LutTrainer'},help="This is the type of trainer used for the boosting.")
parser.add_argument('-r',default=20,dest="num_rnds",type=int,help="The number of round for the boosting")
parser.add_argument('-l',default='exp',dest="loss_type",type=str,choices={'log','exp'},help="The type of the loss function. Logit and Exponential functions are the avaliable options")
parser.add_argument('-s',default='indep',dest="selection_type",choices={'indep','shared'},type=str,help="The feature selection type for the LUT based trainer. For multivarite case the features can be selected by sharing or independently ")
...
...
@@ -55,7 +54,7 @@ def main():
# Initilize the trainer with 'LutTrainer' or 'StumpTrainer'
"""The test script to perform the binary classification on the digits from the MNIST dataset.
The MNIST data is exported using the xbob.db.mnist module which provide the train and test
partitions for the digits. Block based LBP type (LBP, tLBP, mLBP) features are captured and the
available algorithms for classification is Lut based Boosting.
"""
importxbob.db.mnist
importnumpy
importsys,getopt
importargparse
importstring
from..featuresimportlocal_feature
from..coreimportboosting
importmatplotlib.pyplot
defmain():
parser=argparse.ArgumentParser(description=" The arguments for the boosting. ")
parser.add_argument('-r',default=20,dest="num_rnds",type=int,help="The number of round for the boosting")
parser.add_argument('-l',default='exp',dest="loss_type",type=str,choices={'log','exp'},help="The type of the loss function. Logit and Exponential functions are the avaliable options")
parser.add_argument('-s',default='indep',dest="selection_type",choices={'indep','shared'},type=str,help="The feature selection type for the LUT based trainer. For multivarite case the features can be selected by sharing or independently ")
parser.add_argument('-n',default=256,dest="num_entries",type=int,help="The number of entries in the LookUp table. It is the range of the feature values, e.g. if LBP features are used this values is 256.")
parser.add_argument('-f',default='lbp',dest="feature_type",type=str,choices={'lbp','mlbp','tlbp','dlbp'},help="The type of LBP features to be extracted from the image to perform the classification. The features are extracted from the block of varying scales")
parser.add_argument('-sy',default=4,dest="scale_y",type=int,help="The maximum scale for the block feature extraction along the y direction.")
parser.add_argument('-sx',default=4,dest="scale_x",type=int,help="The maximum scale for the block feature extraction along the x direction.")
args=parser.parse_args()
# download the dataset
db_object=xbob.db.mnist.Database()
# Hardcode the number of digits and the image size
num_digits=10
img_size=28
# get the data (features and labels) for the selected digits from the xbob_db_mnist class functions
"""The test script to perform the binary classification on the digits from the MNIST dataset.
"""The test script to perform the multivariate classification on the digits from the MNIST dataset.
The MNIST data is exported using the xbob.db.mnist module which provide the train and test
partitions for the digits. Pixel values of grey scale images are used as features and the
available algorithms for classification are Lut based Boosting and Stump based Boosting.
The script test digits provided by the command line. Thus it conducts only one binary classifcation test.
partitions for the digits. LBP features are extracted and the available algorithms for
classification is Lut based Boosting.
"""
...
...
@@ -15,9 +13,11 @@ import numpy
importsys,getopt
importargparse
importstring
importbob
from..utilimportconfusion
from..featuresimportlocal_feature
from..coreimportboosting
importmatplotlib.pyplotasmpl
importmatplotlib.pyplot
defmain():
...
...
@@ -27,100 +27,87 @@ def main():
parser.add_argument('-l',default='exp',dest="loss_type",type=str,choices={'log','exp'},help="The type of the loss function. Logit and Exponential functions are the avaliable options")
parser.add_argument('-s',default='indep',dest="selection_type",choices={'indep','shared'},type=str,help="The feature selection type for the LUT based trainer. For multivarite case the features can be selected by sharing or independently ")
parser.add_argument('-n',default=256,dest="num_entries",type=int,help="The number of entries in the LookUp table. It is the range of the feature values, e.g. if LBP features are used this values is 256.")
parser.add_argument('-f',default='lbp',dest="feature_type",type=str,choices={'lbp','mlbp','tlbp','dlbp'},help="The type of LBP features to be extracted from the image to perform the classification. The features are extracted from the block of varying scales")
parser.add_argument('-d',default=10,dest="num_digits",type=int,help="The number of digits to be considered for classification.")
args=parser.parse_args()
# download the dataset
db_object=xbob.db.mnist.Database()
# Hardcode the number of digits and the image size
num_digits=10
num_digits=args.num_digits
img_size=28
# get the data (features and labels) for the selected digits from the xbob_db_mnist class functions