{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!nvidia-smi","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:35:06.314443Z","iopub.execute_input":"2023-02-18T16:35:06.314796Z","iopub.status.idle":"2023-02-18T16:35:07.254918Z","shell.execute_reply.started":"2023-02-18T16:35:06.314729Z","shell.execute_reply":"2023-02-18T16:35:07.253881Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!nvcc --version","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:35:07.257022Z","iopub.execute_input":"2023-02-18T16:35:07.257489Z","iopub.status.idle":"2023-02-18T16:35:08.204740Z","shell.execute_reply.started":"2023-02-18T16:35:07.257439Z","shell.execute_reply":"2023-02-18T16:35:08.203767Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cd /kaggle/working/ && git clone https://github.com/alexey-pronkin/TCVC-Temporally-Consistent-Video-Colorization","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:35:08.207765Z","iopub.execute_input":"2023-02-18T16:35:08.208102Z","iopub.status.idle":"2023-02-18T16:35:13.281291Z","shell.execute_reply.started":"2023-02-18T16:35:08.208046Z","shell.execute_reply":"2023-02-18T16:35:13.280319Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cd TCVC-Temporally-Consistent-Video-Colorization/codes/models/archs/networks/channelnorm_package/ && python setup.py develop","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:38:29.835834Z","iopub.execute_input":"2023-02-18T16:38:29.836171Z","iopub.status.idle":"2023-02-18T16:38:58.343729Z","shell.execute_reply.started":"2023-02-18T16:38:29.836114Z","shell.execute_reply":"2023-02-18T16:38:58.342711Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cd TCVC-Temporally-Consistent-Video-Colorization/codes/models/archs/networks/correlation_package/ && python setup.py develop ","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:35:36.532972Z","iopub.execute_input":"2023-02-18T16:35:36.533286Z","iopub.status.idle":"2023-02-18T16:35:39.184788Z","shell.execute_reply.started":"2023-02-18T16:35:36.533234Z","shell.execute_reply":"2023-02-18T16:35:39.183677Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cd TCVC-Temporally-Consistent-Video-Colorization/codes/models/archs/networks/resample2d_package/ && python setup.py develop ","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:35:39.186360Z","iopub.execute_input":"2023-02-18T16:35:39.186689Z","iopub.status.idle":"2023-02-18T16:35:41.782056Z","shell.execute_reply.started":"2023-02-18T16:35:39.186632Z","shell.execute_reply":"2023-02-18T16:35:41.781130Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Чтобы пробовать на своих видео необходимо:\n- Положить свои видео в папку /kaggle/working/TCVC-Temporally-Consistent-Video-Colorization/codes/test/\nЭто можно сделать с помощью подключения датасета (50гб максимум), либо с помощью wget.\n- Необходимо учесть, что рабочая директория по умолчанию /kaggle/working/, а датасет монтируется в /kaggle/input/dataset_name/\n- Также можно поменять расположение папки test в файле https://github.com/alexey-pronkin/TCVC-Temporally-Consistent-Video-Colorization/blob/main/codes/test_TCVC_onesampling_noGT.py#L148 в переменной Input_dataset_folder = \"test/\"","metadata":{}},{"cell_type":"code","source":"# move files\n# !cp -r /kaggle/input/colorizationtcvc/test/test /kaggle/working/TCVC-Temporally-Consistent-Video-Colorization/codes/\n!mkdir /kaggle/working/TCVC-Temporally-Consistent-Video-Colorization/codes/test\n!cp -r /kaggle/input/colorizationtcvc/pretrained_models/pretrained_models/* /kaggle/working/TCVC-Temporally-Consistent-Video-Colorization/experiments/pretrained_models/\n!cp -r /kaggle/input/colorizationtcvc/TCVC_IDC/TCVC_IDC /kaggle/working/TCVC-Temporally-Consistent-Video-Colorization/experiments/","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:35:47.360303Z","iopub.execute_input":"2023-02-18T16:35:47.360661Z","iopub.status.idle":"2023-02-18T16:36:08.579621Z","shell.execute_reply.started":"2023-02-18T16:35:47.360602Z","shell.execute_reply":"2023-02-18T16:36:08.578298Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !apt install ffmpeg -y\n# !ffmpeg -i input.mp4 %04d.png","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:36:08.583734Z","iopub.execute_input":"2023-02-18T16:36:08.584037Z","iopub.status.idle":"2023-02-18T16:36:08.590406Z","shell.execute_reply.started":"2023-02-18T16:36:08.583984Z","shell.execute_reply":"2023-02-18T16:36:08.589557Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cp -r /kaggle/input/d/shivamontazh/trailer-devchata /kaggle/working/TCVC-Temporally-Consistent-Video-Colorization/codes/test/","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:38:04.377247Z","iopub.execute_input":"2023-02-18T16:38:04.377764Z","iopub.status.idle":"2023-02-18T16:38:13.846550Z","shell.execute_reply.started":"2023-02-18T16:38:04.377511Z","shell.execute_reply":"2023-02-18T16:38:13.845405Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !rm -r /kaggle/working/TCVC-Temporally-Consistent-Video-Colorization/codes/test","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:38:13.848680Z","iopub.execute_input":"2023-02-18T16:38:13.849015Z","iopub.status.idle":"2023-02-18T16:38:13.854027Z","shell.execute_reply.started":"2023-02-18T16:38:13.848961Z","shell.execute_reply":"2023-02-18T16:38:13.852980Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# some hacks\n!cp /opt/conda/pkgs/python-3.6.6-h6e4f718_2/lib/libpython3.6m.so.1.0 /usr/lib/","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:38:14.706521Z","iopub.execute_input":"2023-02-18T16:38:14.706873Z","iopub.status.idle":"2023-02-18T16:38:15.697435Z","shell.execute_reply.started":"2023-02-18T16:38:14.706819Z","shell.execute_reply":"2023-02-18T16:38:15.696284Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !cd TCVC-Temporally-Consistent-Video-Colorization/ && git pull\n","metadata":{"execution":{"iopub.status.busy":"2023-02-18T16:38:15.700135Z","iopub.execute_input":"2023-02-18T16:38:15.700488Z","iopub.status.idle":"2023-02-18T16:38:15.704954Z","shell.execute_reply.started":"2023-02-18T16:38:15.700430Z","shell.execute_reply":"2023-02-18T16:38:15.703868Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cd TCVC-Temporally-Consistent-Video-Colorization/codes && python test_TCVC_onesampling_noGT.py","metadata":{"execution":{"iopub.status.busy":"2023-02-18T17:03:52.725852Z","iopub.execute_input":"2023-02-18T17:03:52.726491Z","iopub.status.idle":"2023-02-18T17:04:10.372192Z","shell.execute_reply.started":"2023-02-18T17:03:52.726437Z","shell.execute_reply":"2023-02-18T17:04:10.371247Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cp -r TCVC-Temporally-Consistent-Video-Colorization/results .\n!tar -czvf results.tar.gz results","metadata":{"execution":{"iopub.status.busy":"2023-02-18T17:04:14.435687Z","iopub.execute_input":"2023-02-18T17:04:14.436025Z","iopub.status.idle":"2023-02-18T17:04:59.049775Z","shell.execute_reply.started":"2023-02-18T17:04:14.435969Z","shell.execute_reply":"2023-02-18T17:04:59.048420Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!rm -rf TCVC-Temporally-Consistent-Video-Colorization","metadata":{"execution":{"iopub.status.busy":"2023-02-18T17:11:48.850004Z","iopub.execute_input":"2023-02-18T17:11:48.850349Z","iopub.status.idle":"2023-02-18T17:11:50.026866Z","shell.execute_reply.started":"2023-02-18T17:11:48.850289Z","shell.execute_reply":"2023-02-18T17:11:50.025876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}