Ejemplo n.º 1
0
kernel = 'rbf'
gamma = 0.0012
C = 250
experience = '2018'
positiveCsvFileName = 'hard-video.csv'
negativeCsvFileName = 'easy-video.csv'
path = './result/{0}/{1}/g{2}/c{3}'.format(experience, dir_name, gamma, C)
dicimate = 4

mil = MIL(method=method,
          experience=experience,
          dirName=dir_name,
          estimatorName='misvm')
mil.setData(positiveCsvFileName=positiveCsvFileName,
            negativeCsvFileName=negativeCsvFileName,
            saveMotionTmplate=False,
            dicimate=dicimate,
            videoExtension='mp4',
            csvExtension='csv')
#mil.importCsv2Feature(positiveCsvFileName, negativeCsvFileName, dicimate, data='all')


def main():  # read hard and easy
    estimator = misvm.miSVM(kernel=kernel,
                            gamma=gamma,
                            C=C,
                            verbose=True,
                            max_iters=100)
    #estimator = misvm.miPSVM(feature=kernel, gamma=gamma, C=C, verbose=True, max_iters=100, n_components=36*3, sparse=['P'])
    mil.train(estimator=estimator, resultSuperDirPath=path)

Ejemplo n.º 2
0
kernel = 'rbf'
gamma = 0.0012
C = 1000
sample_num_per_label = 0
experience = '2018'
path = './result/{0}/{1}/g{2}/c{3}'.format(experience, dir_name, gamma, C)
dicimate = 4
person = []

mil = MIL(method=method,
          experience=experience,
          dirName=dir_name,
          estimatorName='MISVM')
mil.setData(positiveCsvFileName='easy-video.csv',
            negativeCsvFileName='hard-video.csv',
            saveMotionTmplate=False,
            dicimate=4,
            videoExtension='mp4',
            csvExtension='csv')


def main():  # read hard and easy
    estimator = misvm.MISVM(kernel=kernel,
                            gamma=gamma,
                            C=C,
                            verbose=True,
                            max_iters=100)
    mil.train(estimator=estimator, resultSuperDirPath=path)


def check_identification_func_max():
    bags, labels, csvnamelist = mil.bags, mil.labels, mil.csvFilePaths