{ "cells": [ { "cell_type": "code", "execution_count": 30, "id": "8ef5cd92", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The autoreload extension is already loaded. To reload it, use:\n", " %reload_ext autoreload\n" ] } ], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 31, "id": "78c4643a", "metadata": {}, "outputs": [], "source": [ "import os\n", "import sys\n", "import os.path as op\n", "import pandas as pd\n", "import json\n", "import base64" ] }, { "cell_type": "code", "execution_count": 32, "id": "ffba4333", "metadata": {}, "outputs": [], "source": [ "sys.path.append(op.abspath('..'))" ] }, { "cell_type": "code", "execution_count": 33, "id": "5bc81f71", "metadata": {}, "outputs": [], "source": [ "os.environ[\"CUBLAS_WORKSPACE_CONFIG\"] = \":16:8\"" ] }, { "cell_type": "code", "execution_count": 34, "id": "3de8bcf2", "metadata": { "lines_to_next_cell": 0 }, "outputs": [], "source": [ "import torch\n", "import multiprocessing\n", "from itertools import chain\n", "import numpy as np\n", "import random" ] }, { "cell_type": "code", "execution_count": 35, "id": "91a045ba", "metadata": {}, "outputs": [], "source": [ "from bokeh.io import output_notebook, output_file\n", "from bokeh.plotting import figure, show\n", "from bokeh.models import LinearColorMapper, ColumnDataSource\n", "from bokeh.transform import factor_cmap, factor_mark\n", "from torch.utils.data import DataLoader\n", "\n", "\n", "from datasets import SLREmbeddingDataset, collate_fn_padd\n", "from datasets.dataset_loader import LocalDatasetLoader\n", "from models import embeddings_scatter_plot_splits\n", "from models import SPOTER_EMBEDDINGS" ] }, { "cell_type": "code", "execution_count": 36, "id": "bc50c296", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "seed = 43\n", "random.seed(seed)\n", "np.random.seed(seed)\n", "os.environ[\"PYTHONHASHSEED\"] = str(seed)\n", "torch.manual_seed(seed)\n", "torch.cuda.manual_seed(seed)\n", "torch.cuda.manual_seed_all(seed)\n", "torch.backends.cudnn.deterministic = True\n", "torch.use_deterministic_algorithms(True) \n", "generator = torch.Generator()\n", "generator.manual_seed(seed)" ] }, { "cell_type": "code", "execution_count": 37, "id": "82766a17", "metadata": {}, "outputs": [], "source": [ "BASE_DATA_FOLDER = '../data/'\n", "os.environ[\"BASE_DATA_FOLDER\"] = BASE_DATA_FOLDER\n", "device = torch.device(\"cpu\")\n", "if torch.cuda.is_available():\n", " device = torch.device(\"cuda\")" ] }, { "cell_type": "code", "execution_count": 38, "id": "ead15a36", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# LOAD MODEL FROM CLEARML\n", "# from clearml import InputModel\n", "# model = InputModel(model_id='1b736da469b04e91b8451d2342aef6ce')\n", "# checkpoint = torch.load(model.get_weights())\n", "\n", "\n", "CHECKPOINT_PATH = \"../out-checkpoints/augment_rotate_75_x8/checkpoint_embed_1105.pth\"\n", "checkpoint = torch.load(CHECKPOINT_PATH, map_location=device)\n", "\n", "\n", "model = SPOTER_EMBEDDINGS(\n", " features=checkpoint[\"config_args\"].vector_length,\n", " hidden_dim=checkpoint[\"config_args\"].hidden_dim,\n", " norm_emb=checkpoint[\"config_args\"].normalize_embeddings,\n", ").to(device)\n", "\n", "model.load_state_dict(checkpoint[\"state_dict\"])" ] }, { "cell_type": "code", "execution_count": 40, "id": "20f8036d", "metadata": {}, "outputs": [], "source": [ "SL_DATASET = 'basic-signs' # or 'wlasl'\n", "\n", "if SL_DATASET == 'fingerspelling':\n", " dataset_name = \"fingerspelling\"\n", " split_dataset_path = \"fingerspelling_{}.csv\"\n", "elif SL_DATASET == 'wlasl':\n", " dataset_name = \"wlasl\"\n", " split_dataset_path = \"WLASL100_{}.csv\"\n", "elif SL_DATASET == 'basic-signs':\n", " dataset_name = \"basic-signs\"\n", " split_dataset_path = \"basic-signs_{}.csv\"\n", " " ] }, { "cell_type": "code", "execution_count": 41, "id": "758716b6", "metadata": {}, "outputs": [], "source": [ "def get_dataset_loader(loader_name=None):\n", " if loader_name == 'CLEARML':\n", " from datasets.clearml_dataset_loader import ClearMLDatasetLoader\n", " return ClearMLDatasetLoader()\n", " else:\n", " return LocalDatasetLoader()\n", "\n", "dataset_loader = get_dataset_loader()\n", "dataset_project = \"Sign Language Recognition\"\n", "batch_size = 1\n", "dataset_folder = dataset_loader.get_dataset_folder(dataset_project, dataset_name)" ] }, { "cell_type": "code", "execution_count": 42, "id": "f1527959", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/usr/local/lib/python3.8/dist-packages/sklearn/manifold/_t_sne.py:780: FutureWarning: The default initialization in TSNE will change from 'random' to 'pca' in 1.2.\n", " warnings.warn(\n", "/usr/local/lib/python3.8/dist-packages/sklearn/manifold/_t_sne.py:790: FutureWarning: The default learning rate in TSNE will change from 200.0 to 'auto' in 1.2.\n", " warnings.warn(\n" ] } ], "source": [ "dataloaders = {}\n", "splits = ['train', 'val']\n", "dfs = {}\n", "for split in splits:\n", " split_set_path = op.join(dataset_folder, split_dataset_path.format(split))\n", " split_set = SLREmbeddingDataset(split_set_path, triplet=False)\n", " data_loader = DataLoader(\n", " split_set,\n", " batch_size=batch_size,\n", " shuffle=False,\n", " collate_fn=collate_fn_padd,\n", " pin_memory=torch.cuda.is_available(),\n", " num_workers=multiprocessing.cpu_count()\n", " )\n", " dataloaders[split] = data_loader\n", " dfs[split] = pd.read_csv(split_set_path)\n", "\n", "with open(op.join(dataset_folder, 'id_to_label.json')) as fid:\n", " id_to_label = json.load(fid)\n", "id_to_label = {int(key): value for key, value in id_to_label.items()}\n", "\n", "tsne_results, labels_results = embeddings_scatter_plot_splits(model,\n", " dataloaders,\n", " device,\n", " id_to_label,\n", " perplexity=40,\n", " n_iter=1000)\n", "\n", "\n", "set_labels = list(set(next(chain(labels_results.values()))))" ] }, { "cell_type": "code", "execution_count": 43, "id": "3c3af5bf", "metadata": { "lines_to_next_cell": 0 }, "outputs": [ { "data": { "text/plain": [ "164" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfs = {}\n", "for split in splits:\n", " split_set_path = op.join(dataset_folder, split_dataset_path.format(split))\n", " df = pd.read_csv(split_set_path)\n", " df['tsne_x'] = tsne_results[split][:, 0]\n", " df['tsne_y'] = tsne_results[split][:, 1]\n", " df['split'] = split\n", " # if SL_DATASET == 'wlasl':\n", " # df['video_fn'] = df['video_id'].apply(lambda video_id: os.path.join(BASE_DATA_FOLDER, f'wlasl/videos/{video_id:05d}.mp4'))\n", " # else:\n", " # df['video_fn'] = df['video_id'].apply(lambda video_id: os.path.join(BASE_DATA_FOLDER, f'lsa/videos/{video_id}.mp4'))\n", " dfs[split] = df\n", "\n", "df = pd.concat([dfs['train']]).reset_index(drop=True)\n", "len(df)" ] }, { "cell_type": "code", "execution_count": 44, "id": "dccbe1b9", "metadata": {}, "outputs": [], "source": [ "from tqdm.auto import tqdm\n", "\n", "def load_videos(video_list):\n", " print('loading videos')\n", " videos = []\n", " for video_fn in tqdm(video_list):\n", " if video_fn is None:\n", " video_data = None\n", " else:\n", " with open(video_fn, 'rb') as fid:\n", " video_data = base64.b64encode(fid.read()).decode()\n", " videos.append(video_data)\n", " print('Done loading videos')\n", " return videos" ] }, { "cell_type": "code", "execution_count": 45, "id": "904298f0", "metadata": {}, "outputs": [], "source": [ "use_img_div = False\n", "if use_img_div:\n", " # sample dataframe data to avoid overloading scatter plot with too many videos\n", " df = df.loc[(df['tsne_x'] > 10) & (df['tsne_x'] < 20)]\n", " df = df.loc[(df['tsne_y'] > 10) & (df['tsne_y'] < 20)]" ] }, { "cell_type": "code", "execution_count": 46, "id": "42832f7c", "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "
\n", " \n", " Loading BokehJS ...\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "(function(root) {\n function now() {\n return new Date();\n }\n\n const force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\nconst JS_MIME_TYPE = 'application/javascript';\n const HTML_MIME_TYPE = 'text/html';\n const EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n const CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n const script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n const cell = handle.cell;\n\n const id = cell.output_area._bokeh_element_id;\n const server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n const cmd_clean = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd_clean, {\n iopub: {\n output: function(msg) {\n const id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n const cmd_destroy = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd_destroy);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n const output_area = handle.output_area;\n const output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n const toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n const bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n const script_attrs = bk_div.children[0].attributes;\n for (let i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n const toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n const props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n const events = require('base/js/events');\n const OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n const NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n const el = document.getElementById(\"1368\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n const js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.3.min.js\"];\n const css_urls = [];\n\n const inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {\n }\n ];\n\n function run_inline_js() {\n if (root.Bokeh !== undefined || force === true) {\n for (let i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\nif (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n const cell = $(document.getElementById(\"1368\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {}, "output_type": "display_data" } ], "source": [ "img_div = '''\n", "
\n", " \n", "
\n", "'''\n", "TOOLTIPS = f\"\"\"\n", "
\n", " {img_div if use_img_div else ''}\n", "
\n", " @label_desc - @split\n", " [#@video_id]\n", "
\n", "
\n", " \n", "\"\"\"\n", "\n", "# get labels\n", "labels = df['label_name'].values\n", "# get unique labels\n", "unique_labels = np.unique(labels)\n", "cmap = LinearColorMapper(palette=\"Turbo256\", low=0, high=len(unique_labels))\n", "\n", "output_notebook()\n", "# or \n", "# output_file(\"scatter_plot.html\")\n", "\n", "p = figure(width=1000,\n", " height=800,\n", " tooltips=TOOLTIPS,\n", " title=f\"Check {'video' if use_img_div else 'label'} by hovering mouse over the dots\")" ] }, { "cell_type": "code", "execution_count": 47, "id": "ead4daf7", "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "(function(root) {\n function embed_document(root) {\n const docs_json = {\"8ca9adeb-5053-419f-ac22-431834c16cd9\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1380\"}],\"center\":[{\"id\":\"1383\"},{\"id\":\"1387\"},{\"id\":\"1421\"}],\"height\":800,\"left\":[{\"id\":\"1384\"}],\"renderers\":[{\"id\":\"1409\"}],\"title\":{\"id\":\"1370\"},\"toolbar\":{\"id\":\"1396\"},\"width\":1000,\"x_range\":{\"id\":\"1372\"},\"x_scale\":{\"id\":\"1376\"},\"y_range\":{\"id\":\"1374\"},\"y_scale\":{\"id\":\"1378\"}},\"id\":\"1369\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"hatch_alpha\":{\"value\":0.1},\"hatch_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"size\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1407\",\"type\":\"Scatter\"},{\"attributes\":{\"coordinates\":null,\"group\":null,\"text\":\"Check label by hovering mouse over the dots\"},\"id\":\"1370\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1388\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1418\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1416\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.2},\"fill_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"hatch_alpha\":{\"value\":0.2},\"hatch_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"line_alpha\":{\"value\":0.2},\"line_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"size\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1408\",\"type\":\"Scatter\"},{\"attributes\":{\"coordinates\":null,\"group\":null,\"items\":[{\"id\":\"1422\"}]},\"id\":\"1421\",\"type\":\"Legend\"},{\"attributes\":{\"tools\":[{\"id\":\"1388\"},{\"id\":\"1389\"},{\"id\":\"1390\"},{\"id\":\"1391\"},{\"id\":\"1392\"},{\"id\":\"1393\"},{\"id\":\"1395\"}]},\"id\":\"1396\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1372\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1419\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1376\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1385\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data\":{\"label\":[0,1,2,3,4,1,2,3,2,6,5,0,7,7,8,2,9,2,4,2,8,4,1,10,3,11,10,12,4,9,13,0,10,11,5,8,8,13,6,9,2,3,13,14,3,14,9,6,8,3,7,1,7,11,0,5,5,5,6,4,11,2,10,11,4,7,3,10,9,6,9,12,7,11,12,2,9,1,12,10,11,13,9,13,13,14,6,1,9,8,1,10,2,5,9,0,1,8,6,4,0,6,5,11,4,7,14,12,14,6,0,10,9,11,0,8,9,7,4,5,8,6,14,10,3,10,9,9,14,8,9,0,5,2,12,11,6,2,8,10,4,8,1,13,1,4,4,11,12,14,0,1,2,12,14,13,6,7,3,7,5,13,0,1],\"label_desc\":[\"TOT-ZIENS\",\"GOED\",\"GOEDENACHT\",\"NEE\",\"SLECHT\",\"GOED\",\"GOEDENACHT\",\"NEE\",\"GOEDENACHT\",\"JA\",\"GOEDEMORGEN\",\"TOT-ZIENS\",\"SORRY\",\"SORRY\",\"SMAKELIJK\",\"GOEDENACHT\",\"RECHTS\",\"GOEDENACHT\",\"SLECHT\",\"GOEDENACHT\",\"SMAKELIJK\",\"SLECHT\",\"GOED\",\"GOEDENAVOND\",\"NEE\",\"SALUUT\",\"GOEDENAVOND\",\"BEDANKEN\",\"SLECHT\",\"RECHTS\",\"LINKS\",\"TOT-ZIENS\",\"GOEDENAVOND\",\"SALUUT\",\"GOEDEMORGEN\",\"SMAKELIJK\",\"SMAKELIJK\",\"LINKS\",\"JA\",\"RECHTS\",\"GOEDENACHT\",\"NEE\",\"LINKS\",\"GOEDEMIDDAG\",\"NEE\",\"GOEDEMIDDAG\",\"RECHTS\",\"JA\",\"SMAKELIJK\",\"NEE\",\"SORRY\",\"GOED\",\"SORRY\",\"SALUUT\",\"TOT-ZIENS\",\"GOEDEMORGEN\",\"GOEDEMORGEN\",\"GOEDEMORGEN\",\"JA\",\"SLECHT\",\"SALUUT\",\"GOEDENACHT\",\"GOEDENAVOND\",\"SALUUT\",\"SLECHT\",\"SORRY\",\"NEE\",\"GOEDENAVOND\",\"RECHTS\",\"JA\",\"RECHTS\",\"BEDANKEN\",\"SORRY\",\"SALUUT\",\"BEDANKEN\",\"GOEDENACHT\",\"RECHTS\",\"GOED\",\"BEDANKEN\",\"GOEDENAVOND\",\"SALUUT\",\"LINKS\",\"RECHTS\",\"LINKS\",\"LINKS\",\"GOEDEMIDDAG\",\"JA\",\"GOED\",\"RECHTS\",\"SMAKELIJK\",\"GOED\",\"GOEDENAVOND\",\"GOEDENACHT\",\"GOEDEMORGEN\",\"RECHTS\",\"TOT-ZIENS\",\"GOED\",\"SMAKELIJK\",\"JA\",\"SLECHT\",\"TOT-ZIENS\",\"JA\",\"GOEDEMORGEN\",\"SALUUT\",\"SLECHT\",\"SORRY\",\"GOEDEMIDDAG\",\"BEDANKEN\",\"GOEDEMIDDAG\",\"JA\",\"TOT-ZIENS\",\"GOEDENAVOND\",\"RECHTS\",\"SALUUT\",\"TOT-ZIENS\",\"SMAKELIJK\",\"RECHTS\",\"SORRY\",\"SLECHT\",\"GOEDEMORGEN\",\"SMAKELIJK\",\"JA\",\"GOEDEMIDDAG\",\"GOEDENAVOND\",\"NEE\",\"GOEDENAVOND\",\"RECHTS\",\"RECHTS\",\"GOEDEMIDDAG\",\"SMAKELIJK\",\"RECHTS\",\"TOT-ZIENS\",\"GOEDEMORGEN\",\"GOEDENACHT\",\"BEDANKEN\",\"SALUUT\",\"JA\",\"GOEDENACHT\",\"SMAKELIJK\",\"GOEDENAVOND\",\"SLECHT\",\"SMAKELIJK\",\"GOED\",\"LINKS\",\"GOED\",\"SLECHT\",\"SLECHT\",\"SALUUT\",\"BEDANKEN\",\"GOEDEMIDDAG\",\"TOT-ZIENS\",\"GOED\",\"GOEDENACHT\",\"BEDANKEN\",\"GOEDEMIDDAG\",\"LINKS\",\"JA\",\"SORRY\",\"NEE\",\"SORRY\",\"GOEDEMORGEN\",\"LINKS\",\"TOT-ZIENS\",\"GOED\"],\"labels\":[0,1,2,3,4,1,2,3,2,6,5,0,7,7,8,2,9,2,4,2,8,4,1,10,3,11,10,12,4,9,13,0,10,11,5,8,8,13,6,9,2,3,13,14,3,14,9,6,8,3,7,1,7,11,0,5,5,5,6,4,11,2,10,11,4,7,3,10,9,6,9,12,7,11,12,2,9,1,12,10,11,13,9,13,13,14,6,1,9,8,1,10,2,5,9,0,1,8,6,4,0,6,5,11,4,7,14,12,14,6,0,10,9,11,0,8,9,7,4,5,8,6,14,10,3,10,9,9,14,8,9,0,5,2,12,11,6,2,8,10,4,8,1,13,1,4,4,11,12,14,0,1,2,12,14,13,6,7,3,7,5,13,0,1],\"split\":[\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\",\"train\"],\"x\":{\"__ndarray__\":\"TI2JP4Cspr8K+Yc/DrgbQPNtnsBmVIE/HdmIP6zwXUCp/8Q/ZL+cQGWpK8ATig8/bsaWv/Yi178IG4w8UPeEP/VnikDEzfg/Oe+4wMmzlD/JyR0+owQIwHLlnj+ShTnApg/tP6BbpMB0jIE+A7PpPhqgpcD+b0NA6mXFQCq4AD9ctvq/VJtawCDEfMBcXba+6n7TP37txED1t4BAFXZZQKppsj9OdYo/xL3PQMesY8D41ghA2do8wAbklECdtmpAOAWTPrVQ7T+Bzqm/4LXKPzR0Vr+Nz5PAr5qHv/QB7D5trULAnx19wPMaj0BXQdXAncO2wGOfbD6cGtW/LRJfwC5LwMAs6QTAmNG7P48wQ8BZ05NA/mtbQOea5T82Xre/IRd+v6OcksB5976+4/KZvfzJm0BsePU/vUhYv3FwpL92k5/AiyvXQExpnUBqf8pAV4bfQJL2H79bqZNAC3BBQJFmlEDvAYo//og4QI7OO7/zYgNAGYeSP1tJC0Dzn44/2xdsQGoDrL+sdCVAtZ7UwE1BEj4Px49AOM1ywCPSqcBLlpzATgfWv/yqWsCxdfy+dfMrwICP+z+JT5O/XdDnv4mMckAiJKTA7Yrgvpw1g79k8ZBAmXUXwH62z8ANE3HAbzwIwAuLl0BYPLC/uzoJwIJeMz9AbBq/qa3VP0CLsEDBUzs+pdgawBTfYEB6Xho+3eg5wFED3j9CU7y/f7KbwO0hEUAf0o++VmqOv0yByz6sqr/AnMIZQJLPckDTueNAmCAzQG9Tv8DIo87AJgApwBU/9L/xqd++LBiYv6zxZEBoSxK9TzE1v4cHg8A9pNdAuXjqP4lBtr/6twY/MksGwHoTQb+cGeNA0OcEPjc2LUA=\",\"dtype\":\"float32\",\"order\":\"little\",\"shape\":[164]},\"y\":{\"__ndarray__\":\"l+8ZwXSNLcFDlKxAqCfFwMyh4D8sjgPBKTN5QJNKmcCFaWpA3s2YwFh0AkGiwBbBFP0gQa9WG0ExngbBkw+qQKRG6L8w7bNA7aFVP3dktUC0YhrAyCYMwQV/BMF+awJAbG+owD8fm0DPpV7AnEWkvedbG0Bz0l+/B74zv3ebIMHqRFI+Tz2XQB9RBz5QuPjAD7kwwfo6Lr/T1gDBEURbv0ZuokBawU3AWod5v1zzf0BQPsTAbKBmQHM0ib/Cvs7AZJIQwdE10MDvBRZBy4fZwLCfHkErbp1Ad58gwTUPPb+RtehAEpuHvB/c98A6RGk/nrywQD3DlkAHjzXANi6kQGAKBkBTphJB6oKgwNlMtD6fUh++7+AFwVAHG7/XqNK/nMMYQYVasUClZBrA40MyQFcMt70OlRDBh8ZVwMaUYb/IM4hAprmGv8T647+NtZO/QVSRv7a/tj/Rr7fAcD0hwcwJAj+VjjLBgYsfwYwaX8BP55NA281MQPWeLb9B1B3BxxUwwQM3Vj+oVvfAq6+aP5bnGMGYSpHAzwJ9PxG/skDdOMI/jM8hQV80XUAUaDzAaMZQQICiDcHluBbBkpZdvxwHub57WapAB2gSwceyAsE4v3g/dtwSQRRypT/iUR1A9bYCQaNvz8DRqgFAawC4vgbB4sA5XoHAGEn1v7MWEcCjoLc+LzW+v8/ZLcAbhR/BNFf8QNdjkEB8o9i+rpaKQH3HHcEWNAxBfTHVwIbImsCjDaQ/ovMywXcFL8EPojDAOY8pwR1QOD9PaQJAQ559QLY/F8DigKY/tPgTwZ9sL8FaNG5ARz6Hv5u6pUB/2cW/hHX+wGnJIkEsQczA9CUbQfa+ID4LajDAlJEiwSVlCcE=\",\"dtype\":\"float32\",\"order\":\"little\",\"shape\":[164]}},\"selected\":{\"id\":\"1419\"},\"selection_policy\":{\"id\":\"1418\"}},\"id\":\"1404\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"coordinates\":null,\"data_source\":{\"id\":\"1404\"},\"glyph\":{\"id\":\"1406\"},\"group\":null,\"hover_glyph\":null,\"muted_glyph\":{\"id\":\"1408\"},\"nonselection_glyph\":{\"id\":\"1407\"},\"view\":{\"id\":\"1410\"}},\"id\":\"1409\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1374\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"tooltips\":\"\\n
\\n \\n
\\n @label_desc - @split\\n [#@video_id]\\n
\\n
\\n \\n\"},\"id\":\"1395\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"1414\",\"type\":\"AllLabels\"},{\"attributes\":{\"label\":{\"field\":\"label_desc\"},\"renderers\":[{\"id\":\"1409\"}]},\"id\":\"1422\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1389\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"coordinates\":null,\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"group\":null,\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1394\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1393\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1381\",\"type\":\"BasicTicker\"},{\"attributes\":{\"coordinates\":null,\"formatter\":{\"id\":\"1416\"},\"group\":null,\"major_label_policy\":{\"id\":\"1417\"},\"ticker\":{\"id\":\"1381\"}},\"id\":\"1380\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1380\"},\"coordinates\":null,\"group\":null,\"ticker\":null},\"id\":\"1383\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"hatch_alpha\":{\"value\":0.5},\"hatch_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1367\"}},\"size\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1406\",\"type\":\"Scatter\"},{\"attributes\":{\"axis\":{\"id\":\"1384\"},\"coordinates\":null,\"dimension\":1,\"group\":null,\"ticker\":null},\"id\":\"1387\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1392\",\"type\":\"ResetTool\"},{\"attributes\":{\"high\":15,\"low\":0,\"palette\":[\"#30123b\",\"#311542\",\"#32184a\",\"#341b51\",\"#351e58\",\"#36215f\",\"#372365\",\"#38266c\",\"#392972\",\"#3a2c79\",\"#3b2f7f\",\"#3c3285\",\"#3c358b\",\"#3d3791\",\"#3e3a96\",\"#3f3d9c\",\"#4040a1\",\"#4043a6\",\"#4145ab\",\"#4148b0\",\"#424bb5\",\"#434eba\",\"#4350be\",\"#4353c2\",\"#4456c7\",\"#4458cb\",\"#455bce\",\"#455ed2\",\"#4560d6\",\"#4563d9\",\"#4666dd\",\"#4668e0\",\"#466be3\",\"#466de6\",\"#4670e8\",\"#4673eb\",\"#4675ed\",\"#4678f0\",\"#467af2\",\"#467df4\",\"#467ff6\",\"#4682f8\",\"#4584f9\",\"#4587fb\",\"#4589fc\",\"#448cfd\",\"#438efd\",\"#4291fe\",\"#4193fe\",\"#4096fe\",\"#3f98fe\",\"#3e9bfe\",\"#3c9dfd\",\"#3ba0fc\",\"#39a2fc\",\"#38a5fb\",\"#36a8f9\",\"#34aaf8\",\"#33acf6\",\"#31aff5\",\"#2fb1f3\",\"#2db4f1\",\"#2bb6ef\",\"#2ab9ed\",\"#28bbeb\",\"#26bde9\",\"#25c0e6\",\"#23c2e4\",\"#21c4e1\",\"#20c6df\",\"#1ec9dc\",\"#1dcbda\",\"#1ccdd7\",\"#1bcfd4\",\"#1ad1d2\",\"#19d3cf\",\"#18d5cc\",\"#18d7ca\",\"#17d9c7\",\"#17dac4\",\"#17dcc2\",\"#17debf\",\"#18e0bd\",\"#18e1ba\",\"#19e3b8\",\"#1ae4b6\",\"#1be5b4\",\"#1de7b1\",\"#1ee8af\",\"#20e9ac\",\"#22eba9\",\"#24eca6\",\"#27eda3\",\"#29eea0\",\"#2cef9d\",\"#2ff09a\",\"#32f197\",\"#35f394\",\"#38f491\",\"#3bf48d\",\"#3ff58a\",\"#42f687\",\"#46f783\",\"#4af880\",\"#4df97c\",\"#51f979\",\"#55fa76\",\"#59fb72\",\"#5dfb6f\",\"#61fc6c\",\"#65fc68\",\"#69fd65\",\"#6dfd62\",\"#71fd5f\",\"#74fe5c\",\"#78fe59\",\"#7cfe56\",\"#80fe53\",\"#84fe50\",\"#87fe4d\",\"#8bfe4b\",\"#8efe48\",\"#92fe46\",\"#95fe44\",\"#98fe42\",\"#9bfd40\",\"#9efd3e\",\"#a1fc3d\",\"#a4fc3b\",\"#a6fb3a\",\"#a9fb39\",\"#acfa37\",\"#aef937\",\"#b1f836\",\"#b3f835\",\"#b6f735\",\"#b9f534\",\"#bbf434\",\"#bef334\",\"#c0f233\",\"#c3f133\",\"#c5ef33\",\"#c8ee33\",\"#caed33\",\"#cdeb34\",\"#cfea34\",\"#d1e834\",\"#d4e735\",\"#d6e535\",\"#d8e335\",\"#dae236\",\"#dde036\",\"#dfde36\",\"#e1dc37\",\"#e3da37\",\"#e5d838\",\"#e7d738\",\"#e8d538\",\"#ead339\",\"#ecd139\",\"#edcf39\",\"#efcd39\",\"#f0cb3a\",\"#f2c83a\",\"#f3c63a\",\"#f4c43a\",\"#f6c23a\",\"#f7c039\",\"#f8be39\",\"#f9bc39\",\"#f9ba38\",\"#fab737\",\"#fbb537\",\"#fbb336\",\"#fcb035\",\"#fcae34\",\"#fdab33\",\"#fda932\",\"#fda631\",\"#fda330\",\"#fea12f\",\"#fe9e2e\",\"#fe9b2d\",\"#fe982c\",\"#fd952b\",\"#fd9229\",\"#fd8f28\",\"#fd8c27\",\"#fc8926\",\"#fc8624\",\"#fb8323\",\"#fb8022\",\"#fa7d20\",\"#fa7a1f\",\"#f9771e\",\"#f8741c\",\"#f7711b\",\"#f76e1a\",\"#f66b18\",\"#f56817\",\"#f46516\",\"#f36315\",\"#f26014\",\"#f15d13\",\"#ef5a11\",\"#ee5810\",\"#ed550f\",\"#ec520e\",\"#ea500d\",\"#e94d0d\",\"#e84b0c\",\"#e6490b\",\"#e5460a\",\"#e3440a\",\"#e24209\",\"#e04008\",\"#de3e08\",\"#dd3c07\",\"#db3a07\",\"#d93806\",\"#d73606\",\"#d63405\",\"#d43205\",\"#d23005\",\"#d02f04\",\"#ce2d04\",\"#cb2b03\",\"#c92903\",\"#c72803\",\"#c52602\",\"#c32402\",\"#c02302\",\"#be2102\",\"#bb1f01\",\"#b91e01\",\"#b61c01\",\"#b41b01\",\"#b11901\",\"#ae1801\",\"#ac1601\",\"#a91501\",\"#a61401\",\"#a31201\",\"#a01101\",\"#9d1001\",\"#9a0e01\",\"#970d01\",\"#940c01\",\"#910b01\",\"#8e0a01\",\"#8b0901\",\"#870801\",\"#840701\",\"#810602\",\"#7d0502\",\"#7a0402\"]},\"id\":\"1367\",\"type\":\"LinearColorMapper\"},{\"attributes\":{},\"id\":\"1391\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1378\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1404\"}},\"id\":\"1410\",\"type\":\"CDSView\"},{\"attributes\":{\"coordinates\":null,\"formatter\":{\"id\":\"1413\"},\"group\":null,\"major_label_policy\":{\"id\":\"1414\"},\"ticker\":{\"id\":\"1385\"}},\"id\":\"1384\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1413\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1417\",\"type\":\"AllLabels\"},{\"attributes\":{\"overlay\":{\"id\":\"1394\"}},\"id\":\"1390\",\"type\":\"BoxZoomTool\"}],\"root_ids\":[\"1369\"]},\"title\":\"Bokeh Application\",\"version\":\"2.4.3\"}};\n const render_items = [{\"docid\":\"8ca9adeb-5053-419f-ac22-431834c16cd9\",\"root_ids\":[\"1369\"],\"roots\":{\"1369\":\"1a2f2ca2-cdb2-4df2-ba23-85018cca17d9\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n let attempts = 0;\n const timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);", "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1369" } }, "output_type": "display_data" } ], "source": [ "column_data = dict(\n", " x=df['tsne_x'],\n", " y=df['tsne_y'],\n", " label=df['labels'],\n", " label_desc=df['label_name'],\n", " split=df['split'],\n", " # video_id=df['video_id']\n", ")\n", "\n", "# get unique labels\n", "set_labels = list(set(column_data['label']))\n", "\n", "# map labels to 0 to num_classes\n", "label_to_id = {label: i for i, label in enumerate(set_labels)}\n", "column_data['labels'] = [label_to_id[label] for label in column_data['label']]\n", "\n", "\n", "if use_img_div:\n", " emb_videos = load_videos(df['video_fn'])\n", " column_data[\"videos\"] = emb_videos\n", "source = ColumnDataSource(data=column_data)\n", "\n", "# scatter plot with for each label another color\n", "p.scatter(x='x',\n", " y='y',\n", " source=source,\n", " color={'field': 'labels', 'transform': cmap},\n", " legend_field='label_desc',\n", " size=10,\n", " alpha=0.5)\n", "\n", "\n", "show(p)" ] }, { "cell_type": "code", "execution_count": 134, "id": "1d761766", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
nose_Xnose_YleftEye_XleftEye_YrightEye_XrightEye_YleftEar_XleftEar_YrightEar_XrightEar_Y...splitvideo_idlabelslabel_namevideo_widthvideo_heightfpslengthtsne_xtsne_y
0[0.498452,0.498553,0.498740,0.499141,0.499253,...[0.320706,0.326079,0.329347,0.330840,0.331348,...[0.534112,0.534081,0.534074,0.534061,0.533951,...[0.283401,0.285650,0.287332,0.288115,0.288350,...[0.461303,0.461805,0.462395,0.462959,0.463122,...[0.276863,0.278502,0.279791,0.280531,0.280942,...[0.558462,0.557758,0.557173,0.556385,0.555548,...[0.304631,0.305481,0.306485,0.306842,0.306911,...[0.432248,0.432255,0.432270,0.432289,0.432280,...[0.300599,0.302358,0.303453,0.304156,0.304925,......trainB!train!2_20230301114043553439_H4EER0B640.0480.030.0000003.933333-5.14574510.443328
1[0.499603,0.499782,0.499713,0.499718,0.499716,...[0.377759,0.372090,0.369328,0.368845,0.368575,...[0.545239,0.545351,0.545337,0.545315,0.545176,...[0.303044,0.300618,0.299811,0.299697,0.299686,...[0.450075,0.450722,0.451349,0.452002,0.452172,...[0.302042,0.301742,0.301553,0.301575,0.301589,...[0.571113,0.571111,0.571020,0.570947,0.570956,...[0.315368,0.314974,0.315351,0.315415,0.315432,...[0.411997,0.412929,0.413561,0.414035,0.414218,...[0.322391,0.322607,0.322609,0.322896,0.323251,......trainD!train!4_20230228231932508739_203WJ1D640.0480.015.0000004.000000-1.611456-13.267664
2[0.506591,0.507312,0.507955,0.508396,0.508882,...[0.397696,0.397776,0.397885,0.397972,0.398277,...[0.554327,0.554781,0.555182,0.555651,0.556110,...[0.343845,0.343422,0.343181,0.342978,0.342935,...[0.464670,0.464618,0.464613,0.464606,0.464599,...[0.342834,0.343746,0.344376,0.344640,0.345239,...[0.589977,0.589761,0.589638,0.589578,0.589559,...[0.373605,0.372651,0.372061,0.371614,0.371254,...[0.439167,0.439298,0.439412,0.439468,0.439555,...[0.369968,0.371493,0.372602,0.372962,0.373442,......trainX!train!24_20230313193727472324_QZ48Y2X640.0480.016.6666673.840000-8.379868-9.681334
3[0.563219,0.564298,0.564446,0.564395,0.564335,...[0.453190,0.454664,0.455088,0.455298,0.455444,...[0.615217,0.615701,0.615785,0.615487,0.615222,...[0.390181,0.393572,0.394811,0.395661,0.396261,...[0.525598,0.528705,0.529607,0.529693,0.529688,...[0.376735,0.379062,0.379977,0.381287,0.382156,...[0.654602,0.652928,0.651517,0.649746,0.648452,...[0.414657,0.417255,0.418721,0.419629,0.420523,...[0.487122,0.489352,0.490052,0.490523,0.490764,...[0.389374,0.393725,0.396954,0.398778,0.399780,......trainO!train!15_20230316130349891667_94GK73O640.0480.030.0000003.933333-3.46801119.879887
4[0.534347,0.534350,0.534348,0.534351,0.534257,...[0.366040,0.369482,0.371950,0.373151,0.375056,...[0.573697,0.573855,0.573859,0.573850,0.573835,...[0.312855,0.314814,0.315821,0.316412,0.317599,...[0.499859,0.499486,0.499479,0.499499,0.499556,...[0.319383,0.320213,0.321349,0.322067,0.322843,...[0.614189,0.611145,0.609677,0.608775,0.608422,...[0.339505,0.339731,0.339752,0.339752,0.339768,...[0.469407,0.469407,0.469571,0.469696,0.469925,...[0.340159,0.340279,0.340594,0.340797,0.340932,......trainW!train!23_20230307162255985290_ZET4J5W640.0480.030.0000003.933333-13.8196629.518650
..................................................................
555[0.606690,0.606405,0.606321,0.606093,0.606335,...[0.533929,0.534472,0.534947,0.534889,0.537878,...[0.653085,0.652606,0.652609,0.652661,0.653283,...[0.484087,0.483741,0.483700,0.483398,0.483384,...[0.565955,0.565624,0.565546,0.565457,0.566247,...[0.485883,0.485947,0.486004,0.485994,0.486090,...[0.695397,0.695193,0.695191,0.695250,0.695459,...[0.516024,0.516022,0.516945,0.516905,0.516701,...[0.538066,0.539230,0.539818,0.540210,0.541056,...[0.520784,0.520945,0.521081,0.520950,0.520934,......trainF!train!6_20230306192746737772_PBKJJ24F640.0480.014.9850153.9372670.8503919.577452
556[0.573205,0.574528,0.574271,0.573180,0.572867,...[0.425358,0.427494,0.430532,0.431733,0.435090,...[0.639872,0.640339,0.640325,0.639660,0.639780,...[0.375095,0.375091,0.375052,0.374993,0.375106,...[0.520413,0.520586,0.519840,0.519523,0.519537,...[0.352025,0.352860,0.353801,0.354090,0.355025,...[0.679821,0.679411,0.678846,0.678844,0.678880,...[0.415243,0.415450,0.415431,0.415466,0.415461,...[0.473096,0.472687,0.471395,0.470902,0.470860,...[0.389405,0.390338,0.391198,0.391376,0.391626,......trainX!train!24_20230318150756432389_T1XTN2X640.0480.01000.0000002.5420006.209669-17.046406
557[0.438977,0.438982,0.438984,0.439069,0.439295,...[0.379214,0.380074,0.381261,0.382829,0.384443,...[0.486520,0.487420,0.488052,0.488677,0.489241,...[0.325285,0.328029,0.330372,0.332641,0.334531,...[0.406919,0.407048,0.407155,0.407375,0.407649,...[0.323748,0.324836,0.326162,0.327786,0.329353,...[0.526903,0.526998,0.527116,0.527220,0.527326,...[0.355733,0.356432,0.357204,0.357981,0.358690,...[0.381000,0.381048,0.381127,0.381257,0.381449,...[0.345693,0.345312,0.345154,0.345138,0.345149,......trainZ!train!26_20230313164104308046_EDP6L14Z640.0480.030.0000003.6000007.305971-23.761284
558[0.562234,0.562230,0.562221,0.562282,0.562289,...[0.604714,0.604817,0.605458,0.605774,0.605789,...[0.621810,0.620646,0.619884,0.619644,0.619426,...[0.547658,0.549717,0.552919,0.554406,0.554940,...[0.526415,0.526580,0.526635,0.526828,0.526959,...[0.542624,0.542402,0.542402,0.542387,0.542231,...[0.662978,0.662662,0.662170,0.661898,0.661687,...[0.577477,0.579208,0.581354,0.582389,0.582804,...[0.492118,0.492225,0.492262,0.492301,0.492397,...[0.553820,0.556338,0.558264,0.559222,0.559432,......trainY!train!25_20230313125334541132_UB0038Y640.0480.01000.0000003.9020009.30426610.654608
559[0.537090,0.537468,0.538434,0.537603,0.536945,...[0.298635,0.298634,0.298710,0.298587,0.298353,...[0.567478,0.567737,0.568967,0.568920,0.568670,...[0.272478,0.272135,0.271965,0.271218,0.270843,...[0.507183,0.507388,0.507843,0.507606,0.507431,...[0.266559,0.266555,0.266612,0.266608,0.266449,...[0.597032,0.597237,0.597694,0.598045,0.598189,...[0.297459,0.297435,0.297352,0.296939,0.296923,...[0.477034,0.477224,0.477629,0.477716,0.477724,...[0.294895,0.294492,0.294483,0.294487,0.294418,......trainW!train!23_20230307164435248346_FGQVL5W640.0480.01000.0000003.198000-14.6106008.728515
\n", "

560 rows × 118 columns

\n", "
" ], "text/plain": [ " nose_X \\\n", "0 [0.498452,0.498553,0.498740,0.499141,0.499253,... \n", "1 [0.499603,0.499782,0.499713,0.499718,0.499716,... \n", "2 [0.506591,0.507312,0.507955,0.508396,0.508882,... \n", "3 [0.563219,0.564298,0.564446,0.564395,0.564335,... \n", "4 [0.534347,0.534350,0.534348,0.534351,0.534257,... \n", ".. ... \n", "555 [0.606690,0.606405,0.606321,0.606093,0.606335,... \n", "556 [0.573205,0.574528,0.574271,0.573180,0.572867,... \n", "557 [0.438977,0.438982,0.438984,0.439069,0.439295,... \n", "558 [0.562234,0.562230,0.562221,0.562282,0.562289,... \n", "559 [0.537090,0.537468,0.538434,0.537603,0.536945,... \n", "\n", " nose_Y \\\n", "0 [0.320706,0.326079,0.329347,0.330840,0.331348,... \n", "1 [0.377759,0.372090,0.369328,0.368845,0.368575,... \n", "2 [0.397696,0.397776,0.397885,0.397972,0.398277,... \n", "3 [0.453190,0.454664,0.455088,0.455298,0.455444,... \n", "4 [0.366040,0.369482,0.371950,0.373151,0.375056,... \n", ".. ... \n", "555 [0.533929,0.534472,0.534947,0.534889,0.537878,... \n", "556 [0.425358,0.427494,0.430532,0.431733,0.435090,... \n", "557 [0.379214,0.380074,0.381261,0.382829,0.384443,... \n", "558 [0.604714,0.604817,0.605458,0.605774,0.605789,... \n", "559 [0.298635,0.298634,0.298710,0.298587,0.298353,... \n", "\n", " leftEye_X \\\n", "0 [0.534112,0.534081,0.534074,0.534061,0.533951,... \n", "1 [0.545239,0.545351,0.545337,0.545315,0.545176,... \n", "2 [0.554327,0.554781,0.555182,0.555651,0.556110,... \n", "3 [0.615217,0.615701,0.615785,0.615487,0.615222,... \n", "4 [0.573697,0.573855,0.573859,0.573850,0.573835,... \n", ".. ... \n", "555 [0.653085,0.652606,0.652609,0.652661,0.653283,... \n", "556 [0.639872,0.640339,0.640325,0.639660,0.639780,... \n", "557 [0.486520,0.487420,0.488052,0.488677,0.489241,... \n", "558 [0.621810,0.620646,0.619884,0.619644,0.619426,... \n", "559 [0.567478,0.567737,0.568967,0.568920,0.568670,... \n", "\n", " leftEye_Y \\\n", "0 [0.283401,0.285650,0.287332,0.288115,0.288350,... \n", "1 [0.303044,0.300618,0.299811,0.299697,0.299686,... \n", "2 [0.343845,0.343422,0.343181,0.342978,0.342935,... \n", "3 [0.390181,0.393572,0.394811,0.395661,0.396261,... \n", "4 [0.312855,0.314814,0.315821,0.316412,0.317599,... \n", ".. ... \n", "555 [0.484087,0.483741,0.483700,0.483398,0.483384,... \n", "556 [0.375095,0.375091,0.375052,0.374993,0.375106,... \n", "557 [0.325285,0.328029,0.330372,0.332641,0.334531,... \n", "558 [0.547658,0.549717,0.552919,0.554406,0.554940,... \n", "559 [0.272478,0.272135,0.271965,0.271218,0.270843,... \n", "\n", " rightEye_X \\\n", "0 [0.461303,0.461805,0.462395,0.462959,0.463122,... \n", "1 [0.450075,0.450722,0.451349,0.452002,0.452172,... \n", "2 [0.464670,0.464618,0.464613,0.464606,0.464599,... \n", "3 [0.525598,0.528705,0.529607,0.529693,0.529688,... \n", "4 [0.499859,0.499486,0.499479,0.499499,0.499556,... \n", ".. ... \n", "555 [0.565955,0.565624,0.565546,0.565457,0.566247,... \n", "556 [0.520413,0.520586,0.519840,0.519523,0.519537,... \n", "557 [0.406919,0.407048,0.407155,0.407375,0.407649,... \n", "558 [0.526415,0.526580,0.526635,0.526828,0.526959,... \n", "559 [0.507183,0.507388,0.507843,0.507606,0.507431,... \n", "\n", " rightEye_Y \\\n", "0 [0.276863,0.278502,0.279791,0.280531,0.280942,... \n", "1 [0.302042,0.301742,0.301553,0.301575,0.301589,... \n", "2 [0.342834,0.343746,0.344376,0.344640,0.345239,... \n", "3 [0.376735,0.379062,0.379977,0.381287,0.382156,... \n", "4 [0.319383,0.320213,0.321349,0.322067,0.322843,... \n", ".. ... \n", "555 [0.485883,0.485947,0.486004,0.485994,0.486090,... \n", "556 [0.352025,0.352860,0.353801,0.354090,0.355025,... \n", "557 [0.323748,0.324836,0.326162,0.327786,0.329353,... \n", "558 [0.542624,0.542402,0.542402,0.542387,0.542231,... \n", "559 [0.266559,0.266555,0.266612,0.266608,0.266449,... \n", "\n", " leftEar_X \\\n", "0 [0.558462,0.557758,0.557173,0.556385,0.555548,... \n", "1 [0.571113,0.571111,0.571020,0.570947,0.570956,... \n", "2 [0.589977,0.589761,0.589638,0.589578,0.589559,... \n", "3 [0.654602,0.652928,0.651517,0.649746,0.648452,... \n", "4 [0.614189,0.611145,0.609677,0.608775,0.608422,... \n", ".. ... \n", "555 [0.695397,0.695193,0.695191,0.695250,0.695459,... \n", "556 [0.679821,0.679411,0.678846,0.678844,0.678880,... \n", "557 [0.526903,0.526998,0.527116,0.527220,0.527326,... \n", "558 [0.662978,0.662662,0.662170,0.661898,0.661687,... \n", "559 [0.597032,0.597237,0.597694,0.598045,0.598189,... \n", "\n", " leftEar_Y \\\n", "0 [0.304631,0.305481,0.306485,0.306842,0.306911,... \n", "1 [0.315368,0.314974,0.315351,0.315415,0.315432,... \n", "2 [0.373605,0.372651,0.372061,0.371614,0.371254,... \n", "3 [0.414657,0.417255,0.418721,0.419629,0.420523,... \n", "4 [0.339505,0.339731,0.339752,0.339752,0.339768,... \n", ".. ... \n", "555 [0.516024,0.516022,0.516945,0.516905,0.516701,... \n", "556 [0.415243,0.415450,0.415431,0.415466,0.415461,... \n", "557 [0.355733,0.356432,0.357204,0.357981,0.358690,... \n", "558 [0.577477,0.579208,0.581354,0.582389,0.582804,... \n", "559 [0.297459,0.297435,0.297352,0.296939,0.296923,... \n", "\n", " rightEar_X \\\n", "0 [0.432248,0.432255,0.432270,0.432289,0.432280,... \n", "1 [0.411997,0.412929,0.413561,0.414035,0.414218,... \n", "2 [0.439167,0.439298,0.439412,0.439468,0.439555,... \n", "3 [0.487122,0.489352,0.490052,0.490523,0.490764,... \n", "4 [0.469407,0.469407,0.469571,0.469696,0.469925,... \n", ".. ... \n", "555 [0.538066,0.539230,0.539818,0.540210,0.541056,... \n", "556 [0.473096,0.472687,0.471395,0.470902,0.470860,... \n", "557 [0.381000,0.381048,0.381127,0.381257,0.381449,... \n", "558 [0.492118,0.492225,0.492262,0.492301,0.492397,... \n", "559 [0.477034,0.477224,0.477629,0.477716,0.477724,... \n", "\n", " rightEar_Y ... split \\\n", "0 [0.300599,0.302358,0.303453,0.304156,0.304925,... ... train \n", "1 [0.322391,0.322607,0.322609,0.322896,0.323251,... ... train \n", "2 [0.369968,0.371493,0.372602,0.372962,0.373442,... ... train \n", "3 [0.389374,0.393725,0.396954,0.398778,0.399780,... ... train \n", "4 [0.340159,0.340279,0.340594,0.340797,0.340932,... ... train \n", ".. ... ... ... \n", "555 [0.520784,0.520945,0.521081,0.520950,0.520934,... ... train \n", "556 [0.389405,0.390338,0.391198,0.391376,0.391626,... ... train \n", "557 [0.345693,0.345312,0.345154,0.345138,0.345149,... ... train \n", "558 [0.553820,0.556338,0.558264,0.559222,0.559432,... ... train \n", "559 [0.294895,0.294492,0.294483,0.294487,0.294418,... ... train \n", "\n", " video_id labels label_name video_width \\\n", "0 B!train!2_20230301114043553439_H4EER 0 B 640.0 \n", "1 D!train!4_20230228231932508739_203WJ 1 D 640.0 \n", "2 X!train!24_20230313193727472324_QZ48Y 2 X 640.0 \n", "3 O!train!15_20230316130349891667_94GK7 3 O 640.0 \n", "4 W!train!23_20230307162255985290_ZET4J 5 W 640.0 \n", ".. ... ... ... ... \n", "555 F!train!6_20230306192746737772_PBKJJ 24 F 640.0 \n", "556 X!train!24_20230318150756432389_T1XTN 2 X 640.0 \n", "557 Z!train!26_20230313164104308046_EDP6L 14 Z 640.0 \n", "558 Y!train!25_20230313125334541132_UB003 8 Y 640.0 \n", "559 W!train!23_20230307164435248346_FGQVL 5 W 640.0 \n", "\n", " video_height fps length tsne_x tsne_y \n", "0 480.0 30.000000 3.933333 -5.145745 10.443328 \n", "1 480.0 15.000000 4.000000 -1.611456 -13.267664 \n", "2 480.0 16.666667 3.840000 -8.379868 -9.681334 \n", "3 480.0 30.000000 3.933333 -3.468011 19.879887 \n", "4 480.0 30.000000 3.933333 -13.819662 9.518650 \n", ".. ... ... ... ... ... \n", "555 480.0 14.985015 3.937267 0.850391 9.577452 \n", "556 480.0 1000.000000 2.542000 6.209669 -17.046406 \n", "557 480.0 30.000000 3.600000 7.305971 -23.761284 \n", "558 480.0 1000.000000 3.902000 9.304266 10.654608 \n", "559 480.0 1000.000000 3.198000 -14.610600 8.728515 \n", "\n", "[560 rows x 118 columns]" ] }, "execution_count": 134, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "code", "execution_count": null, "id": "1c73f195", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", "main_language": "python", "notebook_metadata_filter": "-all" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }