diff --git a/14_deep_computer_vision_with_cnns.ipynb b/14_deep_computer_vision_with_cnns.ipynb index ad810d4..1a1f06b 100644 --- a/14_deep_computer_vision_with_cnns.ipynb +++ b/14_deep_computer_vision_with_cnns.ipynb @@ -136,35 +136,6 @@ "plt.rc('ytick', labelsize=10)" ] }, - { - "cell_type": "markdown", - "metadata": { - "id": "RcoUIRsvpKzy" - }, - "source": [ - "And let's create the `images/cnn` folder (if it doesn't already exist), and define the `save_fig()` function which is used through this notebook to save the figures in high-res for the book:" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "id": "PQFH5Y9PpKzy" - }, - "outputs": [], - "source": [ - "from pathlib import Path\n", - "\n", - "IMAGES_PATH = Path() / \"images\" / \"cnn\"\n", - "IMAGES_PATH.mkdir(parents=True, exist_ok=True)\n", - "\n", - "def save_fig(fig_id, tight_layout=True, fig_extension=\"png\", resolution=300):\n", - " path = IMAGES_PATH / f\"{fig_id}.{fig_extension}\"\n", - " if tight_layout:\n", - " plt.tight_layout()\n", - " plt.savefig(path, format=fig_extension, dpi=resolution)" - ] - }, { "cell_type": "markdown", "metadata": { @@ -565,11 +536,11 @@ "gs = mpl.gridspec.GridSpec(nrows=1, ncols=2, width_ratios=[2, 1])\n", "\n", "ax1 = fig.add_subplot(gs[0, 0])\n", - "ax1.set_title(\"Input\", fontsize=14)\n", + "ax1.set_title(\"Input\")\n", "ax1.imshow(images[0]) # plot the 1st image\n", "ax1.axis(\"off\")\n", "ax2 = fig.add_subplot(gs[0, 1])\n", - "ax2.set_title(\"Output\", fontsize=14)\n", + "ax2.set_title(\"Output\")\n", "ax2.imshow(output[0]) # plot the output for the 1st image\n", "ax2.axis(\"off\")\n", "plt.show()" @@ -660,11 +631,11 @@ "\n", "plt.figure(figsize=(12, 8))\n", "plt.subplot(1, 2, 1)\n", - "plt.title(\"Input\", fontsize=14)\n", + "plt.title(\"Input\")\n", "plt.imshow(images[0]) # plot the 1st image\n", "plt.axis(\"off\")\n", "plt.subplot(1, 2, 2)\n", - "plt.title(\"Output\", fontsize=14)\n", + "plt.title(\"Output\")\n", "plt.imshow(depth_output[0, ..., 0], cmap=\"gray\") # plot 1st image's output\n", "plt.axis(\"off\")\n", "plt.show()" @@ -1501,7 +1472,7 @@ "plt.plot([0, 1], [mAP, mAP], \"g:\", linewidth=3, label=\"mAP\")\n", "plt.grid(True)\n", "plt.axis([0, 1, 0, 1])\n", - "plt.legend(loc=\"lower center\", fontsize=14)\n", + "plt.legend(loc=\"lower center\")\n", "plt.show()" ] },