{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import seaborn as sns\n",
"import warnings\n",
"import scipy.stats as stats\n",
"import os\n",
"\n",
"warnings.simplefilter(action='ignore', category=FutureWarning)\n",
"pd.options.mode.chained_assignment = None \n",
"plt.style.use('ggplot')\n",
"sns.color_palette(\"Paired\");\n",
"sns.set_theme();"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data Loading"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# setting path to results folder\n",
"root_path = '../../out/pretrained/adept/loci_unlooped/results'\n",
"\n",
"# list all folders in root path that don't stat with a dot\n",
"nets = [f for f in os.listdir(root_path) if not f.startswith('.')]\n",
"\n",
"# read pickle file\n",
"tf = pd.DataFrame()\n",
"sf = pd.DataFrame()\n",
"af = pd.DataFrame()\n",
"\n",
"# load statistics files from nets\n",
"for net in nets:\n",
" path = os.path.join(root_path, net, 'surprise', 'statistics',)\n",
" with open(os.path.join(path, 'trialframe.csv'), 'rb') as f:\n",
" tf_temp = pd.read_csv(f, index_col=0)\n",
" tf_temp['net'] = net\n",
" tf = pd.concat([tf,tf_temp])\n",
"\n",
" with open(os.path.join(path, 'slotframe.csv'), 'rb') as f:\n",
" sf_temp = pd.read_csv(f, index_col=0)\n",
" sf_temp['net'] = net\n",
" sf = pd.concat([sf,sf_temp])\n",
"\n",
" with open(os.path.join(path, 'accframe.csv'), 'rb') as f:\n",
" af_temp = pd.read_csv(f, index_col=0)\n",
" af_temp['net'] = net\n",
" af = pd.concat([af,af_temp])\n",
"\n",
"# cast variables\n",
"sf['visible'] = sf['visible'].astype(bool)\n",
"sf['bound'] = sf['bound'].astype(bool)\n",
"sf['occluder'] = sf['occluder'].astype(bool)\n",
"sf['inimage'] = sf['inimage'].astype(bool)\n",
"sf['vanishing'] = sf['vanishing'].astype(bool)\n",
"sf['alpha_pos'] = 1-sf['alpha_pos']\n",
"sf['alpha_ges'] = 1-sf['alpha_ges']\n",
"\n",
"# scale to percentage\n",
"sf['TE'] = sf['TE'] * 100\n",
"\n",
"# add surprise as dummy code\n",
"tf['control'] = [('control' in set) for set in tf['set']]\n",
"sf['control'] = [('control' in set) for set in sf['set']]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculate Tracking Error (TE)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Tracking Error when visible: M: 12.4 , STD: 14.8, Count: 2144\n",
"Tracking Error when occluded: M: 7.66 , STD: 4.17, Count: 550\n"
]
}
],
"source": [
"grouping = (sf.inimage & sf.bound & ~sf.occluder & sf.control)\n",
"\n",
"def get_stats(col):\n",
" return f' M: {col.mean():.3} , STD: {col.std():.3}, Count: {col.count()}'\n",
"\n",
"# When Visible\n",
"temp = sf[grouping & sf.visible]\n",
"print(f'Tracking Error when visible:' + get_stats(temp['TE']))\n",
"\n",
"# When Occluded\n",
"temp = sf[grouping & ~sf.visible]\n",
"print(f'Tracking Error when occluded:' + get_stats(temp['TE']))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculate Succesfull Trackings (TE)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" set | \n",
" evalmode | \n",
" tracked_pos | \n",
" tracked_neg | \n",
" tracked_pos_pro | \n",
" tracked_neg_pro | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" createdown_control | \n",
" open | \n",
" 4 | \n",
" 50 | \n",
" 0.074074 | \n",
" 0.925926 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n",
"0 createdown_control open 4 50 0.074074 \n",
"\n",
" tracked_neg_pro \n",
"0 0.925926 "
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# succesfull trackings: In the last visible moment of the target, the slot was less than 10% away from the target\n",
"# determine last visible frame numeric\n",
"grouping_factors = ['net','set','evalmode','scene','slot']\n",
"ff = sf[sf.visible & sf.bound & sf.inimage].groupby(grouping_factors).max()\n",
"ff.rename(columns = {'frame':'last_visible'}, inplace = True)\n",
"sf = sf.merge(ff[['last_visible']], on=grouping_factors, how='left')\n",
"\n",
"# same for first bound frame\n",
"ff = sf[sf.visible & sf.bound & sf.inimage].groupby(grouping_factors).min()\n",
"ff.rename(columns = {'frame':'first_visible'}, inplace = True)\n",
"sf = sf.merge(ff[['first_visible']], on=grouping_factors, how='left')\n",
"\n",
"# add dummy variable to sf\n",
"sf['last_visible'] = (sf['last_visible'] == sf['frame'])\n",
"\n",
"# extract the trials where the target was last visible and threshold the TE\n",
"ff = sf[sf['last_visible']] \n",
"ff['tracked_pos'] = (ff['TE'] < 10)\n",
"ff['tracked_neg'] = (ff['TE'] >= 10)\n",
"\n",
"# fill NaN with 0\n",
"sf = sf.merge(ff[grouping_factors + ['tracked_pos', 'tracked_neg']], on=grouping_factors, how='left')\n",
"sf['tracked_pos'].fillna(False, inplace=True)\n",
"sf['tracked_neg'].fillna(False, inplace=True)\n",
"\n",
"# Aggreagte over all scenes\n",
"temp = sf[(sf['frame']== 1) & ~sf.occluder & sf.control & (sf.first_visible < 20)]\n",
"temp = temp.groupby(['set', 'evalmode']).sum()\n",
"temp = temp[['tracked_pos', 'tracked_neg']]\n",
"temp = temp.reset_index()\n",
"\n",
"temp['tracked_pos_pro'] = temp['tracked_pos'] / (temp['tracked_pos'] + temp['tracked_neg'])\n",
"temp['tracked_neg_pro'] = temp['tracked_neg'] / (temp['tracked_pos'] + temp['tracked_neg'])\n",
"\n",
"temp"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Mostly Tracked stats"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [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/ZOTfXzNKAWcBmoI1zTj9AUuwo2EVEPKOpGBERzyjYRUQ8o2AXEfGMgl1ExDMKdhERzyjYRUQ8o2AXEfHM/wOkZQVO1PZgzgAAAABJRU5ErkJggg==",
"text/plain": [
""
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"temp = af[af.index == 'OVERALL']\n",
"temp['mostly_tracked'] = temp['mostly_tracked'] / temp['num_unique_objects']\n",
"temp['partially_tracked'] = temp['partially_tracked'] / temp['num_unique_objects']\n",
"temp['mostly_lost'] = temp['mostly_lost'] / temp['num_unique_objects']\n",
"g = temp[['mostly_tracked', 'partially_tracked', 'mostly_lost','set']].set_index(['set']).groupby(['set']).mean().plot(kind='bar', stacked=True);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# MOTA "
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" idf1 | \n",
" idp | \n",
" idr | \n",
" recall | \n",
" precision | \n",
" num_unique_objects | \n",
" mostly_tracked | \n",
" partially_tracked | \n",
" mostly_lost | \n",
" num_false_positives | \n",
" num_misses | \n",
" num_switches | \n",
" num_fragmentations | \n",
" mota | \n",
" motp | \n",
" num_transfer | \n",
" num_ascend | \n",
" num_migrate | \n",
"
\n",
" \n",
" set | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" createdown_control | \n",
" 0.749071 | \n",
" 0.757039 | \n",
" 0.741270 | \n",
" 0.874413 | \n",
" 0.893014 | \n",
" 86.0 | \n",
" 48.0 | \n",
" 37.0 | \n",
" 1.0 | \n",
" 513.0 | \n",
" 615.0 | \n",
" 57.0 | \n",
" 51.0 | \n",
" 0.758015 | \n",
" 0.037414 | \n",
" 23.0 | \n",
" 34.0 | \n",
" 0.0 | \n",
"
\n",
" \n",
" createdown_surprise | \n",
" 0.802953 | \n",
" 0.813923 | \n",
" 0.792274 | \n",
" 0.868271 | \n",
" 0.891997 | \n",
" 33.0 | \n",
" 17.0 | \n",
" 16.0 | \n",
" 0.0 | \n",
" 166.0 | \n",
" 208.0 | \n",
" 11.0 | \n",
" 13.0 | \n",
" 0.756175 | \n",
" 0.036293 | \n",
" 7.0 | \n",
" 4.0 | \n",
" 0.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" idf1 idp idr recall precision \\\n",
"set \n",
"createdown_control 0.749071 0.757039 0.741270 0.874413 0.893014 \n",
"createdown_surprise 0.802953 0.813923 0.792274 0.868271 0.891997 \n",
"\n",
" num_unique_objects mostly_tracked partially_tracked \\\n",
"set \n",
"createdown_control 86.0 48.0 37.0 \n",
"createdown_surprise 33.0 17.0 16.0 \n",
"\n",
" mostly_lost num_false_positives num_misses \\\n",
"set \n",
"createdown_control 1.0 513.0 615.0 \n",
"createdown_surprise 0.0 166.0 208.0 \n",
"\n",
" num_switches num_fragmentations mota motp \\\n",
"set \n",
"createdown_control 57.0 51.0 0.758015 0.037414 \n",
"createdown_surprise 11.0 13.0 0.756175 0.036293 \n",
"\n",
" num_transfer num_ascend num_migrate \n",
"set \n",
"createdown_control 23.0 34.0 0.0 \n",
"createdown_surprise 7.0 4.0 0.0 "
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"af[af.index == 'OVERALL'].groupby(['set']).mean()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "loci23",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
}
},
"nbformat": 4,
"nbformat_minor": 2
}