{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "os.environ['CUDA_VISIBLE_DEVICES']='2' " ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from fasterai.visualize import *\n", "plt.style.use('dark_background')\n", "torch.backends.cudnn.benchmark=True" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "#Adjust render_factor (int) 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=15\n", "\n", "#Specify media_url. Many sources will work (YouTube, Imgur, Twitter, Reddit, etc). \n", "#Complete list here: https://rg3.github.io/youtube-dl/supportedsites.html . \n", "#NOTE: Make source_url None to just read from file at ./video/source/[file_name] directly without modification\n", "#source_url = 'https://vimeo.com/87890004'\n", "#source_url = 'https://vimeo.com/785823'\n", "#source_url = 'https://www.youtube.com/watch?v=gZShc8oshtU'\n", "#source_url = 'https://www.youtube.com/watch?v=fk6qiJjEEBo'\n", "#source_url = 'https://twitter.com/silentmoviegifs/status/1088830101863759872'\n", "#source_url = 'https://i.imgur.com/Ob9pZad.gifv'\n", "source_url = None\n", "#file_name = 'BusterKeatonTrainHouse_Original.mp4'\n", "#file_name = 'BicycleThief_Original.mp4'\n", "#file_name = 'ChaplinParty_Original.mp4'\n", "#file_name = 'video14.mp4'\n", "file_name = 'MetropolisTrailer.mp4'" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/media/jason/Projects/Deep Learning/DeOldifyV2/DeOldify/fastai/data_block.py:426: UserWarning: Your training set is empty. If this is by design, pass `ignore_empty=True` to remove this warning.\n", " warn(\"Your training set is empty. If this is by design, pass `ignore_empty=True` to remove this warning.\")\n", "/media/jason/Projects/Deep Learning/DeOldifyV2/DeOldify/fastai/data_block.py:429: UserWarning: Your validation set is empty. If this is by design, use `no_split()`\n", " or pass `ignore_empty=True` when labelling to remove this warning.\n", " or pass `ignore_empty=True` when labelling to remove this warning.\"\"\")\n" ] } ], "source": [ "colorizer = get_video_colorizer(render_factor=render_factor)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "