Пример #1
0
from pprint import pprint

from Detector import Detector

__author__ = 'Rik Smit ([email protected])'

projectDirectory = '/home/rik-target/owncloud-rixmit/Studie/Droneproject/dataset/cows/'
datasetIds = [
    'DJI_0005_cut_233-244',
    'DJI_0007_cut_22-65',
    'DJI_0081'
]

detector = Detector(projectDirectory, datasetIds)
detector.featureType = 'HSV-HIST'
detector.classifierType = 'SVM-RBF'


testtype = 'interset'  # or crossset
parameterOptions = { # lists of different parameter values that should be tested for the feature descriptors
    'channelsSet': [[0, 1, 2], [1], [0, 1]],
    'histSizeSet': [32, 8],
    'orientationsSet': [1, 2, 4, 8],
    'ppcSet': [8, 16, 32],
    'cpbSet': [2, 4, 8]
}
datasetIdx = 0  # used for interset (which set is tested on

classifierParameters = { # single paramters that are used for the classifier
    'C': [1],
    'gamma': [0.1],
Пример #2
0
from pprint import pprint

from Detector import Detector

__author__ = 'Rik Smit ([email protected])'

projectDirectory = '/home/rik-target/owncloud-rixmit/Studie/Droneproject/dataset/cows/'
datasetIds = ['DJI_0005_cut_233-244', 'DJI_0007_cut_22-65', 'DJI_0081']

detector = Detector(projectDirectory, datasetIds)
detector.featureType = 'HSV-HIST'
detector.classifierType = 'SVM-RBF'

runs = 20
for active in [True, False]:
    print("Testing (active=%s)" % active)
    results = None
    for run in range(runs):
        result = detector.activeLearningTest(
            active,
            datasetIdx=1)  # use dataset DJI_0007_cut_22-65 as it is big enough
        if not results:
            results = result
        else:
            results = [x + y for x, y in zip(results, result)]

    pprint([x / runs for x in results])