diff options
Diffstat (limited to 'evaluation/adept_ablation/lambda')
3 files changed, 1417 insertions, 0 deletions
diff --git a/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb new file mode 100644 index 0000000..8fde028 --- /dev/null +++ b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb @@ -0,0 +1,479 @@ +{ + "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_ablations/lambda/results/adept_level1_ablation_lambda.run311/trialframe.csv'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m/Users/fredericbecker/Documents/Master/Masterarbeit/code/local/loci_public/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb Cell 3\u001b[0m line \u001b[0;36m1\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/fredericbecker/Documents/Master/Masterarbeit/code/local/loci_public/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb#W2sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m \u001b[39mfor\u001b[39;00m net \u001b[39min\u001b[39;00m nets:\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/fredericbecker/Documents/Master/Masterarbeit/code/local/loci_public/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb#W2sZmlsZQ%3D%3D?line=13'>14</a>\u001b[0m path \u001b[39m=\u001b[39m os\u001b[39m.\u001b[39mpath\u001b[39m.\u001b[39mjoin(root_path, \u001b[39m'\u001b[39m\u001b[39mresults\u001b[39m\u001b[39m'\u001b[39m, net)\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/fredericbecker/Documents/Master/Masterarbeit/code/local/loci_public/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb#W2sZmlsZQ%3D%3D?line=14'>15</a>\u001b[0m \u001b[39mwith\u001b[39;00m \u001b[39mopen\u001b[39;49m(os\u001b[39m.\u001b[39;49mpath\u001b[39m.\u001b[39;49mjoin(path, \u001b[39m'\u001b[39;49m\u001b[39mtrialframe.csv\u001b[39;49m\u001b[39m'\u001b[39;49m), \u001b[39m'\u001b[39;49m\u001b[39mrb\u001b[39;49m\u001b[39m'\u001b[39;49m) \u001b[39mas\u001b[39;00m f:\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/fredericbecker/Documents/Master/Masterarbeit/code/local/loci_public/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb#W2sZmlsZQ%3D%3D?line=15'>16</a>\u001b[0m tf_temp \u001b[39m=\u001b[39m pd\u001b[39m.\u001b[39mread_csv(f, index_col\u001b[39m=\u001b[39m\u001b[39m0\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/fredericbecker/Documents/Master/Masterarbeit/code/local/loci_public/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl1.ipynb#W2sZmlsZQ%3D%3D?line=16'>17</a>\u001b[0m tf_temp[\u001b[39m'\u001b[39m\u001b[39mnet\u001b[39m\u001b[39m'\u001b[39m] \u001b[39m=\u001b[39m net\n", + "File \u001b[0;32m~/miniconda3/envs/loci23/lib/python3.9/site-packages/IPython/core/interactiveshell.py:282\u001b[0m, in \u001b[0;36m_modified_open\u001b[0;34m(file, *args, **kwargs)\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[39mif\u001b[39;00m file \u001b[39min\u001b[39;00m {\u001b[39m0\u001b[39m, \u001b[39m1\u001b[39m, \u001b[39m2\u001b[39m}:\n\u001b[1;32m 276\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[1;32m 277\u001b[0m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mIPython won\u001b[39m\u001b[39m'\u001b[39m\u001b[39mt let you open fd=\u001b[39m\u001b[39m{\u001b[39;00mfile\u001b[39m}\u001b[39;00m\u001b[39m by default \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 278\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mas it is likely to crash IPython. If you know what you are doing, \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 279\u001b[0m \u001b[39m\"\u001b[39m\u001b[39myou can use builtins\u001b[39m\u001b[39m'\u001b[39m\u001b[39m open.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 280\u001b[0m )\n\u001b[0;32m--> 282\u001b[0m \u001b[39mreturn\u001b[39;00m io_open(file, \u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '../../../out/pretrained/adept_ablations/lambda/results/adept_level1_ablation_lambda.run311/trialframe.csv'" + ] + } + ], + "source": [ + "# setting path to results folder\n", + "root_path = '../../../out/pretrained/adept_ablations/lambda'\n", + "\n", + "# list all folders in root path that don't stat with a dot\n", + "nets = ['adept_level1_ablation_lambda.run311']\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, 'results')\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": null, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Tracking Error when visible: M: 11.6 , STD: 13.5, Count: 2281\n", + "Tracking Error when occluded: M: 7.1 , STD: 4.02, Count: 564\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": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>set</th>\n", + " <th>evalmode</th>\n", + " <th>tracked_pos</th>\n", + " <th>tracked_neg</th>\n", + " <th>tracked_pos_pro</th>\n", + " <th>tracked_neg_pro</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>control</td>\n", + " <td>open</td>\n", + " <td>0</td>\n", + " <td>54</td>\n", + " <td>0.0</td>\n", + " <td>1.0</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n", + "0 control open 0 54 0.0 \n", + "\n", + " tracked_neg_pro \n", + "0 1.0 " + ] + }, + "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": null, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEmCAYAAAB20LuSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAir0lEQVR4nO3dd3hUVf7H8fek0UsIoSoiCkdABUGKBVFkXeuqix10V0SKCy7KqvijN8FdUVAUFURBARfBLljoFqSJICoHBBsQIYagJBAgmfn9MQk7xEAmMOFmTj6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wxcBGD2sSwVp7SeGtpDgo2KNfd6C1tXYvsC53lsxy4Hlvy5LSzhiziAIe+mKtVY+9mCnYo188cCBk+wB6gpKUDENDvo4HrgXSvSmldFGwR783gYXGmFkEA70T8JanFYkA1tol+XbNN8YsBwZ7UU9pohuUHGCMuQFoDxwEllpr3/S2IpFDi4Dl8QFnAuOttad7VFKpoR67A6y1s4HZXtchks8Sgv+K9BG88/RXoLenFZUSukFJRIrLLcDTwBnAZoKztuQEULCLSHEZD3wF/JXglNxz0PN4TwgFu4gUlxhr7YfA1cAca+3PaPj3hFCwi0hx2WuM6UfwTtN3jTH3Enx2gBQzBbuIFJfOBJfq7WStTQfqArd5W1LpoOmOIiKOUY9dRMQxCnYREcco2EWKwBhzqjFmjtd1iByNgl2kaE4h+OBwkRJLF0+lVDPGVAReBBoSvO19NdADuAoYCCQQvLnmX8AKwBKc3bHUWvtnL2oWKYx67FLaXQ9UstY2B1rl7jsNeAS40lp7DsE1718n+CzZbsBmhbqUZLoLTEq7T4BHjDGLgY+AccCfgNrAAmMOjbr4Aa1KKFFBPXYp1ay13xMM7NFAZWA+EAsssNY2z/sDtAXWe1aoSBEo2KVUM8b0IjjG/qG19iHgA4IPYb7MGHNGbpsrgXVAOSCb4NOAREosXTyVUs0YUwGYApxN8CLpT0BXoCMwgOBa4tlAX2vtx8aYasAiYD/QxlqrXyApcRTsIiKO0VCMiIhjFOwiIo5RsIuIOEbBLiLiGAW7iIhjFOwiIo5RsIuIOEbBLiLimP8HPUx1x9OfirsAAAAASUVORK5CYII=", + "text/plain": [ + "<Figure size 432x288 with 1 Axes>" + ] + }, + "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": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>idf1</th>\n", + " <th>idp</th>\n", + " <th>idr</th>\n", + " <th>recall</th>\n", + " <th>precision</th>\n", + " <th>num_unique_objects</th>\n", + " <th>mostly_tracked</th>\n", + " <th>partially_tracked</th>\n", + " <th>mostly_lost</th>\n", + " <th>num_false_positives</th>\n", + " <th>num_misses</th>\n", + " <th>num_switches</th>\n", + " <th>num_fragmentations</th>\n", + " <th>mota</th>\n", + " <th>motp</th>\n", + " <th>num_transfer</th>\n", + " <th>num_ascend</th>\n", + " <th>num_migrate</th>\n", + " </tr>\n", + " <tr>\n", + " <th>set</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>control</th>\n", + " <td>0.722042</td>\n", + " <td>0.879472</td>\n", + " <td>0.612416</td>\n", + " <td>0.658158</td>\n", + " <td>0.945161</td>\n", + " <td>86.0</td>\n", + " <td>35.0</td>\n", + " <td>22.0</td>\n", + " <td>29.0</td>\n", + " <td>187.0</td>\n", + " <td>1674.0</td>\n", + " <td>26.0</td>\n", + " <td>38.0</td>\n", + " <td>0.614662</td>\n", + " <td>0.033957</td>\n", + " <td>5.0</td>\n", + " <td>21.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " <tr>\n", + " <th>surprise</th>\n", + " <td>0.738122</td>\n", + " <td>0.923004</td>\n", + " <td>0.614946</td>\n", + " <td>0.646612</td>\n", + " <td>0.970532</td>\n", + " <td>33.0</td>\n", + " <td>11.0</td>\n", + " <td>9.0</td>\n", + " <td>13.0</td>\n", + " <td>31.0</td>\n", + " <td>558.0</td>\n", + " <td>5.0</td>\n", + " <td>6.0</td>\n", + " <td>0.623813</td>\n", + " <td>0.031067</td>\n", + " <td>0.0</td>\n", + " <td>5.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " idf1 idp idr recall precision \\\n", + "set \n", + "control 0.722042 0.879472 0.612416 0.658158 0.945161 \n", + "surprise 0.738122 0.923004 0.614946 0.646612 0.970532 \n", + "\n", + " num_unique_objects mostly_tracked partially_tracked mostly_lost \\\n", + "set \n", + "control 86.0 35.0 22.0 29.0 \n", + "surprise 33.0 11.0 9.0 13.0 \n", + "\n", + " num_false_positives num_misses num_switches num_fragmentations \\\n", + "set \n", + "control 187.0 1674.0 26.0 38.0 \n", + "surprise 31.0 558.0 5.0 6.0 \n", + "\n", + " mota motp num_transfer num_ascend num_migrate \n", + "set \n", + "control 0.614662 0.033957 5.0 21.0 0.0 \n", + "surprise 0.623813 0.031067 0.0 5.0 0.0 " + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "af[af.index == 'OVERALL'].groupby(['set']).mean()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Gate Openings" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percept gate openings when visible: M: 1.02 , STD: 0.681, Count: 2281\n", + "Percept gate openings when occluded: M: 0.216 , STD: 0.48, Count: 564\n" + ] + } + ], + "source": [ + "grouping = (sf.inimage & sf.bound & ~sf.occluder & sf.control)\n", + "temp = sf[grouping & sf.visible]\n", + "print(f'Percept gate openings when visible:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))\n", + "temp = sf[grouping & ~sf.visible]\n", + "print(f'Percept gate openings when occluded:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "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 +} diff --git a/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb new file mode 100644 index 0000000..5b8e275 --- /dev/null +++ b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb @@ -0,0 +1,469 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 9, + "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": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# setting path to results folder\n", + "root_path = '../../../out/pretrained/adept_ablations/lambda'\n", + "\n", + "# list all folders in root path that don't stat with a dot\n", + "nets = ['adept_level1_ablation_lambda.run411']\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, 'results')\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": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Tracking Error when visible: M: 5.25 , STD: 7.52, Count: 1246\n", + "Tracking Error when occluded: M: 5.16 , STD: 4.93, Count: 342\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": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>set</th>\n", + " <th>evalmode</th>\n", + " <th>tracked_pos</th>\n", + " <th>tracked_neg</th>\n", + " <th>tracked_pos_pro</th>\n", + " <th>tracked_neg_pro</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>control</td>\n", + " <td>open</td>\n", + " <td>18</td>\n", + " <td>15</td>\n", + " <td>0.545455</td>\n", + " <td>0.454545</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n", + "0 control open 18 15 0.545455 \n", + "\n", + " tracked_neg_pro \n", + "0 0.454545 " + ] + }, + "execution_count": 12, + "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": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEmCAYAAAB20LuSAAAAOXRFWHRTb2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IiMGo2EVEDEbFLiJiMCp2ERGDUbGLiBiMil1ExGBU7CIiBqNiFxExmP8HXuChHBTEVwUAAAAASUVORK5CYII=", + "text/plain": [ + "<Figure size 432x288 with 1 Axes>" + ] + }, + "metadata": {}, + "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": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>idf1</th>\n", + " <th>idp</th>\n", + " <th>idr</th>\n", + " <th>recall</th>\n", + " <th>precision</th>\n", + " <th>num_unique_objects</th>\n", + " <th>mostly_tracked</th>\n", + " <th>partially_tracked</th>\n", + " <th>mostly_lost</th>\n", + " <th>num_false_positives</th>\n", + " <th>num_misses</th>\n", + " <th>num_switches</th>\n", + " <th>num_fragmentations</th>\n", + " <th>mota</th>\n", + " <th>motp</th>\n", + " <th>num_transfer</th>\n", + " <th>num_ascend</th>\n", + " <th>num_migrate</th>\n", + " </tr>\n", + " <tr>\n", + " <th>set</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>control</th>\n", + " <td>0.753959</td>\n", + " <td>0.934199</td>\n", + " <td>0.632020</td>\n", + " <td>0.639984</td>\n", + " <td>0.945970</td>\n", + " <td>86.0</td>\n", + " <td>43.0</td>\n", + " <td>5.0</td>\n", + " <td>38.0</td>\n", + " <td>179.0</td>\n", + " <td>1763.0</td>\n", + " <td>7.0</td>\n", + " <td>22.0</td>\n", + " <td>0.602001</td>\n", + " <td>0.059856</td>\n", + " <td>0.0</td>\n", + " <td>7.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " <tr>\n", + " <th>surprise</th>\n", + " <td>0.751982</td>\n", + " <td>0.930841</td>\n", + " <td>0.630779</td>\n", + " <td>0.644079</td>\n", + " <td>0.950467</td>\n", + " <td>33.0</td>\n", + " <td>13.0</td>\n", + " <td>6.0</td>\n", + " <td>14.0</td>\n", + " <td>53.0</td>\n", + " <td>562.0</td>\n", + " <td>3.0</td>\n", + " <td>11.0</td>\n", + " <td>0.608613</td>\n", + " <td>0.058177</td>\n", + " <td>0.0</td>\n", + " <td>3.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " idf1 idp idr recall precision \\\n", + "set \n", + "control 0.753959 0.934199 0.632020 0.639984 0.945970 \n", + "surprise 0.751982 0.930841 0.630779 0.644079 0.950467 \n", + "\n", + " num_unique_objects mostly_tracked partially_tracked mostly_lost \\\n", + "set \n", + "control 86.0 43.0 5.0 38.0 \n", + "surprise 33.0 13.0 6.0 14.0 \n", + "\n", + " num_false_positives num_misses num_switches num_fragmentations \\\n", + "set \n", + "control 179.0 1763.0 7.0 22.0 \n", + "surprise 53.0 562.0 3.0 11.0 \n", + "\n", + " mota motp num_transfer num_ascend num_migrate \n", + "set \n", + "control 0.602001 0.059856 0.0 7.0 0.0 \n", + "surprise 0.608613 0.058177 0.0 3.0 0.0 " + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "af[af.index == 'OVERALL'].groupby(['set']).mean()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Gate Openings" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percept gate openings when visible: M: 0.061 , STD: 0.108, Count: 1246\n", + "Percept gate openings when occluded: M: 0.00026 , STD: 0.00481, Count: 342\n" + ] + } + ], + "source": [ + "grouping = (sf.inimage & sf.bound & ~sf.occluder & sf.control)\n", + "temp = sf[grouping & sf.visible]\n", + "print(f'Percept gate openings when visible:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))\n", + "temp = sf[grouping & ~sf.visible]\n", + "print(f'Percept gate openings when occluded:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "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 +} diff --git a/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb new file mode 100644 index 0000000..f137a5f --- /dev/null +++ b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb @@ -0,0 +1,469 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 10, + "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": 11, + "metadata": {}, + "outputs": [], + "source": [ + "# setting path to results folder\n", + "root_path = '../../../out/pretrained/adept_ablations/lambda'\n", + "\n", + "# list all folders in root path that don't stat with a dot\n", + "nets = ['adept_level1_ablation_lambda.run511']\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, 'results')\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": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Tracking Error when visible: M: 3.34 , STD: 4.22, Count: 1873\n", + "Tracking Error when occluded: M: 2.78 , STD: 1.66, Count: 492\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": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>set</th>\n", + " <th>evalmode</th>\n", + " <th>tracked_pos</th>\n", + " <th>tracked_neg</th>\n", + " <th>tracked_pos_pro</th>\n", + " <th>tracked_neg_pro</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>control</td>\n", + " <td>open</td>\n", + " <td>37</td>\n", + " <td>11</td>\n", + " <td>0.770833</td>\n", + " <td>0.229167</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n", + "0 control open 37 11 0.770833 \n", + "\n", + " tracked_neg_pro \n", + "0 0.229167 " + ] + }, + "execution_count": 13, + "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": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEmCAYAAAB20LuSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAmL0lEQVR4nO3deUBU5eLG8e8AgksqiDPgbuZOoC0mkWma1+2nZmrmXlfD7SpJXa8abrkEleaSZUmZWVqZO10Dcq3UNL0pWe5W7jCKmigozMzvD29TXBdABwcOz+cvzpwzZx5heHw5c857TA6Hw4GIiBiGh7sDiIiIa6nYRUQMRsUuImIwKnYREYNRsYuIGIyKXUTEYFTsIiIG4+XuAABnz17Ebtfp9K7g738XZ86kuTuGyDX03nQdDw8Tfn6lbri+QBS73e5QsbuQvpdSUOm9eWfoUIyIiMGo2EVEDKZAHIoRkVtns2Vx9qyVrKwr7o5yUykpHtjtdnfHKFS8vLzx8zPj6Zm3qlaxixRyZ89aKV68JKVKBWIymdwd54a8vDzIylKx55bD4eDixd85e9ZK+fIV8vTcXB2KSUtLo3379hw7duyadXv27KFz5860bt2aqKgosrKy8hRARG5PVtYVSpUqU6BLXfLOZDJRqlSZW/pLLMdi37VrFz169ODXX3+97voRI0Ywbtw4EhIScDgcLF68OM8hROT2qNSN6VZ/rjkW++LFixk/fjwWi+WadcePHycjI4OGDRsC0LlzZ+Lj428piIiIuEaOx9inTJlyw3UpKSmYzWbnstls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zq1aoqdSnQNLujFGkPPPAA06dPp0+fPoSFhfHMM8+wadMmUlJSePbZZ53bmUwmzXUihYaKXYq0KlWq8NVXX7F161a+++47/v73vzNw4EAefvhhZsyY4dzu5MmTWCwWtm/f7r6wIrmkQzFSpC1atIjRo0fTpEkTRowYQZMmTTh//jybNm3i0KFDAGzcuJGOHTuSkZGBp6cnmZmZbk4tcnMasUuR1qlTJ7Zt20a7du0oUaIEFSpUoE+fPtxzzz288MILOBwOvLy8mDNnDqVKlaJmzZr4+PjQtWtXPv/88+ve01PE3XRWjIiIwehQjIiIwajYRUQMRsUuImIwKnYREYNRsYuIGIyKXUTEYFTsIiIGo2IXETGY/wd9OaIYPoF6DAAAAABJRU5ErkJggg==", + "text/plain": [ + "<Figure size 432x288 with 1 Axes>" + ] + }, + "metadata": {}, + "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": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>idf1</th>\n", + " <th>idp</th>\n", + " <th>idr</th>\n", + " <th>recall</th>\n", + " <th>precision</th>\n", + " <th>num_unique_objects</th>\n", + " <th>mostly_tracked</th>\n", + " <th>partially_tracked</th>\n", + " <th>mostly_lost</th>\n", + " <th>num_false_positives</th>\n", + " <th>num_misses</th>\n", + " <th>num_switches</th>\n", + " <th>num_fragmentations</th>\n", + " <th>mota</th>\n", + " <th>motp</th>\n", + " <th>num_transfer</th>\n", + " <th>num_ascend</th>\n", + " <th>num_migrate</th>\n", + " </tr>\n", + " <tr>\n", + " <th>set</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>control</th>\n", + " <td>0.773828</td>\n", + " <td>0.943857</td>\n", + " <td>0.655708</td>\n", + " <td>0.673474</td>\n", + " <td>0.969430</td>\n", + " <td>86.0</td>\n", + " <td>41.0</td>\n", + " <td>15.0</td>\n", + " <td>30.0</td>\n", + " <td>104.0</td>\n", + " <td>1599.0</td>\n", + " <td>9.0</td>\n", + " <td>31.0</td>\n", + " <td>0.650398</td>\n", + " <td>0.039370</td>\n", + " <td>0.0</td>\n", + " <td>9.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " <tr>\n", + " <th>surprise</th>\n", + " <td>0.776620</td>\n", + " <td>0.942186</td>\n", + " <td>0.660545</td>\n", + " <td>0.678911</td>\n", + " <td>0.968383</td>\n", + " <td>33.0</td>\n", + " <td>16.0</td>\n", + " <td>4.0</td>\n", + " <td>13.0</td>\n", + " <td>35.0</td>\n", + " <td>507.0</td>\n", + " <td>4.0</td>\n", + " <td>12.0</td>\n", + " <td>0.654212</td>\n", + " <td>0.039468</td>\n", + " <td>2.0</td>\n", + " <td>2.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " idf1 idp idr recall precision \\\n", + "set \n", + "control 0.773828 0.943857 0.655708 0.673474 0.969430 \n", + "surprise 0.776620 0.942186 0.660545 0.678911 0.968383 \n", + "\n", + " num_unique_objects mostly_tracked partially_tracked mostly_lost \\\n", + "set \n", + "control 86.0 41.0 15.0 30.0 \n", + "surprise 33.0 16.0 4.0 13.0 \n", + "\n", + " num_false_positives num_misses num_switches num_fragmentations \\\n", + "set \n", + "control 104.0 1599.0 9.0 31.0 \n", + "surprise 35.0 507.0 4.0 12.0 \n", + "\n", + " mota motp num_transfer num_ascend num_migrate \n", + "set \n", + "control 0.650398 0.039370 0.0 9.0 0.0 \n", + "surprise 0.654212 0.039468 2.0 2.0 0.0 " + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "af[af.index == 'OVERALL'].groupby(['set']).mean()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Gate Openings" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percept gate openings when visible: M: 0.132 , STD: 0.145, Count: 1873\n", + "Percept gate openings when occluded: M: 0.00809 , STD: 0.0444, Count: 492\n" + ] + } + ], + "source": [ + "grouping = (sf.inimage & sf.bound & ~sf.occluder & sf.control)\n", + "temp = sf[grouping & sf.visible]\n", + "print(f'Percept gate openings when visible:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))\n", + "temp = sf[grouping & ~sf.visible]\n", + "print(f'Percept gate openings when occluded:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "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 +} |