{"id":13521523,"url":"https://github.com/thunil/TecoGAN","last_synced_at":"2025-03-31T20:32:08.058Z","repository":{"id":37396872,"uuid":"174698235","full_name":"thunil/TecoGAN","owner":"thunil","description":"This repo contains source code and materials for the TEmporally COherent GAN SIGGRAPH project.","archived":false,"fork":false,"pushed_at":"2023-08-17T20:55:56.000Z","size":20355,"stargazers_count":5991,"open_issues_count":88,"forks_count":1137,"subscribers_count":182,"default_branch":"master","last_synced_at":"2024-10-29T15:43:27.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thunil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-03-09T13:31:26.000Z","updated_at":"2024-10-29T07:24:23.000Z","dependencies_parsed_at":"2022-07-08T16:47:12.479Z","dependency_job_id":"c0874dfe-dd73-4d8a-8b40-4fb9f63871cd","html_url":"https://github.com/thunil/TecoGAN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunil%2FTecoGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunil%2FTecoGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunil%2FTecoGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunil%2FTecoGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thunil","download_url":"https://codeload.github.com/thunil/TecoGAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222679160,"owners_count":17021812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:00:35.483Z","updated_at":"2024-11-02T05:31:38.466Z","avatar_url":"https://github.com/thunil.png","language":"Python","funding_links":[],"categories":["好玩项目","Python"],"sub_categories":["黑科技"],"readme":"# TecoGAN\nThis repository contains source code and materials for the TecoGAN project, i.e. code for a TEmporally COherent GAN for video super-resolution.\n_Authors: Mengyu Chu, You Xie, Laura Leal-Taixe, Nils Thuerey. Technical University of Munich._\n\nThis repository so far contains the code for the TecoGAN _inference_ and _training_, and downloading the training data.\nPre-trained models are also available below, you can find links for downloading and instructions below.\nThis work was published in the ACM Transactions on Graphics as \"Learning Temporal Coherence via Self-Supervision for GAN-based Video Generation (TecoGAN)\", https://doi.org/10.1145/3386569.3392457. The video and pre-print can be found here:\n\nVideo: \u003chttps://www.youtube.com/watch?v=pZXFXtfd-Ak\u003e\nPreprint: \u003chttps://arxiv.org/pdf/1811.09393.pdf\u003e\nSupplemental results: \u003chttps://ge.in.tum.de/wp-content/uploads/2020/05/ClickMe.html\u003e\n\n![TecoGAN teaser image](resources/teaser.jpg)\n\n### Additional Generated Outputs\n\nOur method generates fine details that \npersist over the course of long generated video sequences. E.g., the mesh structures of the armor,\nthe scale patterns of the lizard, and the dots on the back of the spider highlight the capabilities of our method.\nOur spatio-temporal discriminator plays a key role to guide the generator network towards producing coherent detail.\n\n\u003cimg src=\"resources/tecoGAN-lizard.gif\" alt=\"Lizard\" width=\"900\"/\u003e\u003cbr\u003e\n\n\u003cimg src=\"resources/tecoGAN-armour.gif\" alt=\"Armor\" width=\"900\"/\u003e\u003cbr\u003e\n\n\u003cimg src=\"resources/tecoGAN-spider.gif\" alt=\"Spider\" width=\"600\" hspace=\"150\"/\u003e\u003cbr\u003e\n\n### Running the TecoGAN Model\n\nBelow you can find a quick start guide for running a trained TecoGAN model.\nFor further explanations of the parameters take a look at the runGan.py file.  \nNote: evaluation (test case 2) currently requires an Nvidia GPU with `CUDA`. \n`tkinter` is also required and may be installed via the `python3-tk` package.\n\n```bash\n# Install tensorflow1.8+,\npip3 install --ignore-installed --upgrade tensorflow-gpu # or tensorflow\n# Install PyTorch (only necessary for the metric evaluations) and other things...\npip3 install -r requirements.txt\n\n# Download our TecoGAN model, the _Vid4_ and _TOS_ scenes shown in our paper and video.\npython3 runGan.py 0\n\n# Run the inference mode on the calendar scene.\n# You can take a look of the parameter explanations in the runGan.py, feel free to try other scenes!\npython3 runGan.py 1 \n\n# Evaluate the results with 4 metrics, PSNR, LPIPS[1], and our temporal metrics tOF and tLP with pytorch.\n# Take a look at the paper for more details! \npython3 runGan.py 2\n\n```\n\n### Train the TecoGAN Model\n\n#### 1. Prepare the Training Data\n\nThe training and validation dataset can be downloaded with the following commands into a chosen directory `TrainingDataPath`.  Note: online video downloading requires youtube-dl.  \n\n```bash\n# Install youtube-dl for online video downloading\npip install --user --upgrade youtube-dl\n\n# take a look of the parameters first:\npython3 dataPrepare.py --help\n\n# To be on the safe side, if you just want to see what will happen, the following line won't download anything,\n# and will only save information into log file.\n# TrainingDataPath is still important, it the directory where logs are saved: TrainingDataPath/log/logfile_mmddHHMM.txt\npython3 dataPrepare.py --start_id 2000 --duration 120 --disk_path TrainingDataPath --TEST\n\n# This will create 308 subfolders under TrainingDataPath, each with 120 frames, from 28 online videos.\n# It takes a long time.\npython3 dataPrepare.py --start_id 2000 --duration 120 --REMOVE --disk_path TrainingDataPath\n\n\n```\n\nOnce ready, please update the parameter TrainingDataPath in runGAN.py (for case 3 and case 4), and then you can start training with the downloaded data! \n\nNote: most of the data (272 out of 308 sequences) are the same as the ones we used for the published models, but some (36 out of 308) are not online anymore. Hence the script downloads suitable replacements.\n\n\n#### 2. Train the Model  \nThis section gives command to train a new TecoGAN model. Detail and additional parameters can be found in the runGan.py file. Note: the tensorboard gif summary requires ffmpeg.\n\n```bash\n# Install ffmpeg for the  gif summary\nsudo apt-get install ffmpeg # or conda install ffmpeg\n\n# Train the TecoGAN model, based on our FRVSR model\n# Please check and update the following parameters: \n# - VGGPath, it uses ./model/ by default. The VGG model is ca. 500MB\n# - TrainingDataPath (see above)\n# - in main.py you can also adjust the output directory of the  testWhileTrain() function if you like (it will write into a train/ sub directory by default)\npython3 runGan.py 3\n\n# Train without Dst, (i.e. a FRVSR model)\npython3 runGan.py 4\n\n# View log via tensorboard\ntensorboard --logdir='ex_TecoGANmm-dd-hh/log' --port=8008\n\n```\n\n### Tensorboard GIF Summary Example\n\u003cimg src=\"resources/gif_summary_example.gif\" alt=\"gif_summary_example\" width=\"600\" hspace=\"150\"/\u003e\u003cbr\u003e\n\n### Acknowledgements\nThis work was funded by the ERC Starting Grant realFlow (ERC StG-2015-637014).  \nPart of the code is based on LPIPS[1], Photo-Realistic SISR[2] and gif_summary[3].\n\n### Reference\n[1] [The Unreasonable Effectiveness of Deep Features as a Perceptual Metric (LPIPS)](https://github.com/richzhang/PerceptualSimilarity)  \n[2] [Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network](https://github.com/brade31919/SRGAN-tensorflow.git)  \n[3] [gif_summary](https://colab.research.google.com/drive/1vgD2HML7Cea_z5c3kPBcsHUIxaEVDiIc)\n\nTUM I15 \u003chttps://ge.in.tum.de/\u003e , TUM \u003chttps://www.tum.de/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunil%2FTecoGAN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthunil%2FTecoGAN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunil%2FTecoGAN/lists"}