Exemplo n.º 1
0
def main():

    folder='./Results/'

    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    saveResultsFolder=list()

    bookChapter="/Users/Ivan/Documents/Papers/My_papers/Tracking_book_chapter/images"
    paper="/Users/Ivan/Documents/Papers/My_papers/CVPR_2016_Robust_tracking/images"

    #saveResultsFolder.append(bookChapter)
    saveResultsFolder.append(paper)
    save=True

    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)


    baseLineRun= folder+'upd=1_hogANDhist_int_f1'+".p"


    paperPlot=PaperPlots(dataset,folder)

    plotComparisonToOtherTrackers(dataset,saveResultsFolder,save)
    #plotFeatureKernel(paperPlot,saveResultsFolder,save)
    plotSensitivity(paperPlot, baseLineRun,saveResultsFolder,save)
def createSavedEvaluations(wildcard):
    wu2013results = "/Users/Ivan/Files/Results/Tracking/wu2013"
    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"

    vot2014Results = "/Users/Ivan/Files/Results/Tracking/vot2014"
    vot2014GrounTruth = "/Users/Ivan/Files/Data/vot2014"

    datasetType = 'wu2013'

    dataset = Dataset(wu2013GroundTruth, datasetType)

    #runsNames =['lambda_gray_s0_e0.4', 'lambda_gray_s0.2_e0.4',
    #        'lambda_gray_s0.3_e0.3', 'lambda_gray_s0.4_e0.4', 'lambda_gray_s0.5_e0.3']

    runsNames = list()
    for i in range(0, len(runsNames)):
        runsNames[i] = './Runs/' + runsNames[i] + ".p"
    runs = list()
    runsNames = glob.glob('./Runs/' + wildcard + '*.p')
    #
    names = list()
    for runName in runsNames:
        run = loadPickle(runName)
        names.append(runName)
        print runName
        runs.append(run)

    evaluator = EvaluatorAllExperiments(dataset, runs, names)

    strSave = './Results/'

    evaluator.calculateMetricsAndSave(strSave)
Exemplo n.º 3
0
def customParameter():

    folder='./Results/'

    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    saveResultsFolder=list()

    bookChapter="/Users/Ivan/Documents/Papers/My_papers/Tracking_book_chapter/images"
    paper="/Users/Ivan/Documents/Papers/My_papers/Tracking_with_Robust_Kalman/images"

    saveResultsFolder.append(bookChapter)
    saveResultsFolder.append(paper)



    save=False

    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)


    baseLineRun= folder+'upd=3_hogANDhist_int_f1'+".p"


    paperPlot=PaperPlots(dataset,folder)

    #plotComparisonToOtherTrackers(dataset,saveResultsFolder,save)
    #plotFeatureKernel(paperPlot,saveResultsFolder,save)
    plotParameter(paperPlot, baseLineRun,saveResultsFolder,save, parameter='lambda')
def compareDefaultPlots(wildcard="lambda_SE"):
    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)
    runsNames = glob.glob("./Runs/" + wildcard + "*.p")

    formatSave='pdf'

    regexp= re.compile("(.*\/)(.+)(.p)")
    #s0_e0.2
    #s0_e0.5
    #s0.1_e0.3
    #s0.2_e0.2
    #s0.3_e0.4
    d=dict()
    runs=list()
    for runName in runsNames:
        m=re.match(regexp,runName)
        name=m.group(2)
        print name
        run = loadPickle(runName)
        run.trackerLabel=runName
        run.data['TRE'].data=[]
        run.data['SRE'].data=[]
        d[runName] = run
        runs.append(run)
    evaluator = Evaluator(dataset, runs)
    evaluator.evaluateSingleTracker(runs[0])
def generateAllVizualiations():

    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    folderForGraphs='./Visualizations/'
    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)
    runsNames = glob.glob('./Runs/upd=3*.p')
    runsNames =['lambda_nonorm_s0_e0.5', 'lambda_nonorm_s0.2_e0.2',
                'lambda_nonorm_s0.3_e0.4', 'lambda_nonorm_s0.4_e0.4', 'lambda_nonorm_s0.5_e0.3']


    #runsNames =['lambda_SE_s0_e0.2', 'lambda_SE_s0_e0.5',
    #            'lambda_SE_s0.1_e0.3', 'lambda_SE_s0.2_e0.2', 'lambda_SE_s0.3_e0.4']

    for i in range(0,len(runsNames)):
        runsNames[i]="./Runs/"+runsNames[i]+".p"
    formatSave='pdf'

    regexp= re.compile("(.*\/)(.+)(.p)")


    for runName in runsNames:



        m=re.match(regexp,runName)

        name=m.group(2)
        print name
        run = loadPickle(runName)
        viz = VisualizeAllExperiments(dataset, run)
        viz.barplot(savefile=folderForGraphs+name+"."+ formatSave)
