浏览代码

More Colab fixes

Jason Antic 6 年之前
父节点
当前提交
9d207b55ed
共有 2 个文件被更改,包括 13 次插入11 次删除
  1. 12 10
      DeOldify-video.ipynb
  2. 1 1
      DeOldify_colab.ipynb

+ 12 - 10
DeOldify-video.ipynb

@@ -90,7 +90,15 @@
    "outputs": [],
    "source": [
     "!git clone -b FastAIv1 --single-branch https://github.com/jantic/DeOldify.git DeOldify\n",
-    "#!git clone https://github.com/jantic/DeOldify.git DeOldify\n",
+    "#!git clone https://github.com/jantic/DeOldify.git DeOldify"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
     "cd DeOldify"
    ]
   },
@@ -215,13 +223,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "results_dir=Path('/content/WORKFOLDER/colorized')\n",
-    "\n",
-    "#Adjust this if image doesn't look quite right (max 64 on 11GB GPU).  The default here works for most photos.  \n",
-    "#It literally just is a number multiplied by 16 to get the square render resolution.  \n",
-    "#Note that this doesn't affect the resolution of the final output- the output is the same resolution as the input.\n",
-    "#Example:  render_factor=21 => color is rendered at 16x21 = 336x336 px.  \n",
-    "render_factor=21"
+    "results_dir=Path('/content/WORKFOLDER/colorized')"
    ]
   },
   {
@@ -234,7 +236,7 @@
    },
    "outputs": [],
    "source": [
-    "vis = get_colorize_visualizer(results_dir=results_dir, render_factor=render_factor)"
+    "vis = get_colorize_visualizer(results_dir=results_dir)"
    ]
   },
   {
@@ -369,7 +371,7 @@
    },
    "outputs": [],
    "source": [
-    "render_factor = 5  #@param {type: \"slider\", min: 5, max: 42}\n",
+    "render_factor = 21  #@param {type: \"slider\", min: 5, max: 42}\n",
     "#progress bar\n",
     "prog = 0\n",
     "out = display(progress(0, 100), display_id=True)\n",

+ 1 - 1
DeOldify_colab.ipynb

@@ -195,7 +195,7 @@
     "# note that the id is the ending part of the shareable link url (after open?id=)\n",
     "# The pretrained weights can be downloaded from https://www.dropbox.com/s/3e4dqky91h824ik/colorize_gen.pth\n",
     "!mkdir \"models\"\n",
-    "download = drive.CreateFile({'id': '3e4dqky91h824ik'})\n",
+    "download = drive.CreateFile({'id': '1ReNu8QCgi4vfyDovgYGMs7tlUGrnz72V'})\n",
     "download.GetContentFile('./models/colorize_gen.pth')"
    ]
   },