项目作者: thesigmaguy

项目描述 :
Context Encoder
高级语言: Python
项目地址: git://github.com/thesigmaguy/context_encoder.git
创建时间: 2020-03-31T06:48:36Z
项目社区:https://github.com/thesigmaguy/context_encoder

开源协议:

下载


Project : Context Encoders: Feature Learning by Inpainting


Folder structure and instructions

The folder structure for the code is :

  1. .
  2. ├── generator.py # Generator Network
  3. ├── discriminator.py # Discriminator network
  4. ├── run_test.bash # Bash File (runs the test, Check contents for args to be passed
  5. ├── run_train.bash # Bash File (runs the train, Check contents for args to be passed)
  6. ├── data_loader.py # Image data loader
  7. ├── context_encoder.py # Train Module
  8. ├── context_encoder_test.py # Test module needs checkpoint as input
  9. ├── random_crop # Train on random crops
  10. ├── generator.py
  11. ├── data_loader.py
  12. ├── discriminator.py
  13. ├── context_encoder.py
  14. └── random_crop_epoch_results # Results of random crops on train (around 4000 epochs)
  15. ├── paris_epoch_results_gifs # Gifs from progress of epochs
  16. └── split_images # split-images obtained from image_spliter.py
  17. ├── paris_eval_results # Obained results on eval data
  18. ├── paris_eval # paris data eval set (get data from Pathak)
  19. ├── mid_eval_submissions # submission folder for mid eval (project)
  20. └── images # Random crop on CIFAR10
  21. ├── paris_train # train images needs to be here (get data from Pathak)
  22. ├── log # Logs
  23. ├── cat_dataset_results # Results on Cat Dataset
  24. ├── final_eval_submission # submission folder for final eval (project)
  25. ├── misc
  26. ├── image_splitter.py # batch image spliter
  27. ├── gifmaker.py # gif maker
  28. └── run_help # misc
  29. ├── run.md # describes how to run the code
  30. ├── check_points # checkpoint saved
  31. ├── README.md # Readme
  32. └── paris_epoch_results # Epcoh wise one batch results

before cloning repo install git lfs as the repo includes check_point.pt which is over 800MB

Results over the paris dataset

The sample results of the dataset along with the ground truth and the cropped-out region. Top is the cropped image input to the generator and the middle is the output of the generator and last image shows the ground truth.
Some of the results obtained on Paris Dataset

epoch results
epoch results
epoch results
epoch results


Gifs illustrating Epoch-wise improvements

Epoch Gif
Epoch Gif
Epoch Gif
Epoch Gif

Graphs of the train and validation losses across the epochs

Loss Graph

Results over cat dataset

Some of the results obtained on Cat dataset

CAT
CAT
CAT
CAT
CAT
CAT

Paris_dataset

Note:

The Paris Building Dataset cannot be made publicly available. Access to dataset can be obtained via mailing the original paper authors: Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell & Alexei A. Efros.

[Code for plots]

(https://colab.research.google.com/drive/1qHWsU9b6sVo0FfPebkF1GWZlLIpI-Cs0)

[Presentation]

(https://docs.google.com/presentation/d/1QF8oylaEKNHnNxCboERB1qOtrI7GsiZj1sY1es17YgM/edit?usp=sharing)

System Setup

Modules

python == 3.7

pytorch == 1.4

cudatoolkit == 10.1

pygifsicle

System Config and time to train

CPU Ryzen 5 3600

GPU GTX 1080ti 11GB

RAM 16GB 3600MHz

Random Crops around 4100 epochs took 32 Hrs

Center Crops around 200 epochs took 2hr 30min