aboutsummaryrefslogtreecommitdiff
path: root/evaluation/adept/evaluation_loci_looped_visibility.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'evaluation/adept/evaluation_loci_looped_visibility.ipynb')
-rw-r--r--evaluation/adept/evaluation_loci_looped_visibility.ipynb475
1 files changed, 475 insertions, 0 deletions
diff --git a/evaluation/adept/evaluation_loci_looped_visibility.ipynb b/evaluation/adept/evaluation_loci_looped_visibility.ipynb
new file mode 100644
index 0000000..cbb2b7c
--- /dev/null
+++ b/evaluation/adept/evaluation_loci_looped_visibility.ipynb
@@ -0,0 +1,475 @@
+{
+ "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": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "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_looped/results_visibility'\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": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "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: 7.65 , STD: 10.6, Count: 8266\n",
+ "Tracking Error when occluded: M: 6.72 , STD: 6.25, Count: 2236\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": [
+ "<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>89</td>\n",
+ " <td>115</td>\n",
+ " <td>0.436275</td>\n",
+ " <td>0.563725</td>\n",
+ " </tr>\n",
+ " </tbody>\n",
+ "</table>\n",
+ "</div>"
+ ],
+ "text/plain": [
+ " set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n",
+ "0 control open 89 115 0.436275 \n",
+ "\n",
+ " tracked_neg_pro \n",
+ "0 0.563725 "
+ ]
+ },
+ "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": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEmCAYAAAB20LuSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAiPElEQVR4nO3de5xN9f7H8dfec3EdDLZrUpKvcHKnQqlERzoqupxSB9V0VBRdfwjlFtGFJIWijkrpniSXkJNrIsU35H7JxLgbzOz9+2OPOTPTMHvYY81e834+Hh7ttdfaa3/MXr3n67vX+ixPIBBARETcw+t0ASIiEl4KdhERl1Gwi4i4jIJdRMRlFOwiIi4T7fD7FwIaAzuBVIdrERGJFFFARWApcCzrSqeDvTGwwOEaREQiVQvg+6xPOh3sOwGSkg7j9+t8+nAoU6Y4e/YccroMkb/QsRk+Xq+H+PhikJahWTkd7KkAfn9AwR5G+llKfqVjM+yyncLWl6ciIi6jYBcRcRkFu4iIyyjYRURcJqQvT40xJYD/Au2stZuyrKsHjAdKAPOBf1trU8JbpoiIhCrHEbsxpinB8yRrnGKTd4GHrbU1AA9wf/jKExGR3AplKuZ+4CFgR9YVxpiqQBFr7aK0p94Gbg1bdSIikms5TsVYa+8DMMZkt7oSmU+Q3wmcl9siypQpntuXnHP+lON4o2OdLiMkPl+c0yXkKJJ+nvldJP0sdWyeG2d7gZIXyHjFgQfw53Yne/YcyvcXLvh8cfw+uIPTZbhGtT7TSEw86HQZrqBjM7wi4dj0ej2nHRCf7Vkx2wg2ojmpAtlM2YiIyLlzVsFurd0MJBtjmqU9dTfw9VlXJSIiZ+yMgt0YM90Y0yht8S7gJWPMWqA4MCpcxYmISO6FPMdurb0gw+O2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nbtAVWAUWAFIJ3AxLJt/TlqRRoxphiwETgUoJfkm4BugKtgD4Ee4mnAI9aaxcYY0oDc4FjQFNrrf4HknxHwS4i4jKaihERcRkFu4iIyyjYRURcRsEuIuIyCnYREZdRsIuIuIyCXUTEZRTsIiIu8/+oCEMsbYPczgAAAABJRU5ErkJggg==",
+ "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": 7,
+ "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.797811</td>\n",
+ " <td>0.712093</td>\n",
+ " <td>0.907404</td>\n",
+ " <td>0.964629</td>\n",
+ " <td>0.756651</td>\n",
+ " <td>86.0</td>\n",
+ " <td>80.333333</td>\n",
+ " <td>5.666667</td>\n",
+ " <td>0.0</td>\n",
+ " <td>1544.333333</td>\n",
+ " <td>175.333333</td>\n",
+ " <td>48.333333</td>\n",
+ " <td>23.666667</td>\n",
+ " <td>0.643333</td>\n",
+ " <td>0.043260</td>\n",
+ " <td>3.0</td>\n",
+ " <td>43.000000</td>\n",
+ " <td>0.666667</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>surprise</th>\n",
+ " <td>0.775593</td>\n",
+ " <td>0.672416</td>\n",
+ " <td>0.917448</td>\n",
+ " <td>0.966854</td>\n",
+ " <td>0.708470</td>\n",
+ " <td>33.0</td>\n",
+ " <td>30.666667</td>\n",
+ " <td>2.333333</td>\n",
+ " <td>0.0</td>\n",
+ " <td>642.666667</td>\n",
+ " <td>53.000000</td>\n",
+ " <td>18.666667</td>\n",
+ " <td>5.000000</td>\n",
+ " <td>0.553262</td>\n",
+ " <td>0.043718</td>\n",
+ " <td>4.0</td>\n",
+ " <td>13.333333</td>\n",
+ " <td>0.000000</td>\n",
+ " </tr>\n",
+ " </tbody>\n",
+ "</table>\n",
+ "</div>"
+ ],
+ "text/plain": [
+ " idf1 idp idr recall precision \\\n",
+ "set \n",
+ "control 0.797811 0.712093 0.907404 0.964629 0.756651 \n",
+ "surprise 0.775593 0.672416 0.917448 0.966854 0.708470 \n",
+ "\n",
+ " num_unique_objects mostly_tracked partially_tracked mostly_lost \\\n",
+ "set \n",
+ "control 86.0 80.333333 5.666667 0.0 \n",
+ "surprise 33.0 30.666667 2.333333 0.0 \n",
+ "\n",
+ " num_false_positives num_misses num_switches num_fragmentations \\\n",
+ "set \n",
+ "control 1544.333333 175.333333 48.333333 23.666667 \n",
+ "surprise 642.666667 53.000000 18.666667 5.000000 \n",
+ "\n",
+ " mota motp num_transfer num_ascend num_migrate \n",
+ "set \n",
+ "control 0.643333 0.043260 3.0 43.000000 0.666667 \n",
+ "surprise 0.553262 0.043718 4.0 13.333333 0.000000 "
+ ]
+ },
+ "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": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percept gate openings when visible: M: 1.01 , STD: 0.928, Count: 8266\n",
+ "Percept gate openings when occluded: M: 0.0118 , STD: 0.133, Count: 2236\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']))"
+ ]
+ }
+ ],
+ "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
+}