{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"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": 2,
"metadata": {},
"outputs": [
{
"ename": "FileNotFoundError",
"evalue": "[Errno 2] No such file or directory: '../../out/pretrained/adept/gswm/results/'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 5\u001b[0m\n\u001b[1;32m 2\u001b[0m root_path \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m../../out/pretrained/adept/gswm/results/\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# list all folders in root path that don't stat with a dot\u001b[39;00m\n\u001b[0;32m----> 5\u001b[0m nets \u001b[38;5;241m=\u001b[39m [f \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[43mos\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlistdir\u001b[49m\u001b[43m(\u001b[49m\u001b[43mroot_path\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m f\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m.\u001b[39m\u001b[38;5;124m'\u001b[39m)]\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m# read pickle file\u001b[39;00m\n\u001b[1;32m 8\u001b[0m sf \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame()\n",
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '../../out/pretrained/adept/gswm/results/'"
]
}
],
"source": [
"# setting path to results folder\n",
"root_path = '../../out/pretrained/adept/gswm/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",
"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, 'control', 'statistics',)\n",
" path = os.path.join(root_path, 'statistics',)\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['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",
"sf['control'] = [('control' in set) for set in sf['set']]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculate Tracking Error (TE)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Tracking Error when visible: M: 30.3 , STD: 14.1, Count: 507\n",
"Tracking Error when occluded: M: 25.8 , STD: 16.1, Count: 15\n",
"Tracking Error Overall: M: 30.2 , STD: 14.1, Count: 522\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']))\n",
"\n",
"# When Overall\n",
"temp = sf[grouping]\n",
"print(f'Tracking Error Overall:' + get_stats(temp['TE']))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculate Succesfull Trackings (TE)"
]
},
{
"cell_type": "code",
"execution_count": null,
"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",
" control | \n",
" control | \n",
" 1 | \n",
" 19 | \n",
" 0.05 | \n",
" 0.95 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n",
"0 control control 1 19 0.05 \n",
"\n",
" tracked_neg_pro \n",
"0 0.95 "
]
},
"execution_count": 6,
"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].groupby(grouping_factors).max()\n",
"ff.rename(columns = {'frame':'last_visible'}, inplace = True)\n",
"ff = ff[['last_visible']]\n",
"\n",
"# add dummy variable to sf\n",
"sf = sf.merge(ff, on=grouping_factors, how='left')\n",
"sf['last_visible'] = (sf['last_visible'] == sf['frame'])\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",
"ff = ff[['first_visible']]\n",
"\n",
"# add dummy variable to sf\n",
"sf = sf.merge(ff, on=grouping_factors, how='left')\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']== 15) & ~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": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEgCAYAAACgiViPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAf4klEQVR4nO3de5zN1f7H8dfec0GM62xzcURS6yRCok4o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bBLiLiMP8PJRGUvkOFYzQAAAAASUVORK5CYII=",
"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": null,
"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",
" control | \n",
" 0.54837 | \n",
" 0.487418 | \n",
" 0.626745 | \n",
" 0.70247 | \n",
" 0.546309 | \n",
" 86.0 | \n",
" 35.0 | \n",
" 44.0 | \n",
" 7.0 | \n",
" 4345.0 | \n",
" 2216.0 | \n",
" 240.0 | \n",
" 73.0 | \n",
" 0.086869 | \n",
" 0.07704 | \n",
" 119.0 | \n",
" 55.0 | \n",
" 19.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" idf1 idp idr recall precision num_unique_objects \\\n",
"set \n",
"control 0.54837 0.487418 0.626745 0.70247 0.546309 86.0 \n",
"\n",
" mostly_tracked partially_tracked mostly_lost num_false_positives \\\n",
"set \n",
"control 35.0 44.0 7.0 4345.0 \n",
"\n",
" num_misses num_switches num_fragmentations mota motp \\\n",
"set \n",
"control 2216.0 240.0 73.0 0.086869 0.07704 \n",
"\n",
" num_transfer num_ascend num_migrate \n",
"set \n",
"control 119.0 55.0 19.0 "
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"af[af.index == 'OVERALL'].groupby(['set']).mean()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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
}