Skip to content

Commit

Permalink
style: [CI] cleanup python notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions Bot committed Nov 3, 2023
1 parent b228563 commit 0ae3931
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 14,459 deletions.
96 changes: 15 additions & 81 deletions evaluation/ablation/longvideo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 21,
"execution_count": null,
"id": "7f78c96d-1a45-4ced-8c65-d7c775992139",
"metadata": {},
"outputs": [],
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -135,7 +99,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"id": "c8a069a6-0bdc-4bc4-afc6-b96132306775",
"metadata": {},
"outputs": [],
Expand All @@ -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": [],
Expand All @@ -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",
Expand Down
Loading

0 comments on commit 0ae3931

Please sign in to comment.