提交 eb683957 编写于 作者: W Waleed Abdulla

Fix notebooks to visualize normalized detections

In a previous commit, the detections tensor was
changed to use normalized coordinates [0, 1]. This
fixes the notebooks to visualize the updated
detections format correctly.
上级 c1d142fe
......@@ -800,7 +800,7 @@
" for c, s in zip(detections[:, 4], detections[:, 5])]\n",
"visualize.draw_boxes(\n",
" image, \n",
" refined_boxes=detections[:, :4],\n",
" refined_boxes=utils.denorm_boxes(detections[:, :4], image.shape[:2]),\n",
" visibilities=[2] * len(detections),\n",
" captions=captions, title=\"Detections\",\n",
" ax=get_ax())"
......@@ -1163,7 +1163,7 @@
],
"source": [
"# Masks\n",
"det_boxes = mrcnn[\"detections\"][0, :, :4].astype(np.int32)\n",
"det_boxes = utils.denorm_boxes(mrcnn[\"detections\"][0, :, :4], image.shape[:2])\n",
"det_mask_specific = np.array([mrcnn[\"masks\"][0, i, :, :, c] \n",
" for i, c in enumerate(det_class_ids)])\n",
"det_masks = np.array([utils.unmold_mask(m, det_boxes[i], image.shape)\n",
......@@ -696,7 +696,7 @@
" for c, s in zip(detections[:, 4], detections[:, 5])]\n",
"visualize.draw_boxes(\n",
" image, \n",
" refined_boxes=detections[:, :4],\n",
" refined_boxes=utils.denorm_boxes(detections[:, :4], image.shape[:2]),\n",
" visibilities=[2] * len(detections),\n",
" captions=captions, title=\"Detections\",\n",
" ax=get_ax())"
......@@ -1051,7 +1051,7 @@
],
"source": [
"# Masks\n",
"det_boxes = mrcnn[\"detections\"][0, :, :4].astype(np.int32)\n",
"det_boxes = utils.denorm_boxes(mrcnn[\"detections\"][0, :, :4], image.shape[:2])\n",
"det_mask_specific = np.array([mrcnn[\"masks\"][0, i, :, :, c] \n",
" for i, c in enumerate(det_class_ids)])\n",
"det_masks = np.array([utils.unmold_mask(m, det_boxes[i], image.shape)\n",
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册