From da789d1bfdb9101bafd8526fd760024d8bdc76a3 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 28 Aug 2022 15:37:45 +0200 Subject: [PATCH] added avist evaluation scripts --- pytracking/analysis/extract_results.py | 4 +- pytracking/analysis/plot_results.py | 7 +- .../notebooks/analyze_avist_results.ipynb | 142 ++++++++++++++++++ 3 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 pytracking/notebooks/analyze_avist_results.ipynb diff --git a/pytracking/analysis/extract_results.py b/pytracking/analysis/extract_results.py index c54cfbd6..fb793bfa 100644 --- a/pytracking/analysis/extract_results.py +++ b/pytracking/analysis/extract_results.py @@ -75,9 +75,9 @@ def calc_seq_err_robust(pred_bb, anno_bb, dataset, target_visible=None): if target_visible is not None: target_visible = target_visible.bool() - valid = ((anno_bb[:, 2:] > 0.0).sum(1) == 2) & target_visible + valid = ((anno_bb > 0.0).sum(1) == 4) & target_visible else: - valid = ((anno_bb[:, 2:] > 0.0).sum(1) == 2) + valid = ((anno_bb > 0.0).sum(1) == 4) err_center = calc_err_center(pred_bb, anno_bb) err_center_normalized = calc_err_center(pred_bb, anno_bb, normalized=True) diff --git a/pytracking/analysis/plot_results.py b/pytracking/analysis/plot_results.py index f75cb3d0..50708671 100644 --- a/pytracking/analysis/plot_results.py +++ b/pytracking/analysis/plot_results.py @@ -26,7 +26,12 @@ def get_plot_draw_styles(): {'color': (0.6, 0.3, 0.9), 'line_style': '-'}, {'color': (0.4, 0.7, 0.1), 'line_style': '-'}, {'color': (0.2, 0.1, 0.7), 'line_style': '-'}, - {'color': (0.7, 0.6, 0.2), 'line_style': '-'}] + {'color': (0.7, 0.6, 0.2), 'line_style': '-'}, + {'color': (255.0 / 255.0, 102.0 / 255.0, 102.0 / 255.0), 'line_style': '-'}, + {'color': (153.0 / 255.0, 255.0 / 255.0, 153.0 / 255.0), 'line_style': '-'}, + {'color': (102.0 / 255.0, 102.0 / 255.0, 255.0 / 255.0), 'line_style': '-'}, + {'color': (255.0 / 255.0, 192.0 / 255.0, 203.0 / 255.0), 'line_style': '-'}, + ] return plot_draw_style diff --git a/pytracking/notebooks/analyze_avist_results.ipynb b/pytracking/notebooks/analyze_avist_results.ipynb new file mode 100644 index 00000000..182c9a28 --- /dev/null +++ b/pytracking/notebooks/analyze_avist_results.ipynb @@ -0,0 +1,142 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Generating Results on Datasets\n", + "\n", + "Please download the results from [here](https://drive.google.com/open?id=1Sacgh5TZVjfpanmwCFvKkpnOA7UHZCY0) and the AVisT dataset from [here](https://sites.google.com/view/avist-benchmark) and adapt the file `pytracking/evaluation/local.py`." + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2\n", + "%matplotlib inline\n", + "import sys\n", + "import matplotlib.pyplot as plt\n", + "plt.rcParams['figure.figsize'] = [14, 8]\n", + "\n", + "sys.path.append('../..')\n", + "from pytracking.analysis.plot_results import plot_results, print_results\n", + "from pytracking.evaluation import get_dataset, trackerlist" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "trackers = []\n", + "trackers.extend(trackerlist('atom', 'default', range(0, 5), 'ATOM'))\n", + "trackers.extend(trackerlist('dimp', 'dimp18', range(0,5), 'DiMP18'))\n", + "trackers.extend(trackerlist('dimp', 'dimp50', range(0, 5), 'DiMP-50'))\n", + "trackers.extend(trackerlist('dimp', 'prdimp18', range(0, 5), 'PrDiMP-18'))\n", + "trackers.extend(trackerlist('dimp', 'prdimp50', range(0, 5), 'PrDiMP-50'))\n", + "trackers.extend(trackerlist('dimp', 'super_dimp', range(0, 5), 'Super DiMP'))\n", + "trackers.extend(trackerlist('kys', 'default', range(0, 5), 'KYS'))\n", + "trackers.extend(trackerlist('tomp', 'tomp101', 0, 'ToMP-101'))\n", + "trackers.extend(trackerlist('tomp', 'tomp50', 0, 'ToMP-50'))\n", + "trackers.extend(trackerlist('keep_track', 'default_fast', range(0, 5), 'KeepTrack'))\n", + "trackers.extend(trackerlist('alpha_refine', 'super_dimp_seg_refine_box', range(0, 5), 'AlphaRefine'))\n", + "trackers.extend(trackerlist('stark_st', 'baseline_R101', None, 'STARK-ST-101'))\n", + "trackers.extend(trackerlist('stark_st', 'baseline', None, 'STARK-ST-50'))\n", + "trackers.extend(trackerlist('transt', 'transt50', None, 'TransT'))\n", + "trackers.extend(trackerlist('mixformer_online', 'baseline', None, 'MixFormer-22k'))\n", + "trackers.extend(trackerlist('mixformer_online', 'baseline_1k', None, 'MixFormer-1k'))\n", + "trackers.extend(trackerlist('mixformer_online', 'baseline_large', None, 'MixFormerL-22k'))\n", + "trackers.extend(trackerlist('trdimp', 'trdimp_lasot', range(3), 'TrDiMP'))\n", + "trackers.extend(trackerlist('trdimp', 'trsiam', range(3), 'TrSiam'))\n", + "trackers.extend(trackerlist('siamrpn_pp', 'siamrpn_r50_l234_dwxcorr_otb', None, 'SiamRPN++'))\n", + "trackers.extend(trackerlist('siammask', 'siammask_r50_l3', None, 'SiamMask'))\n", + "trackers.extend(trackerlist('siamban', 'siamban_r50_l234_otb', None, 'SiamBAN'))\n", + "trackers.extend(trackerlist('ocean', 'online', None, 'Ocean'))\n", + "\n", + "plot_results(trackers, get_dataset('avist'), 'avist', merge_results=True, force_evaluation=True,\n", + " skip_missing_seq=False, exclude_invalid_frames=False, plot_types=('success'))" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "trackers = []\n", + "trackers.extend(trackerlist('atom', 'default', range(0, 5), 'Atom'))\n", + "trackers.extend(trackerlist('dimp', 'dimp18', range(0, 5), 'DiMP-18'))\n", + "trackers.extend(trackerlist('dimp', 'dimp50', range(0, 5), 'DiMP-50'))\n", + "trackers.extend(trackerlist('dimp', 'prdimp18', range(0, 5), 'PrDiMP-18'))\n", + "trackers.extend(trackerlist('dimp', 'prdimp50', range(0, 5), 'PrDiMP-50'))\n", + "trackers.extend(trackerlist('dimp', 'super_dimp', range(0, 5), 'Super DiMP'))\n", + "trackers.extend(trackerlist('kys', 'default', range(0, 5), 'KYS'))\n", + "trackers.extend(trackerlist('tomp', 'tomp101', 0, 'ToMP-101'))\n", + "trackers.extend(trackerlist('tomp', 'tomp50', 0, 'ToMP-50'))\n", + "trackers.extend(trackerlist('keep_track', 'default_fast', range(0, 5), 'KeepTrack'))\n", + "trackers.extend(trackerlist('alpha_refine', 'super_dimp_seg_refine_box', range(0, 5), 'ARBoxRefine'))\n", + "trackers.extend(trackerlist('alpha_refine', 'super_dimp_seg_box_from_seg', range(0, 5), 'ARSegToBox'))\n", + "trackers.extend(trackerlist('stark_st', 'baseline_R101', None, 'STARK-ST-101'))\n", + "trackers.extend(trackerlist('stark_st', 'baseline', None, 'STARK-ST-50'))\n", + "trackers.extend(trackerlist('transt', 'transt50', None, 'TransT'))\n", + "trackers.extend(trackerlist('mixformer_online', 'baseline', None, 'MixFormer-22k'))\n", + "trackers.extend(trackerlist('mixformer_online', 'baseline_1k', None, 'MixFormer-1k'))\n", + "trackers.extend(trackerlist('mixformer_online', 'baseline_large', None, 'MixFormerL-22k'))\n", + "trackers.extend(trackerlist('trdimp', 'trdimp', range(3), 'TrDiMP'))\n", + "trackers.extend(trackerlist('trdimp', 'trdimp_lasot', range(3), 'TrDiMP-LaSOT'))\n", + "trackers.extend(trackerlist('trdimp', 'trsiam', range(3), 'TrSiam'))\n", + "trackers.extend(trackerlist('trdimp', 'trsiam_lasot', range(3), 'TrSiam-LaSOT'))\n", + "trackers.extend(trackerlist('siamrpn_pp', 'siamrpn_r50_l234_dwxcorr_otb', None, 'SiamRPN++'))\n", + "trackers.extend(trackerlist('siammask', 'siammask_r50_l3', None, 'SiamMask'))\n", + "trackers.extend(trackerlist('siamban', 'siamban_r50_l234_otb', None, 'SiamBAN'))\n", + "trackers.extend(trackerlist('ocean', 'online', None, 'Ocean'))\n", + "\n", + "print_results(trackers, get_dataset('avist'), 'avist', merge_results=True, force_evaluation=True,\n", + " skip_missing_seq=False, exclude_invalid_frames=False, plot_types=('success'))" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file