Skip to content

Commit

Permalink
[Fix] Fix issue kennymckormick#153 (bug of heatmap visualization note…
Browse files Browse the repository at this point in the history
  • Loading branch information
kennymckormick authored Mar 27, 2023
1 parent 051a094 commit 82dc080
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions demo/visualize_heatmap_volume.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"import cv2\n",
"import os.path as osp\n",
"import decord\n",
"import copy as cp\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import urllib\n",
Expand Down Expand Up @@ -211,7 +212,7 @@
"outputs": [],
"source": [
"# Visualize Skeleton\n",
"vis_frames = vis_skeleton(vid_path, anno, gym_categories[anno['label']])\n",
"vis_frames = vis_skeleton(vid_path, cp.deepcopy(anno), gym_categories[anno['label']])\n",
"vid = mpy.ImageSequenceClip(vis_frames, fps=24)\n",
"vid.ipython_display()"
]
Expand All @@ -223,7 +224,7 @@
"metadata": {},
"outputs": [],
"source": [
"keypoint_heatmap = get_pseudo_heatmap(anno)\n",
"keypoint_heatmap = get_pseudo_heatmap(cp.deepcopy(anno))\n",
"keypoint_mapvis = vis_heatmaps(keypoint_heatmap)\n",
"keypoint_mapvis = [add_label(f, gym_categories[anno['label']]) for f in keypoint_mapvis]\n",
"vid = mpy.ImageSequenceClip(keypoint_mapvis, fps=24)\n",
Expand All @@ -237,7 +238,7 @@
"metadata": {},
"outputs": [],
"source": [
"limb_heatmap = get_pseudo_heatmap(anno, 'limb')\n",
"limb_heatmap = get_pseudo_heatmap(cp.deepcopy(anno), 'limb')\n",
"limb_mapvis = vis_heatmaps(limb_heatmap)\n",
"limb_mapvis = [add_label(f, gym_categories[anno['label']]) for f in limb_mapvis]\n",
"vid = mpy.ImageSequenceClip(limb_mapvis, fps=24)\n",
Expand Down Expand Up @@ -310,7 +311,7 @@
"metadata": {},
"outputs": [],
"source": [
"vis_frames = vis_skeleton(vid_path, anno, ntu_categories[anno['label']])\n",
"vis_frames = vis_skeleton(vid_path, cp.deepcopy(anno), ntu_categories[anno['label']])\n",
"vid = mpy.ImageSequenceClip(vis_frames, fps=24)\n",
"vid.ipython_display()"
]
Expand All @@ -322,9 +323,9 @@
"metadata": {},
"outputs": [],
"source": [
"keypoint_heatmap = get_pseudo_heatmap(anno)\n",
"keypoint_heatmap = get_pseudo_heatmap(cp.deepcopy(anno))\n",
"keypoint_mapvis = vis_heatmaps(keypoint_heatmap)\n",
"keypoint_mapvis = [add_label(f, gym_categories[anno['label']]) for f in keypoint_mapvis]\n",
"keypoint_mapvis = [add_label(f, ntu_categories[anno['label']]) for f in keypoint_mapvis]\n",
"vid = mpy.ImageSequenceClip(keypoint_mapvis, fps=24)\n",
"vid.ipython_display()"
]
Expand All @@ -336,9 +337,9 @@
"metadata": {},
"outputs": [],
"source": [
"limb_heatmap = get_pseudo_heatmap(anno, 'limb')\n",
"limb_heatmap = get_pseudo_heatmap(cp.deepcopy(anno), 'limb')\n",
"limb_mapvis = vis_heatmaps(limb_heatmap)\n",
"limb_mapvis = [add_label(f, gym_categories[anno['label']]) for f in limb_mapvis]\n",
"limb_mapvis = [add_label(f, ntu_categories[anno['label']]) for f in limb_mapvis]\n",
"vid = mpy.ImageSequenceClip(limb_mapvis, fps=24)\n",
"vid.ipython_display()"
]
Expand Down

0 comments on commit 82dc080

Please sign in to comment.