{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "8ef5cd92", "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "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": 3, "id": "ffba4333", "metadata": {}, "outputs": [], "source": [ "sys.path.append(op.abspath('..'))" ] }, { "cell_type": "code", "execution_count": 4, "id": "5bc81f71", "metadata": {}, "outputs": [], "source": [ "os.environ[\"CUBLAS_WORKSPACE_CONFIG\"] = \":16:8\"" ] }, { "cell_type": "code", "execution_count": 5, "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": 6, "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": 7, "id": "bc50c296", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 7, "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": 8, "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": 41, "id": "ead15a36", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 41, "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_197.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": 42, "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 = \"{}.csv\"\n", " " ] }, { "cell_type": "code", "execution_count": 43, "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": 44, "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": 45, "id": "3c3af5bf", "metadata": { "lines_to_next_cell": 0 }, "outputs": [ { "data": { "text/plain": [ "143" ] }, "execution_count": 45, "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": 46, "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": 47, "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": 48, "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(\"1506\");\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(\"1506\")).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": 49, "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 = {\"49e50715-c814-427d-91f3-7faabca8d9a1\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1518\"}],\"center\":[{\"id\":\"1521\"},{\"id\":\"1525\"},{\"id\":\"1559\"}],\"height\":800,\"left\":[{\"id\":\"1522\"}],\"renderers\":[{\"id\":\"1547\"}],\"title\":{\"id\":\"1508\"},\"toolbar\":{\"id\":\"1534\"},\"width\":1000,\"x_range\":{\"id\":\"1510\"},\"x_scale\":{\"id\":\"1514\"},\"y_range\":{\"id\":\"1512\"},\"y_scale\":{\"id\":\"1516\"}},\"id\":\"1507\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1529\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1551\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1552\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1555\",\"type\":\"AllLabels\"},{\"attributes\":{\"coordinates\":null,\"formatter\":{\"id\":\"1554\"},\"group\":null,\"major_label_policy\":{\"id\":\"1555\"},\"ticker\":{\"id\":\"1519\"}},\"id\":\"1518\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1554\",\"type\":\"BasicTickFormatter\"},{\"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\":\"1532\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1523\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1526\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1510\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1527\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1519\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1556\",\"type\":\"UnionRenderers\"},{\"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\":\"1505\",\"type\":\"LinearColorMapper\"},{\"attributes\":{\"coordinates\":null,\"data_source\":{\"id\":\"1542\"},\"glyph\":{\"id\":\"1544\"},\"group\":null,\"hover_glyph\":null,\"muted_glyph\":{\"id\":\"1546\"},\"nonselection_glyph\":{\"id\":\"1545\"},\"view\":{\"id\":\"1548\"}},\"id\":\"1547\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.2},\"fill_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"hatch_alpha\":{\"value\":0.2},\"hatch_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"line_alpha\":{\"value\":0.2},\"line_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"size\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1546\",\"type\":\"Scatter\"},{\"attributes\":{\"source\":{\"id\":\"1542\"}},\"id\":\"1548\",\"type\":\"CDSView\"},{\"attributes\":{\"coordinates\":null,\"group\":null,\"text\":\"Check label by hovering mouse over the dots\"},\"id\":\"1508\",\"type\":\"Title\"},{\"attributes\":{\"data\":{\"label\":[3,0,9,1,2,12,8,4,11,4,5,6,1,8,4,1,8,6,2,0,0,0,11,10,4,6,8,4,2,13,6,7,4,6,13,6,11,0,12,9,9,2,7,13,3,4,14,2,2,5,2,14,7,9,14,1,10,4,3,4,10,0,14,7,6,9,3,12,1,9,9,11,1,1,8,7,11,3,1,9,14,5,6,8,12,11,11,5,9,1,0,8,5,14,10,10,11,8,5,12,0,3,1,10,5,11,5,12,9,9,3,6,8,2,14,10,5,9,3,6,0,13,7,7,10,0,10,7,11,13,2,12,13,9,13,7,2,8,4,10,14,2,13],\"label_desc\":[\"NEE\",\"TOT-ZIENS\",\"RECHTS\",\"GOED\",\"GOEDENACHT\",\"BEDANKEN\",\"SMAKELIJK\",\"SLECHT\",\"SALUUT\",\"SLECHT\",\"GOEDEMORGEN\",\"JA\",\"GOED\",\"SMAKELIJK\",\"SLECHT\",\"GOED\",\"SMAKELIJK\",\"JA\",\"GOEDENACHT\",\"TOT-ZIENS\",\"TOT-ZIENS\",\"TOT-ZIENS\",\"SALUUT\",\"GOEDENAVOND\",\"SLECHT\",\"JA\",\"SMAKELIJK\",\"SLECHT\",\"GOEDENACHT\",\"LINKS\",\"JA\",\"SORRY\",\"SLECHT\",\"JA\",\"LINKS\",\"JA\",\"SALUUT\",\"TOT-ZIENS\",\"BEDANKEN\",\"RECHTS\",\"RECHTS\",\"GOEDENACHT\",\"SORRY\",\"LINKS\",\"NEE\",\"SLECHT\",\"GOEDEMIDDAG\",\"GOEDENACHT\",\"GOEDENACHT\",\"GOEDEMORGEN\",\"GOEDENACHT\",\"GOEDEMIDDAG\",\"SORRY\",\"RECHTS\",\"GOEDEMIDDAG\",\"GOED\",\"GOEDENAVOND\",\"SLECHT\",\"NEE\",\"SLECHT\",\"GOEDENAVOND\",\"TOT-ZIENS\",\"GOEDEMIDDAG\",\"SORRY\",\"JA\",\"RECHTS\",\"NEE\",\"BEDANKEN\",\"GOED\",\"RECHTS\",\"RECHTS\",\"SALUUT\",\"GOED\",\"GOED\",\"SMAKELIJK\",\"SORRY\",\"SALUUT\",\"NEE\",\"GOED\",\"RECHTS\",\"GOEDEMIDDAG\",\"GOEDEMORGEN\",\"JA\",\"SMAKELIJK\",\"BEDANKEN\",\"SALUUT\",\"SALUUT\",\"GOEDEMORGEN\",\"RECHTS\",\"GOED\",\"TOT-ZIENS\",\"SMAKELIJK\",\"GOEDEMORGEN\",\"GOEDEMIDDAG\",\"GOEDENAVOND\",\"GOEDENAVOND\",\"SALUUT\",\"SMAKELIJK\",\"GOEDEMORGEN\",\"BEDANKEN\",\"TOT-ZIENS\",\"NEE\",\"GOED\",\"GOEDENAVOND\",\"GOEDEMORGEN\",\"SALUUT\",\"GOEDEMORGEN\",\"BEDANKEN\",\"RECHTS\",\"RECHTS\",\"NEE\",\"JA\",\"SMAKELIJK\",\"GOEDENACHT\",\"GOEDEMIDDAG\",\"GOEDENAVOND\",\"GOEDEMORGEN\",\"RECHTS\",\"NEE\",\"JA\",\"TOT-ZIENS\",\"LINKS\",\"SORRY\",\"SORRY\",\"GOEDENAVOND\",\"TOT-ZIENS\",\"GOEDENAVOND\",\"SORRY\",\"SALUUT\",\"LINKS\",\"GOEDENACHT\",\"BEDANKEN\",\"LINKS\",\"RECHTS\",\"LINKS\",\"SORRY\",\"GOEDENACHT\",\"SMAKELIJK\",\"SLECHT\",\"GOEDENAVOND\",\"GOEDEMIDDAG\",\"GOEDENACHT\",\"LINKS\"],\"labels\":[3,0,9,1,2,12,8,4,11,4,5,6,1,8,4,1,8,6,2,0,0,0,11,10,4,6,8,4,2,13,6,7,4,6,13,6,11,0,12,9,9,2,7,13,3,4,14,2,2,5,2,14,7,9,14,1,10,4,3,4,10,0,14,7,6,9,3,12,1,9,9,11,1,1,8,7,11,3,1,9,14,5,6,8,12,11,11,5,9,1,0,8,5,14,10,10,11,8,5,12,0,3,1,10,5,11,5,12,9,9,3,6,8,2,14,10,5,9,3,6,0,13,7,7,10,0,10,7,11,13,2,12,13,9,13,7,2,8,4,10,14,2,13],\"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\"],\"x\":{\"__ndarray__\":\"ARi7wMqEXkDRJx/Bu6GvQNdTvr+4Pyu+y7TdPu/JAcG7Lw7BtZ/mwMGKlcA2FoM/tMCXQACITjhk3efA6K2gQBJRZz882QdA8YqJv5gnnUAMb4lA58mQQFZZJcGhd0Y/fNz1wN7Wvb+n5Vw/wjcQwVyr4r+4MU++QQxswOAWBUEwRBbBxD80QP2k7r1nampAqpPbwFC2gkB6w3o9Iu8EwLf1A8GNWgHAdBYLQT5/SL19Scy/MXWvwKHt8sCnZb2/CfYGwB9oGcAAcGu/NW7IwMUKCkEHNtnAOWIfwOtNtUCP5no/d5b5wANVysAa1vPADqK3v5EEaUCSqJbA7o4RQd/2Pr+0SRHBtwyxwNHijr/eWZpALA11wLfGGMFN6/3AFrWcQN7+vkBqtUjASRgSQQOSJ8H9eaBAmVyeQHQq5MCNhkHARcYjweTFakB652XAYe9xwDOK/8B7Qv7Ac5YFQFmYAsEg5MFAe4RtQPyZuMCEIyfA/KugwJjtHD/htLU+AoMhwcJ3+D8Mq+zA33mEwGhynED117vAZDtQQI3/BT+xvpnA2Z3/wO3coMAOfby/KXYHwcjJ6sC05o9A8aBDQIElpj/ZwhzAPDjPwNyB9b/6cDLAVTeAwJ2A8cBPfum+V/eEQEcPAD+oyyJB0ykQQaCfoMDJz39AoxEtwDovC0EgXtfAAVWHPa+v+r9BQgjAGU12vMQ8CsEIN8E+W0YGQfaj2b+UVTFA4S37wFa7U7+lIr7AkUvAv75/qL4=\",\"dtype\":\"float32\",\"order\":\"little\",\"shape\":[143]},\"y\":{\"__ndarray__\":\"PXMbwDmNZEBa2QFASR2Tv0LmOL8awdQ/DpRuQPEFiMBeHSRAEEyHwJnpnz+WH47Arl8bvlanJUDzXYjAvQaMv3zVPkARozfADUmMwOENS0Cg+C9ApddUQEVaEEDL/fq9MkGewCuMo8BUBeY/mUlYwHOBxcAfgbHAiFn0vwJYfj83/FfA3UEbwB91rsALH3q/k5weQDYepUBdD0I/8fakQFHASkC4wQDAG3ICvyxpv8DV3EvAQeKcwIAAlUCtWY/AyOW6wEqbvj+OT2nAh2eGQPV2R74JPrc/P4GLQDd4BsAguoG/RPypwCqCocBd04/ACbljP82/kUArvkRAhD79PUCVoMC+goY/8A/4v0ie9j+S8Ly/wKRwQGgJlj9SdDVAvVANwN8y+7/0DKlAWWlPv8uW1T+v8lbAftUXwLd/ur3NwnlAHe5OQGs2lL8ToDpAShobQJUxhD/7uOA/66MLwCjwPD+PheC/eIMxQIPlU0DqgIu/DL5lQIKO8D6UvQhA0zCwP4f0T0DmeJtA7s2NQCFoSkCStYHAzALkPS9/1T0ZtZxA92wDQPOCm0AwxxJAQsZuPr6zUT+wdbc/D7fdv6lgUEBF7gzA/5mFQJyxSr4/CJw/0AZfQMQRH8BYG9LAvfaDQMMEx8Acb1U/hK0avzBICEApmhlAuWyXPqzxgz/A9jNAqCPWwG9HrMANYak+K0mowCFyyj9R5czAZfjvPUVycr9WR3rAuIc1wI8BUD+xnts/9WZ7wJhOxcA=\",\"dtype\":\"float32\",\"order\":\"little\",\"shape\":[143]}},\"selected\":{\"id\":\"1557\"},\"selection_policy\":{\"id\":\"1556\"}},\"id\":\"1542\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1514\",\"type\":\"LinearScale\"},{\"attributes\":{\"coordinates\":null,\"group\":null,\"items\":[{\"id\":\"1560\"}]},\"id\":\"1559\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"1531\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1512\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis\":{\"id\":\"1522\"},\"coordinates\":null,\"dimension\":1,\"group\":null,\"ticker\":null},\"id\":\"1525\",\"type\":\"Grid\"},{\"attributes\":{\"label\":{\"field\":\"label_desc\"},\"renderers\":[{\"id\":\"1547\"}]},\"id\":\"1560\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"tooltips\":\"\\n
\\n \\n
\\n @label_desc - @split\\n [#@video_id]\\n
\\n
\\n \\n\"},\"id\":\"1533\",\"type\":\"HoverTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"hatch_alpha\":{\"value\":0.1},\"hatch_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"size\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1545\",\"type\":\"Scatter\"},{\"attributes\":{\"axis\":{\"id\":\"1518\"},\"coordinates\":null,\"group\":null,\"ticker\":null},\"id\":\"1521\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1557\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1530\",\"type\":\"ResetTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1532\"}},\"id\":\"1528\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"hatch_alpha\":{\"value\":0.5},\"hatch_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"field\":\"labels\",\"transform\":{\"id\":\"1505\"}},\"size\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1544\",\"type\":\"Scatter\"},{\"attributes\":{},\"id\":\"1516\",\"type\":\"LinearScale\"},{\"attributes\":{\"tools\":[{\"id\":\"1526\"},{\"id\":\"1527\"},{\"id\":\"1528\"},{\"id\":\"1529\"},{\"id\":\"1530\"},{\"id\":\"1531\"},{\"id\":\"1533\"}]},\"id\":\"1534\",\"type\":\"Toolbar\"},{\"attributes\":{\"coordinates\":null,\"formatter\":{\"id\":\"1551\"},\"group\":null,\"major_label_policy\":{\"id\":\"1552\"},\"ticker\":{\"id\":\"1523\"}},\"id\":\"1522\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"1507\"]},\"title\":\"Bokeh Application\",\"version\":\"2.4.3\"}};\n const render_items = [{\"docid\":\"49e50715-c814-427d-91f3-7faabca8d9a1\",\"root_ids\":[\"1507\"],\"roots\":{\"1507\":\"c95f81fb-7cf0-4c10-b8a3-a9e77c772aef\"}}];\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": "1507" } }, "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 }