Преглед на файлове

Adding watermark toggle and instructions to colabs

Jason Antic преди 5 години
родител
ревизия
a70ef84aa8
променени са 2 файла, в които са добавени 11 реда и са изтрити 3 реда
  1. 5 1
      ImageColorizerColab.ipynb
  2. 6 2
      VideoColorizerColab.ipynb

+ 5 - 1
ImageColorizerColab.ipynb

@@ -188,6 +188,9 @@
     "### render_factor\n",
     "The default value of 35 has been carefully chosen and should work -ok- for most scenarios (but probably won't be the -best-). This determines resolution at which the color portion of the image is rendered. Lower resolution will render faster, and colors also tend to look more vibrant. Older and lower quality images in particular will generally benefit by lowering the render factor. Higher render factors are often better for higher quality images, but the colors may get slightly washed out. \n",
     "\n",
+    "### watermarked\n",
+    "Selected by default, this places a watermark icon of a palette at the bottom left corner of the image.  This is intended to be a standard way to convey to others viewing the image that it is colorized by AI. We want to help promote this as a standard, especially as the technology continues to improve and the distinction between real and fake becomes harder to discern. This palette watermark practice was initiated and lead by the company MyHeritage in the MyHeritage In Color feature (which uses a newer version of DeOldify than what you're using here).\n",
+    "\n",
     "#### How to Download a Copy\n",
     "Simply right click on the displayed image and click \"Save image as...\"!\n",
     "\n",
@@ -217,9 +220,10 @@
    "source": [
     "source_url = '' #@param {type:\"string\"}\n",
     "render_factor = 35  #@param {type: \"slider\", min: 7, max: 45}\n",
+    "watermarked = True #@param {type:\"boolean\"}\n",
     "\n",
     "if source_url is not None and source_url !='':\n",
-    "    image_path = colorizer.plot_transformed_image_from_url(url=source_url, render_factor=render_factor, compare=True)\n",
+    "    image_path = colorizer.plot_transformed_image_from_url(url=source_url, render_factor=render_factor, compare=True. watermarked=watermarked)\n",
     "    show_image_in_notebook(image_path)\n",
     "else:\n",
     "    print('Provide an image url and try again.')"

+ 6 - 2
VideoColorizerColab.ipynb

@@ -184,7 +184,10 @@
     "Type in a url hosting a video from YouTube, Imgur, Twitter, Reddit, Vimeo, etc.  Many sources work!  GIFs also work.  Full list here: https://ytdl-org.github.io/youtube-dl/supportedsites.html NOTE: If you want to use your own video, upload it first to a site like YouTube. \n",
     "\n",
     "### render_factor\n",
-    "The default value of 21 has been carefully chosen and should work -ok- for most scenarios (but probably won't be the -best-). This determines resolution at which the color portion of the video is rendered. Lower resolution will render faster, and colors also tend to look more vibrant. Older and lower quality film in particular will generally benefit by lowering the render factor. Higher render factors are often better for higher quality videos and inconsistencies (flashy render) will generally be reduced, but the colors may get slightly washed out. \n",
+    "The default value of 21 has been carefully chosen and should work -ok- for most scenarios (but probably won't be the -best-). This determines resolution at which the color portion of the video is rendered. Lower resolution will render faster, and colors also tend to look more vibrant. Older and lower quality film in particular will generally benefit by lowering the render factor. Higher render factors are often better for higher quality videos and inconsistencies (flashy render) will generally be reduced, but the colors may get slightly washed out.\n",
+    "\n",
+    "### watermarked\n",
+    "Selected by default, this places a watermark icon of a palette at the bottom left corner of the image.  This is intended to be a standard way to convey to others viewing the image that it is colorized by AI. We want to help promote this as a standard, especially as the technology continues to improve and the distinction between real and fake becomes harder to discern. This palette watermark practice was initiated and lead by the company MyHeritage in the MyHeritage In Color feature (which uses a newer version of DeOldify than what you're using here).\n",
     "\n",
     "### How to Download a Copy\n",
     "Simply right click on the displayed video and click \"Save video as...\"!\n",
@@ -223,9 +226,10 @@
    "source": [
     "source_url = '' #@param {type:\"string\"}\n",
     "render_factor = 21  #@param {type: \"slider\", min: 5, max: 44}\n",
+    "watermarked = True #@param {type:\"boolean\"}\n",
     "\n",
     "if source_url is not None and source_url !='':\n",
-    "    video_path = colorizer.colorize_from_url(source_url, 'video.mp4', render_factor)\n",
+    "    video_path = colorizer.colorize_from_url(source_url, 'video.mp4', render_factor, watermarked=watermarked)\n",
     "    show_video_in_notebook(video_path)\n",
     "else:\n",
     "    print('Provide a video url and try again.')"