Exemplo n.º 6
0
def main(argv=None):
    if argv is None:
        argv = sys.argv


    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"

    datasetType = 'wu2013'



    runName = './Runs/lambda=0.1_hogANDhist_int_f1.p'

    run=loadPickle(runName)

    #print run

    experimenType='default'
    run=run.data[experimenType]
    #
    vidName='jogging-2'

    dataset = Dataset(wu2013GroundTruth, datasetType)


    viz=VisualizeExperiment(dataset,run)

    #viz.show(vidName, experimenType)

    #viz.barplot()
    viz.precisionAndSuccessPlot(vidName)
Exemplo n.º 7
0
def robustKalman():
    savefilename = "/Users/Ivan/Documents/Papers/My_papers/CVPR_2016_Robust_tracking/images/"
    format = 'png'

    folder = './Results/'

    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    saveResultsFolder = list()

    bookChapter = "/Users/Ivan/Documents/Papers/My_papers/Tracking_book_chapter/images"
    paper = "/Users/Ivan/Documents/Papers/My_papers/CVPR_2016_Robust_tracking/images"

    #saveResultsFolder.append(bookChapter)
    saveResultsFolder.append(paper)
    save = True

    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)
    paperPlot = PaperPlots(dataset, folder)

    # this has to changeop
    baseLineRun = folder + 'Rob_Struck_filter_f0' + ".p"

    plotOPE_SRE_TRE_Robust(saveFigureToFolder=savefilename, format='pdf')
    plotSensitivity(paperPlot, baseLineRun, saveResultsFolder, save)
Exemplo n.º 8
0
def plot_OPE_comparison():
    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)

    (runsNames, corrected_names) = getRunsForCVPR2016()

    runs = list()
    names = list()
    for runName in runsNames:
        run = loadPickle(runName)
        names.append(runName)
        runs.append(run)

    plotMetricsDict = dict()
    completeMetricDict = dict()

    alternativeNames = corrected_names
    if len(alternativeNames) == 0:
        for r in runs:
            plotMetricsDict[r.name] = r.plotMetricsDictEntry
            completeMetricDict[r.name] = r.completeMetricDictEntry
    else:
        for r, name in zip(runs, alternativeNames):
            plotMetricsDict[name] = r.plotMetricsDictEntry
            completeMetricDict[name] = r.completeMetricDictEntry

    success = list()
    precision = list()
    names = list()
    import re
    for name, value in plotMetricsDict.iteritems():
        s = value['default'][5]
        p = value['default'][4]
        success.append(s)
        precision.append(p)
        if "ObjStruck with " in name:
            short_name = re.sub("ObjStruck with ", '', name)
        else:
            short_name = name
        names.append(short_name)

    df = pd.DataFrame({
        'name': names,
        'success': success,
        'precision': precision
    })
    print df

    sns.set_style("whitegrid")
    plt.subplots_adjust(bottom=0.4)
    ax = sns.barplot(x="name", y="success", data=df, palette="Blues_d")
    locs, labels = plt.xticks()
    plt.setp(labels, rotation=-45)

    plt.show()
def main():
    wu2013GroundTruth = "/Users/Ivan/Files/Data/Tracking_benchmark"
    datasetType = 'wu2013'

    dataset = Dataset(wu2013GroundTruth, datasetType)
    d = dataset.dictData

    maxCpus = 4
    obj = ObjectnessBoxesEvaluator(dataset, cpus=maxCpus)

    obj.evaluate()
Exemplo n.º 10
0
def plotOPE_SRE_TRE_Robust(
        saveFigureToFolder='/Users/Ivan/Code/Tracking/Antrack/doc/technical_reports/images/',
        format='png'):
    wu2013results = "/Users/Ivan/Files/Results/Tracking/wu2013"
    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"

    vot2014Results = "/Users/Ivan/Files/Results/Tracking/vot2014"
    vot2014GrounTruth = "/Users/Ivan/Files/Data/vot2014"

    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)

    (runsNames, corrected_names) = getRunsForCVPR2016_robust()

    runs = list()
    names = list()
    for runName in runsNames:
        run = loadPickle(runName)
        names.append(runName)
        #run = run.data[experimentType]
        runs.append(run)

    # run=loadPickle('./Runs/TLD.p')
    # runs.append(run)
    # names.append('./Runs/TLD.p')

    save = True
    evaluator = EvaluatorAllExperiments(dataset, list(), names)

    successAndPrecision = 'cvpr2016_SuccessAndPrecision_wu2013'
    histograms = 'cvpr2016_histogram_wu2013'

    i = format
    if save:
        evaluator.evaluateFromSave(
            runs,
            successAndPrecisionPlotName=saveFigureToFolder +
            successAndPrecision + '.' + i,
            histogramPlot=saveFigureToFolder + histograms + '.' + i,
            alternativeNames=corrected_names)
    else:
        evaluator.evaluateFromSave(runs, alternativeNames=corrected_names)
