From 0ae393134ca16dc996b2df70b2ec961042b36ef5 Mon Sep 17 00:00:00 2001 From: Github Actions Bot Date: Fri, 3 Nov 2023 10:55:19 +0000 Subject: [PATCH] style: [CI] cleanup python notebooks --- evaluation/ablation/longvideo.ipynb | 96 +- evaluation/ablation/test-stream-2.ipynb | 14414 +--------------------- 2 files changed, 51 insertions(+), 14459 deletions(-) diff --git a/evaluation/ablation/longvideo.ipynb b/evaluation/ablation/longvideo.ipynb index 9cbf217..de6ce6d 100644 --- a/evaluation/ablation/longvideo.ipynb +++ b/evaluation/ablation/longvideo.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "7f78c96d-1a45-4ced-8c65-d7c775992139", "metadata": {}, "outputs": [], @@ -24,18 +24,10 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "b2a726fa-f53a-4f86-bd1a-102f8371f6e9", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "/data/chanwutk/projects/spatialyze-ablation\n" - ] - } - ], + "outputs": [], "source": [ "\n", "def is_notebook() -> bool:\n", @@ -66,19 +58,10 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "fa64ff96-ad9a-482f-8c17-8db1ffce043f", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "True\n", - "/data/apperception-data/processed/nuscenes/full-dataset-v1.0/Trainval\n" - ] - } - ], + "outputs": [], "source": [ "NUSCENES_PROCESSED_DATA = \"NUSCENES_PROCESSED_DATA\"\n", "print(NUSCENES_PROCESSED_DATA in os.environ)\n", @@ -87,21 +70,10 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "ebc0dbe2-8236-4ed9-a048-3d64d456a094", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'scene-0001-CAM_FRONT'" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "DATA_DIR = os.environ[NUSCENES_PROCESSED_DATA]\n", "# with open(os.path.join(DATA_DIR, \"videos\", \"frames.pkl\"), \"rb\") as f:\n", @@ -114,18 +86,10 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "fc2bbf71-3aa0-4d2a-a9b5-a6d27097a043", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0523 0778 467\n" - ] - } - ], + "outputs": [], "source": [ "\n", "with open('./data/evaluation/video-samples/boston-seaport.txt', 'r') as f:\n", @@ -135,7 +99,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "c8a069a6-0bdc-4bc4-afc6-b96132306775", "metadata": {}, "outputs": [], @@ -147,28 +111,17 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "03af58b4-db6d-40d4-b3ab-b9429d73056d", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'boston-seaport-scene-0523-CAM_FRONT.mp4'" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "video_filename" ] }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "38f3f36b-e381-4de7-81f9-fdc70810c271", "metadata": {}, "outputs": [], @@ -186,29 +139,10 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "5f1b5b82-9ee4-459e-86f3-1fc863ae9502", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - " 2%|█▊ | 23/1000 [01:08<48:42, 2.99s/it]\n" - ] - }, - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[28], line 6\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m tqdm(\u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m1000\u001b[39m)):\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m frame \u001b[38;5;129;01min\u001b[39;00m frames:\n\u001b[0;32m----> 6\u001b[0m \u001b[43mresult\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mwrite\u001b[49m\u001b[43m(\u001b[49m\u001b[43mframe\u001b[49m\u001b[43m)\u001b[49m \n\u001b[1;32m 7\u001b[0m result\u001b[38;5;241m.\u001b[39mrelease() \n\u001b[1;32m 8\u001b[0m cv2\u001b[38;5;241m.\u001b[39mdestroyAllWindows()\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " - ] - } - ], + "outputs": [], "source": [ "result = cv2.VideoWriter('./loop-video.avi', \n", " cv2.VideoWriter_fourcc(*'MJPG'), \n", diff --git a/evaluation/ablation/test-stream-2.ipynb b/evaluation/ablation/test-stream-2.ipynb index 51c832f..513f73d 100644 --- a/evaluation/ablation/test-stream-2.ipynb +++ b/evaluation/ablation/test-stream-2.ipynb @@ -2,59 +2,12 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "569e4726-2856-4e5f-a220-e3bef1c110e1", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Tue Oct 31 17:24:04 2023 \n", - "+---------------------------------------------------------------------------------------+\n", - "| NVIDIA-SMI 530.30.02 Driver Version: 530.30.02 CUDA Version: 12.1 |\n", - "|-----------------------------------------+----------------------+----------------------+\n", - "| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n", - "| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n", - "| | | MIG M. |\n", - "|=========================================+======================+======================|\n", - "| 0 NVIDIA TITAN Xp On | 00000000:1A:00.0 Off | N/A |\n", - "| 31% 53C P2 61W / 250W| 3056MiB / 12288MiB | 0% Default |\n", - "| | | N/A |\n", - "+-----------------------------------------+----------------------+----------------------+\n", - "| 1 NVIDIA TITAN Xp On | 00000000:1B:00.0 Off | N/A |\n", - "| 23% 33C P8 9W / 250W| 4MiB / 12288MiB | 0% Default |\n", - "| | | N/A |\n", - "+-----------------------------------------+----------------------+----------------------+\n", - "| 2 NVIDIA TITAN Xp On | 00000000:3D:00.0 Off | N/A |\n", - "| 23% 27C P8 9W / 250W| 4MiB / 12288MiB | 0% Default |\n", - "| | | N/A |\n", - "+-----------------------------------------+----------------------+----------------------+\n", - "| 3 NVIDIA TITAN Xp On | 00000000:3E:00.0 Off | N/A |\n", - "| 23% 35C P8 10W / 250W| 4MiB / 12288MiB | 0% Default |\n", - "| | | N/A |\n", - "+-----------------------------------------+----------------------+----------------------+\n", - "| 4 NVIDIA TITAN Xp On | 00000000:88:00.0 Off | N/A |\n", - "| 23% 28C P8 9W / 250W| 4MiB / 12288MiB | 0% Default |\n", - "| | | N/A |\n", - "+-----------------------------------------+----------------------+----------------------+\n", - "| 5 NVIDIA TITAN Xp On | 00000000:89:00.0 Off | N/A |\n", - "| 23% 29C P8 9W / 250W| 4MiB / 12288MiB | 0% Default |\n", - "| | | N/A |\n", - "+-----------------------------------------+----------------------+----------------------+\n", - " \n", - "+---------------------------------------------------------------------------------------+\n", - "| Processes: |\n", - "| GPU GI CI PID Type Process name GPU Memory |\n", - "| ID ID Usage |\n", - "|=======================================================================================|\n", - "| 0 N/A N/A 5846 C ...nvs/spatialyze-benchmark/bin/python 1140MiB |\n", - "+---------------------------------------------------------------------------------------+\n" - ] - } - ], + "outputs": [], "source": [ "import subprocess\n", "import json\n", @@ -80,20 +33,12 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "7bcaf7b9-8b3f-4f2f-ad00-08b197795820", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "test freddie\n" - ] - } - ], + "outputs": [], "source": [ "hostname = socket.gethostname()\n", "test = hostname.split(\"-\")[-1]\n", @@ -102,20 +47,12 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "df967c40-baae-4473-8ab4-0ddfd630eb59", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "/data/chanwutk/projects/spatialyze-ablation\n" - ] - } - ], + "outputs": [], "source": [ "def is_notebook() -> bool:\n", " try:\n", @@ -145,55 +82,24 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "edb4d993-d0a4-49d5-8b4d-1b3a62f66da4", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "mobilitydb_chanwutk\n" - ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "process.wait()" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "ddcd5926-911d-437d-b67f-6814d5eb7c0b", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "CUDA is available.\n", - " > 0: NVIDIA TITAN Xp\n", - " 1: NVIDIA TITAN Xp\n", - " 2: NVIDIA TITAN Xp\n", - " 3: NVIDIA TITAN Xp\n", - " 4: NVIDIA TITAN Xp\n" - ] - } - ], + "outputs": [], "source": [ "from spatialyze.video_processor.camera_config import camera_config\n", "from spatialyze.video_processor.payload import Payload\n", @@ -204,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "863b7bd6-7bc4-4658-bb06-043ba955aef3", "metadata": { "tags": [] @@ -225,7 +131,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "6ee9880e-27d0-47f3-a3dd-36b70d199d8a", "metadata": { "tags": [] @@ -243,7 +149,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "3c4bddca-a1ae-4806-be85-8cf397d01ec9", "metadata": { "tags": [] @@ -256,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "6737b34b-d928-45aa-940e-b23a7a6e5eb0", "metadata": { "tags": [] @@ -275,7 +181,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "e9087777-3c98-414a-8f00-eda64e8f8ffd", "metadata": {}, "outputs": [], @@ -295,7 +201,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "59907886", "metadata": { "tags": [] @@ -308,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "e650e6ca-9d7c-41e9-98ee-f682b399040f", "metadata": { "tags": [] @@ -322,7 +228,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "264c8190-89ee-472a-bd73-d553eb3e3278", "metadata": { "tags": [] @@ -340,21 +246,12 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "355b8977", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "True\n", - "/data/apperception-data/processed/nuscenes/full-dataset-v1.0/Trainval\n" - ] - } - ], + "outputs": [], "source": [ "NUSCENES_PROCESSED_DATA = \"NUSCENES_PROCESSED_DATA\"\n", "print(NUSCENES_PROCESSED_DATA in os.environ)\n", @@ -363,7 +260,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "00c1dd1e", "metadata": { "tags": [] @@ -379,20 +276,12 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "1f6981ac-60b4-43f4-9c3b-32a4e84e4aa1", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0523 0778 467\n" - ] - } - ], + "outputs": [], "source": [ "with open('./data/evaluation/video-samples/boston-seaport.txt', 'r') as f:\n", " sampled_scenes = f.read().split('\\n')\n", @@ -401,7 +290,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "fcb3599c-3807-4044-9636-45b2d94fe7e8", "metadata": { "tags": [] @@ -417,7 +306,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "ad97a25a-0356-4d7e-9096-f26c00d2d9d4", "metadata": { "tags": [] @@ -450,7 +339,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "5d4149a3-43b5-4531-90dd-31dd795bdaa1", "metadata": { "tags": [] @@ -472,7 +361,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "275836d5", "metadata": { "tags": [] @@ -727,7 +616,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "98283938-b68f-4925-a5ef-eee7c6c46c65", "metadata": { "tags": [] @@ -799,7 +688,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "id": "f4adca3d-7963-4dc6-bde1-d0ce107ae959", "metadata": { "tags": [] @@ -936,7 +825,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "653e586a-a98c-4c15-ac5a-17551b3155db", "metadata": { "tags": [] @@ -949,7 +838,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "id": "48f7c558-dc6e-4b86-b447-a3ffac74c966", "metadata": { "tags": [] @@ -1089,7 +978,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "811c4351-f2a7-478b-b264-69a3e8d75c69", "metadata": { "editable": true, @@ -1098,14238 +987,7 @@ }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "----------- 0 / 4 --- de -----------\n", - "Pipeline P2:\n", - " - DecodeFrame.ParallelDecodeFrame\n", - " - Detection2D.YoloDetection\n", - " - DepthEstimation\n", - " - Detection3D.FromDetection2DAndDepth\n", - " - DetectionEstimation\n", - " - Tracking2D.StrongSORT\n", - " - Tracking3D.FromTracking2DAndDetection3D\n", - "q2-de\n", - "# of total videos: 5100\n", - "# of filtered videos: 3\n", - "# of sliced videos: 3\n" - ] - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "493d1248b25d4a318cefa8b6ceb94821", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - " 0%| | 0/3 [00:00