Exemplo n.º 11
0
def generateDefaultVizualiations(wildcard):

    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    folderForGraphs='./Visualizations/'
    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)
    runsNames = glob.glob("./Runs/" + wildcard + "*.p")
    #runsNames = glob.glob('./Runs/upd=3_hogANDhist_int*.p')
    formatSave='pdf'

    regexp= re.compile("(.*\/)(.+)(.p)")


    for runName in runsNames:
        m=re.match(regexp,runName)

        name=m.group(2)
        print name
        run = loadPickle(runName)

        run.data['TRE'].data=[]
        run.data['SRE'].data=[]
        viz = VisualizeAllExperiments(dataset, run)
        viz.barplotDefault(savefile=folderForGraphs+name+"."+ formatSave)
Exemplo n.º 12
0
def main(argv=None):
    if argv is None:
        argv = sys.argv

    wu2013GroundTruth = "/Users/Ivan/Files/Data/Tracking_benchmark"

    datasetType = 'wu2013'
    experimentType='default'

    runName = './Runs/a28_hist_int_f1.p'

    run = loadPickle(runName)

    # print run

    vidName = 'basketball'

    dataset = Dataset(wu2013GroundTruth, datasetType)

    viz = VisualizeAllExperiments(dataset, run)

    #viz.precisionAndSuccessPlot()
    # exp1=run.data['default']
    #
    # vizOne=VisualizeExperiment(dataset,exp1)
    #
    # vizOne.precisionAndSuccessPlot(vidName)

    #viz.show(vidName,experimentRunNumber=0,experiment='default')
    #viz.show(vidName,100)


    runsNames = glob.glob('./Runs/*.p')

    for r in runsNames:
        print r
    createSavedEvaluations(wildcard)

    wu2013results = "/Users/Ivan/Files/Results/Tracking/wu2013"
    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"

    vot2014Results = "/Users/Ivan/Files/Results/Tracking/vot2014"
    vot2014GrounTruth = "/Users/Ivan/Files/Data/vot2014"

    datasetType = 'wu2013'
    # Note: in wu2013 i

    # trackerLabel="STR+f_hog"

    # wildcard = sys.argv[1]

    dataset = Dataset(wu2013GroundTruth, datasetType)

    runsNames = glob.glob('./Results/' + wildcard + '*.p')
    runsNames = getRunsForCVPR2016()

    #runsNames = ['SAMF', 'Kernelized_filter', 'fk_hist_int_f0', 'fk_hist_int_f1','TLD']
    runs = list()
    #
    names = list()
    for runName in runsNames:

        #runName= './Results/' + runName + '.p'
        run = loadPickle(runName)
        names.append(runName)
        print runName
        #run = run.data[experimentType]
Exemplo n.º 14
0
def plotStraddelingEdgeOPE(wildcard, savefilename='', format='pdf'):
    wu2013GroundTruth = "/Users/Ivan/Files/Data/wu2013"
    folderForGraphs = './Visualizations/'
    datasetType = 'wu2013'
    dataset = Dataset(wu2013GroundTruth, datasetType)
    runsNames = glob.glob("./Results/" + wildcard + "*.p")
    #runsNames = glob.glob('./Runs/upd=3_hogANDhist_int*.p')
    formatSave = 'pdf'
    regexp = re.compile("(.*\/)(.+)(.p)")

    experimentType = 'default'

    d = dict()
    for runName in runsNames:
        m = re.match(regexp, runName)
        name = m.group(2)
        run = loadPickle(runName)
        results = run.plotMetricsDictEntry['default']
        d[name] = results[4:6]

    (df1, df2) = reshuffleStraddlingEdgeOPEData(d)

    save = False
    # Initialize a grid of plots with an Axes for each walk
    grid = sns.FacetGrid(df1,
                         col="$\lambda_e$",
                         hue="$\lambda_e$",
                         col_wrap=3,
                         size=3)

    # Draw a horizontal line to show the starting point
    grid.map(plt.axhline, y=0.749, ls=":", c=".5")

    # Draw a line plot to show the trajectory of each random walk
    grid.map(plt.plot, "$\lambda_s$", "Precision", marker="o", ms=4)
    grid.set(xticks=np.arange(6) / float(10),
             yticks=[0.6, 0.65, 0.7, 0.75, 0.8, 0.85],
             xlim=(0, 0.5),
             ylim=(0.6, 0.85))
    grid.fig.tight_layout(w_pad=1)
    # Adjust the tick positions and labels

    if savefilename == '':
        plt.show()
    else:
        plt.savefig(savefilename + "precision." + format)

    grid = sns.FacetGrid(df2,
                         col="$\lambda_e$",
                         hue="$\lambda_e$",
                         col_wrap=3,
                         size=3)
    grid.map(plt.axhline, y=0.59, ls=":", c=".5")
    grid.map(plt.plot, "$\lambda_s$", "Success", marker="o", ms=4)
    grid.set(xticks=np.arange(6) / float(10),
             yticks=[0.5, 0.55, 0.6, 0.65, 0.7],
             xlim=(0, 0.5),
             ylim=(0.5, 0.7))
    grid.fig.tight_layout(w_pad=1)

    if savefilename == '':
        plt.show()
    else:
        plt.savefig(savefilename + "success." + format)