├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── data-demo
├── image_meta.csv
└── synthetic_images
│ ├── .DS_Store
│ └── aged_images
│ ├── 18_seed0002.png
│ ├── 18_seed0003.png
│ ├── 18_seed0004.png
│ ├── 18_seed0005.png
│ ├── 18_seed0006.png
│ ├── 18_seed0007.png
│ ├── 18_seed0008.png
│ ├── 18_seed0009.png
│ ├── 18_seed0010.png
│ ├── 18_seed0011.png
│ ├── 23_seed0002.png
│ ├── 23_seed0003.png
│ ├── 23_seed0004.png
│ ├── 23_seed0005.png
│ ├── 23_seed0006.png
│ ├── 23_seed0007.png
│ ├── 23_seed0008.png
│ ├── 23_seed0009.png
│ ├── 23_seed0010.png
│ ├── 23_seed0011.png
│ ├── 28_seed0002.png
│ ├── 28_seed0003.png
│ ├── 28_seed0004.png
│ ├── 28_seed0005.png
│ ├── 28_seed0006.png
│ ├── 28_seed0007.png
│ ├── 28_seed0008.png
│ ├── 28_seed0009.png
│ ├── 28_seed0010.png
│ ├── 28_seed0011.png
│ ├── 33_seed0002.png
│ ├── 33_seed0003.png
│ ├── 33_seed0004.png
│ ├── 33_seed0005.png
│ ├── 33_seed0006.png
│ ├── 33_seed0007.png
│ ├── 33_seed0008.png
│ ├── 33_seed0009.png
│ ├── 33_seed0010.png
│ ├── 33_seed0011.png
│ ├── 38_seed0002.png
│ ├── 38_seed0003.png
│ ├── 38_seed0004.png
│ ├── 38_seed0005.png
│ ├── 38_seed0006.png
│ ├── 38_seed0007.png
│ ├── 38_seed0008.png
│ ├── 38_seed0009.png
│ ├── 38_seed0010.png
│ ├── 38_seed0011.png
│ ├── 43_seed0002.png
│ ├── 43_seed0003.png
│ ├── 43_seed0004.png
│ ├── 43_seed0005.png
│ ├── 43_seed0006.png
│ ├── 43_seed0007.png
│ ├── 43_seed0008.png
│ ├── 43_seed0009.png
│ ├── 43_seed0010.png
│ ├── 43_seed0011.png
│ ├── 48_seed0002.png
│ ├── 48_seed0003.png
│ ├── 48_seed0004.png
│ ├── 48_seed0005.png
│ ├── 48_seed0006.png
│ ├── 48_seed0007.png
│ ├── 48_seed0008.png
│ ├── 48_seed0009.png
│ ├── 48_seed0010.png
│ ├── 48_seed0011.png
│ ├── 53_seed0002.png
│ ├── 53_seed0003.png
│ ├── 53_seed0004.png
│ ├── 53_seed0005.png
│ ├── 53_seed0006.png
│ ├── 53_seed0007.png
│ ├── 53_seed0008.png
│ ├── 53_seed0009.png
│ ├── 53_seed0010.png
│ ├── 53_seed0011.png
│ ├── 58_seed0002.png
│ ├── 58_seed0003.png
│ ├── 58_seed0004.png
│ ├── 58_seed0005.png
│ ├── 58_seed0006.png
│ ├── 58_seed0007.png
│ ├── 58_seed0008.png
│ ├── 58_seed0009.png
│ ├── 58_seed0010.png
│ ├── 58_seed0011.png
│ ├── 63_seed0002.png
│ ├── 63_seed0003.png
│ ├── 63_seed0004.png
│ ├── 63_seed0005.png
│ ├── 63_seed0006.png
│ ├── 63_seed0007.png
│ ├── 63_seed0008.png
│ ├── 63_seed0009.png
│ ├── 63_seed0010.png
│ ├── 63_seed0011.png
│ ├── 68_seed0002.png
│ ├── 68_seed0003.png
│ ├── 68_seed0004.png
│ ├── 68_seed0005.png
│ ├── 68_seed0006.png
│ ├── 68_seed0007.png
│ ├── 68_seed0008.png
│ ├── 68_seed0009.png
│ ├── 68_seed0010.png
│ ├── 68_seed0011.png
│ ├── 73_seed0002.png
│ ├── 73_seed0003.png
│ ├── 73_seed0004.png
│ ├── 73_seed0005.png
│ ├── 73_seed0006.png
│ ├── 73_seed0007.png
│ ├── 73_seed0008.png
│ ├── 73_seed0009.png
│ ├── 73_seed0010.png
│ ├── 73_seed0011.png
│ ├── 78_seed0002.png
│ ├── 78_seed0003.png
│ ├── 78_seed0004.png
│ ├── 78_seed0005.png
│ ├── 78_seed0006.png
│ ├── 78_seed0007.png
│ ├── 78_seed0008.png
│ ├── 78_seed0009.png
│ ├── 78_seed0010.png
│ ├── 78_seed0011.png
│ ├── 83_seed0002.png
│ ├── 83_seed0003.png
│ ├── 83_seed0004.png
│ ├── 83_seed0005.png
│ ├── 83_seed0006.png
│ ├── 83_seed0007.png
│ ├── 83_seed0008.png
│ ├── 83_seed0009.png
│ ├── 83_seed0010.png
│ └── 83_seed0011.png
├── datasets
├── __init__.py
├── augmentations.py
└── fran_dataset.py
├── example-images
├── input_example_img.png
└── output_example_img.png
├── fran_colab_notebook.ipynb
├── models
├── __init__.py
├── descriminator.py
└── generator.py
├── requirements.txt
├── train.py
└── training
├── __init__.py
└── trainer.py
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.py linguist-detectable=true
2 | *.ipynb linguist-detectable=false
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | share/python-wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 | MANIFEST
28 |
29 | # PyInstaller
30 | # Usually these files are written by a python script from a template
31 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
32 | *.manifest
33 | *.spec
34 |
35 | # Installer logs
36 | pip-log.txt
37 | pip-delete-this-directory.txt
38 |
39 | # Unit test / coverage reports
40 | htmlcov/
41 | .tox/
42 | .nox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *.cover
49 | *.py,cover
50 | .hypothesis/
51 | .pytest_cache/
52 | cover/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | .pybuilder/
76 | target/
77 |
78 | # Jupyter Notebook
79 | .ipynb_checkpoints
80 |
81 | # IPython
82 | profile_default/
83 | ipython_config.py
84 |
85 | # pyenv
86 | # For a library or package, you might want to ignore these files since the code is
87 | # intended to run in multiple environments; otherwise, check them in:
88 | # .python-version
89 |
90 | # pipenv
91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
94 | # install all needed dependencies.
95 | #Pipfile.lock
96 |
97 | # poetry
98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99 | # This is especially recommended for binary packages to ensure reproducibility, and is more
100 | # commonly ignored for libraries.
101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102 | #poetry.lock
103 |
104 | # pdm
105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106 | #pdm.lock
107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108 | # in version control.
109 | # https://pdm.fming.dev/#use-with-ide
110 | .pdm.toml
111 |
112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113 | __pypackages__/
114 |
115 | # Celery stuff
116 | celerybeat-schedule
117 | celerybeat.pid
118 |
119 | # SageMath parsed files
120 | *.sage.py
121 |
122 | # Environments
123 | .env
124 | .venv
125 | env/
126 | venv/
127 | ENV/
128 | env.bak/
129 | venv.bak/
130 |
131 | # Spyder project settings
132 | .spyderproject
133 | .spyproject
134 |
135 | # Rope project settings
136 | .ropeproject
137 |
138 | # mkdocs documentation
139 | /site
140 |
141 | # mypy
142 | .mypy_cache/
143 | .dmypy.json
144 | dmypy.json
145 |
146 | # Pyre type checker
147 | .pyre/
148 |
149 | # pytype static type analyzer
150 | .pytype/
151 |
152 | # Cython debug symbols
153 | cython_debug/
154 |
155 | # PyCharm
156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158 | # and can be added to the global gitignore or merged into this file. For a more nuclear
159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160 | #.idea/
161 | .DS_Store
162 |
163 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Ryan Lu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PyTorch Face Re-aging Network (FRAN)
2 |
3 |
4 |
5 |  |
6 |  |
7 |
8 |
9 |
10 |
11 | An unofficial PyTorch implementation of Disney's face re-aging network (FRAN) paper.
12 |
13 | Paper Link: [link](https://studios.disneyresearch.com/2022/11/30/production-ready-face-re-aging-for-visual-effects/)
14 |
15 | Dataset Link (collected according to the paper): [link](https://www.kaggle.com/datasets/penpentled/aged-synthetic-images)
16 |
17 | ## Setup
18 | Python 3.12.2
19 |
20 | ```console
21 | > pip install -r requirements.txt
22 | ```
23 |
24 | For full training, download all 2000 subjects from the dataset link.
25 |
26 | ## Training
27 | See Colab Notebook or train a new model by
28 | ```console
29 | > python train.py -h
30 | usage: train.py [-h] [--data_dir DATA_DIR]
31 |
32 | Train FRAN model.
33 |
34 | options:
35 | -h, --help show this help message and exit
36 | --data_dir DATA_DIR, -C DATA_DIR
37 | directory for data
38 |
39 | > python train.py
40 |
41 | Using 16bit Automatic Mixed Precision (AMP)
42 | GPU available: True (mps), used: True
43 | TPU available: False, using: 0 TPU cores
44 | IPU available: False, using: 0 IPUs
45 | HPU available: False, using: 0 HPUs
46 |
47 | | Name | Type | Params
48 | --------------------------------------------------------
49 | 0 | generator | Generator | 31.4 M
50 | 1 | discriminator | PatchGANDiscriminator | 1.6 M
51 | --------------------------------------------------------
52 | 32.9 M Trainable params
53 | 0 Non-trainable params
54 | 32.9 M Total params
55 | 131.800 Total estimated model params size (MB)
56 | Epoch 0: 0%| | 0/228 [00:00, ?it/s]
57 | ```
58 |
59 | ## Showcase
60 | Applying the model + naive crop and masking.
61 | Model was trained on a single V100 for 6 hours in Google Colab.
62 |
63 | [Hugging Face Spaces](https://huggingface.co/spaces/penpen/age-transformation)
64 |
65 | # Notes
66 | Why does the image turn grainy/pixelated sometimes?
67 |
68 | Model encountered an unfamilar face. More diverse data may help resolve this problem.
69 |
70 | Model is noticably worse with turning old people to young.
71 |
72 |
--------------------------------------------------------------------------------
/data-demo/image_meta.csv:
--------------------------------------------------------------------------------
1 | image_18,image_23,image_28,image_33,image_38,image_43,image_48,image_53,image_58,image_63,image_68,image_73,image_78,image_83
2 | aged_images/18_seed0002.png,aged_images/23_seed0002.png,aged_images/28_seed0002.png,aged_images/33_seed0002.png,aged_images/38_seed0002.png,aged_images/43_seed0002.png,aged_images/48_seed0002.png,aged_images/53_seed0002.png,aged_images/58_seed0002.png,aged_images/63_seed0002.png,aged_images/68_seed0002.png,aged_images/73_seed0002.png,aged_images/78_seed0002.png,aged_images/83_seed0002.png
3 | aged_images/18_seed0003.png,aged_images/23_seed0003.png,aged_images/28_seed0003.png,aged_images/33_seed0003.png,aged_images/38_seed0003.png,aged_images/43_seed0003.png,aged_images/48_seed0003.png,aged_images/53_seed0003.png,aged_images/58_seed0003.png,aged_images/63_seed0003.png,aged_images/68_seed0003.png,aged_images/73_seed0003.png,aged_images/78_seed0003.png,aged_images/83_seed0003.png
4 | aged_images/18_seed0004.png,aged_images/23_seed0004.png,aged_images/28_seed0004.png,aged_images/33_seed0004.png,aged_images/38_seed0004.png,aged_images/43_seed0004.png,aged_images/48_seed0004.png,aged_images/53_seed0004.png,aged_images/58_seed0004.png,aged_images/63_seed0004.png,aged_images/68_seed0004.png,aged_images/73_seed0004.png,aged_images/78_seed0004.png,aged_images/83_seed0004.png
5 | aged_images/18_seed0005.png,aged_images/23_seed0005.png,aged_images/28_seed0005.png,aged_images/33_seed0005.png,aged_images/38_seed0005.png,aged_images/43_seed0005.png,aged_images/48_seed0005.png,aged_images/53_seed0005.png,aged_images/58_seed0005.png,aged_images/63_seed0005.png,aged_images/68_seed0005.png,aged_images/73_seed0005.png,aged_images/78_seed0005.png,aged_images/83_seed0005.png
6 | aged_images/18_seed0006.png,aged_images/23_seed0006.png,aged_images/28_seed0006.png,aged_images/33_seed0006.png,aged_images/38_seed0006.png,aged_images/43_seed0006.png,aged_images/48_seed0006.png,aged_images/53_seed0006.png,aged_images/58_seed0006.png,aged_images/63_seed0006.png,aged_images/68_seed0006.png,aged_images/73_seed0006.png,aged_images/78_seed0006.png,aged_images/83_seed0006.png
7 | aged_images/18_seed0007.png,aged_images/23_seed0007.png,aged_images/28_seed0007.png,aged_images/33_seed0007.png,aged_images/38_seed0007.png,aged_images/43_seed0007.png,aged_images/48_seed0007.png,aged_images/53_seed0007.png,aged_images/58_seed0007.png,aged_images/63_seed0007.png,aged_images/68_seed0007.png,aged_images/73_seed0007.png,aged_images/78_seed0007.png,aged_images/83_seed0007.png
8 | aged_images/18_seed0008.png,aged_images/23_seed0008.png,aged_images/28_seed0008.png,aged_images/33_seed0008.png,aged_images/38_seed0008.png,aged_images/43_seed0008.png,aged_images/48_seed0008.png,aged_images/53_seed0008.png,aged_images/58_seed0008.png,aged_images/63_seed0008.png,aged_images/68_seed0008.png,aged_images/73_seed0008.png,aged_images/78_seed0008.png,aged_images/83_seed0008.png
9 | aged_images/18_seed0009.png,aged_images/23_seed0009.png,aged_images/28_seed0009.png,aged_images/33_seed0009.png,aged_images/38_seed0009.png,aged_images/43_seed0009.png,aged_images/48_seed0009.png,aged_images/53_seed0009.png,aged_images/58_seed0009.png,aged_images/63_seed0009.png,aged_images/68_seed0009.png,aged_images/73_seed0009.png,aged_images/78_seed0009.png,aged_images/83_seed0009.png
10 | aged_images/18_seed0010.png,aged_images/23_seed0010.png,aged_images/28_seed0010.png,aged_images/33_seed0010.png,aged_images/38_seed0010.png,aged_images/43_seed0010.png,aged_images/48_seed0010.png,aged_images/53_seed0010.png,aged_images/58_seed0010.png,aged_images/63_seed0010.png,aged_images/68_seed0010.png,aged_images/73_seed0010.png,aged_images/78_seed0010.png,aged_images/83_seed0010.png
11 | aged_images/18_seed0011.png,aged_images/23_seed0011.png,aged_images/28_seed0011.png,aged_images/33_seed0011.png,aged_images/38_seed0011.png,aged_images/43_seed0011.png,aged_images/48_seed0011.png,aged_images/53_seed0011.png,aged_images/58_seed0011.png,aged_images/63_seed0011.png,aged_images/68_seed0011.png,aged_images/73_seed0011.png,aged_images/78_seed0011.png,aged_images/83_seed0011.png
12 |
--------------------------------------------------------------------------------
/data-demo/synthetic_images/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/.DS_Store
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/18_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/18_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/23_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/23_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/28_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/28_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/33_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/33_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/38_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/38_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/43_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/43_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/48_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/48_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/53_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/53_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/58_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/58_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/63_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/63_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/68_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/68_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/73_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/73_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/78_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/78_seed0011.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0002.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0003.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0004.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0005.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0006.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0007.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0008.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0009.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0010.png
--------------------------------------------------------------------------------
/data-demo/synthetic_images/aged_images/83_seed0011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/data-demo/synthetic_images/aged_images/83_seed0011.png
--------------------------------------------------------------------------------
/datasets/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/datasets/__init__.py
--------------------------------------------------------------------------------
/datasets/augmentations.py:
--------------------------------------------------------------------------------
1 | # Some augmentations
2 | import albumentations as A
3 | from albumentations.pytorch import ToTensorV2
4 |
5 | transform_normalize = A.ReplayCompose([
6 | A.Resize(512, 512),
7 | # Crop is really important
8 | A.RandomCrop(256, 256),
9 | A.ColorJitter(p=0.8),
10 | A.Blur(p=0.1),
11 | A.RandomBrightnessContrast(),
12 | A.Affine(rotate=[-30, 30],scale=(0.5,1.5), p=0.8),
13 | ToTensorV2(),
14 | ])
15 |
--------------------------------------------------------------------------------
/datasets/fran_dataset.py:
--------------------------------------------------------------------------------
1 |
2 | import torch
3 | from torch.utils.data import Dataset
4 | from PIL import Image
5 | import numpy as np
6 | import albumentations as A
7 | from itertools import permutations
8 |
9 | TARGET_AGES = [18,23,28,33,38,43,48,53,58,63,68,73,78,83]
10 |
11 | def generate_image_pairs(image_meta):
12 | """List of all possible age transitions for a person."""
13 | image_pairs = []
14 | for _, row in image_meta.iterrows():
15 | image_paths = row.tolist()
16 | image_combinations = permutations(image_paths, 2)
17 | image_pairs.extend(list(image_combinations))
18 | return image_pairs
19 |
20 | def generate_age_image_dict(image_meta):
21 | """
22 | Returns:
23 | image_age_dict: {image path:age}
24 | """
25 | image_age_dict={}
26 | for target_age, column in zip(TARGET_AGES,image_meta.columns):
27 | image_age_dict.update({path:target_age for path in image_meta[column].values})
28 | return image_age_dict
29 |
30 | class FRANDataset(Dataset):
31 | def __init__(
32 | self,
33 | image_meta,
34 | transforms,
35 | data_dir,
36 | ):
37 | self.image_pairs = generate_image_pairs(image_meta)
38 | self.image_ages_dict = generate_age_image_dict(image_meta)
39 | self.transforms = transforms
40 | self.data_dir = data_dir
41 |
42 | def __len__(self):
43 | return len(self.image_pairs)
44 |
45 | def __getitem__(self, index):
46 | image_pair = self.image_pairs[index]
47 |
48 | input_image = np.array(Image.open(self.data_dir/image_pair[0]).convert('RGB'))
49 | target_image = np.array(Image.open(self.data_dir/image_pair[1]).convert('RGB'))
50 |
51 | normalized_input_image_transformed = self.transforms(image=input_image)
52 | # Basic normalization
53 | normalized_input_image = normalized_input_image_transformed['image']/127.5 - 1
54 |
55 | # Replay augmentations on second image
56 | normalized_target_image = A.ReplayCompose.replay(
57 | normalized_input_image_transformed['replay'],
58 | image=np.array(target_image),
59 | )['image']/127.5 - 1
60 |
61 | # Get age maps of both images
62 | _,width,height=normalized_input_image.shape
63 | age_map1 = torch.full((1,width,height),self.image_ages_dict[image_pair[0]]/100)
64 | age_map2 = torch.full((1,width,height),self.image_ages_dict[image_pair[1]]/100)
65 |
66 | # Combine RGB delta diff with age maps for 5-channel tensor
67 | input_tensor = torch.cat((normalized_input_image, age_map1, age_map2), dim=0)
68 |
69 | return {
70 | 'input': input_tensor,
71 | 'normalized_input_image': normalized_input_image,
72 | 'normalized_target_image': normalized_target_image,
73 | 'target_age': age_map2,
74 | }
--------------------------------------------------------------------------------
/example-images/input_example_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/example-images/input_example_img.png
--------------------------------------------------------------------------------
/example-images/output_example_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/example-images/output_example_img.png
--------------------------------------------------------------------------------
/models/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/models/__init__.py
--------------------------------------------------------------------------------
/models/descriminator.py:
--------------------------------------------------------------------------------
1 | # Simple Discriminator
2 | import kornia
3 | import torch.nn as nn
4 | import torch.nn.functional as F
5 |
6 | class PatchGANDiscriminator(nn.Module):
7 | def __init__(self):
8 | super(PatchGANDiscriminator, self).__init__()
9 | self.conv0 = nn.Conv2d(4, 64, kernel_size=3, stride=1, padding=1)
10 | self.bn1 = nn.BatchNorm2d(64)
11 | self.leakyrelu = nn.LeakyReLU(inplace=True)
12 | self.maxblurpool = kornia.filters.MaxBlurPool2D(kernel_size=3)
13 | self.conv2 = nn.Conv2d(64, 128, kernel_size=3, stride=1, padding=1)
14 | self.bn2 = nn.BatchNorm2d(128)
15 | self.conv3 = nn.Conv2d(128, 256, kernel_size=3, stride=1, padding=1)
16 | self.bn3 = nn.BatchNorm2d(256)
17 | self.conv4 = nn.Conv2d(256, 512, kernel_size=3, stride=1, padding=1)
18 | self.bn4 = nn.BatchNorm2d(512)
19 | self.conv5 = nn.Conv2d(512, 1, kernel_size=3, stride=1, padding=1)
20 |
21 | def forward(self, x):
22 | x = self.conv0(x)
23 | x = self.bn1(x)
24 | x = self.leakyrelu(x)
25 | x = self.maxblurpool(x)
26 | x = self.conv2(x)
27 | x = self.bn2(x)
28 | x = self.leakyrelu(x)
29 | x = self.maxblurpool(x)
30 | x = self.conv3(x)
31 | x = self.bn3(x)
32 | x = self.leakyrelu(x)
33 | x = self.maxblurpool(x)
34 | x = self.conv4(x)
35 | x = self.bn4(x)
36 | x = self.leakyrelu(x)
37 | x = self.conv5(x)
38 |
39 | return x
--------------------------------------------------------------------------------
/models/generator.py:
--------------------------------------------------------------------------------
1 | import kornia
2 | import torch.nn as nn
3 | import torch
4 | import torch.nn.functional as F
5 |
6 | class BlurUpSample(nn.Module):
7 | def __init__(self, c):
8 | super(BlurUpSample, self).__init__()
9 | self.blurpool = kornia.filters.GaussianBlur2d((3, 3), (1.5, 1.5))
10 | self.upsample = nn.Upsample(
11 | scale_factor=(2, 2),
12 | mode='bilinear',
13 | align_corners=False)
14 |
15 | def forward(self, x):
16 | x = self.blurpool(x)
17 | x = self.upsample(x)
18 |
19 | return x
20 |
21 | class DownLayer(nn.Module):
22 | def __init__(self, c_in, c_out):
23 | super(DownLayer, self).__init__()
24 |
25 | # kornia's version of MaxBlurpool
26 | self.maxblurpool = kornia.filters.MaxBlurPool2D(kernel_size=3)
27 |
28 | self.conv1 = nn.Conv2d(c_in, c_out, kernel_size=3, stride=1, padding=1)
29 | self.bn1 = nn.BatchNorm2d(c_out)
30 | self.leakyrelu = nn.LeakyReLU(inplace=True)
31 | self.conv2 = nn.Conv2d(c_out, c_out, kernel_size=3, stride=1, padding=1)
32 | self.bn2 = nn.BatchNorm2d(c_out)
33 |
34 | def forward(self, x):
35 | x = self.maxblurpool(x)
36 | x = self.conv1(x)
37 | x = self.bn1(x)
38 | x = self.leakyrelu(x)
39 | x = self.conv2(x)
40 | x = self.bn2(x)
41 | x = self.leakyrelu(x)
42 | return x
43 |
44 |
45 | class UpLayer(nn.Module):
46 | def __init__(self, c_in, c_out):
47 | super(UpLayer, self).__init__()
48 | self.upsample = BlurUpSample(c_in)
49 | self.conv1 = nn.Conv2d(c_in+ c_out, c_out, kernel_size=3, stride=1, padding=1)
50 | self.bn1 = nn.BatchNorm2d(c_out)
51 | self.leakyrelu = nn.LeakyReLU(inplace=True)
52 | self.conv2 = nn.Conv2d(c_out, c_out, kernel_size=3, stride=1, padding=1)
53 | self.bn2 = nn.BatchNorm2d(c_out)
54 |
55 | def forward(self, x, skip_x):
56 | x = self.upsample(x)
57 |
58 | dh = skip_x.size(2) - x.size(2)
59 | dw = skip_x.size(3) - x.size(3)
60 |
61 | x = F.pad(x, (dw // 2, dw - dw // 2, dh // 2, dh - dh // 2))
62 |
63 | x = torch.cat([x, skip_x], dim=1)
64 |
65 | x = self.conv1(x)
66 | x = self.bn1(x)
67 | x = self.leakyrelu(x)
68 | x = self.conv2(x)
69 | x = self.bn2(x)
70 | x = self.leakyrelu(x)
71 | return x
72 |
73 | # FRAN Unet Model
74 | class Generator(nn.Module):
75 | def __init__(self):
76 | super(Generator, self).__init__()
77 | self.conv1 = nn.Conv2d(5, 64, kernel_size=3, stride=1, padding=1)
78 | self.conv2 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=1)
79 | self.batchnorm1 = nn.BatchNorm2d(64)
80 | self.leakyrelu = nn.LeakyReLU(inplace=True)
81 | self.downlayer1 = DownLayer(64, 128)
82 | self.downlayer2 = DownLayer(128, 256)
83 | self.downlayer3 = DownLayer(256, 512)
84 | self.downlayer4 = DownLayer(512, 1024)
85 | self.uplayer1 = UpLayer(1024, 512)
86 | self.uplayer2 = UpLayer(512, 256)
87 | self.uplayer3 = UpLayer(256, 128)
88 | self.uplayer4 = UpLayer(128, 64)
89 | self.conv3 = nn.Conv2d(64, 3, kernel_size=1, stride=1, padding=0)
90 |
91 | def forward(self, x):
92 | x1 = self.conv1(x)
93 | x1 = self.batchnorm1(x1)
94 | x1 = self.leakyrelu(x1)
95 | x1 = self.conv2(x1)
96 | x1 = self.batchnorm1(x1)
97 | x1 = self.leakyrelu(x1)
98 |
99 | # Downsampling
100 | x2 = self.downlayer1(x1)
101 | x3 = self.downlayer2(x2)
102 | x4 = self.downlayer3(x3)
103 | x5 = self.downlayer4(x4)
104 |
105 | # Upsampling with skip connections
106 | x = self.uplayer1(x5, x4)
107 | x = self.uplayer2(x, x3)
108 | x = self.uplayer3(x, x2)
109 | x = self.uplayer4(x, x1)
110 | x = self.conv3(x)
111 |
112 | return x
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | aiohttp==3.9.3
2 | aiosignal==1.3.1
3 | albumentations==1.4.3
4 | attrs==23.2.0
5 | filelock==3.13.3
6 | frozenlist==1.4.1
7 | fsspec==2024.3.1
8 | idna==3.6
9 | imageio==2.34.0
10 | Jinja2==3.1.3
11 | joblib==1.3.2
12 | kornia==0.7.2
13 | kornia_rs==0.1.3
14 | lazy_loader==0.4
15 | lightning-utilities==0.11.2
16 | MarkupSafe==2.1.5
17 | mpmath==1.3.0
18 | multidict==6.0.5
19 | networkx==3.3
20 | numpy==1.26.4
21 | opencv-python-headless==4.9.0.80
22 | packaging==24.0
23 | pandas==2.2.1
24 | pillow==10.3.0
25 | python-dateutil==2.9.0.post0
26 | pytorch-lightning==2.2.1
27 | pytz==2024.1
28 | PyYAML==6.0.1
29 | scikit-image==0.22.0
30 | scikit-learn==1.4.1.post1
31 | scipy==1.13.0
32 | setuptools==69.2.0
33 | six==1.16.0
34 | sympy==1.12
35 | threadpoolctl==3.4.0
36 | tifffile==2024.2.12
37 | torch==2.2.2
38 | torchmetrics==1.3.2
39 | tqdm==4.66.2
40 | typing_extensions==4.11.0
41 | tzdata==2024.1
42 | yarl==1.9.4
43 |
--------------------------------------------------------------------------------
/train.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | from pathlib import Path
3 | import warnings
4 |
5 | import pandas as pd
6 | import pytorch_lightning as pl
7 | from torch.utils.data import DataLoader
8 |
9 | from datasets.augmentations import transform_normalize
10 | from models.descriminator import PatchGANDiscriminator
11 | from models.generator import Generator
12 | from datasets.fran_dataset import FRANDataset
13 | from training.trainer import FRAN
14 |
15 | data_dir = Path('./data-demo/')
16 |
17 | def get_args():
18 | parser = argparse.ArgumentParser(description='Train FRAN model.')
19 | parser.add_argument('--data_dir', '-C', type=str, default=data_dir, help='directory for data')
20 | return parser.parse_args()
21 |
22 |
23 | if __name__ == '__main__':
24 | args = get_args()
25 | image_meta = pd.read_csv(args.data_dir / "image_meta.csv")
26 |
27 | train_dataset = FRANDataset(image_meta, transform_normalize, args.data_dir / "synthetic_images")
28 | dataloader = DataLoader(train_dataset, batch_size=8, shuffle=True, num_workers=2)
29 |
30 | fran_model = FRAN(Generator(), PatchGANDiscriminator())
31 | fran_trainer = pl.Trainer(
32 | precision='16-mixed',
33 | devices=1,
34 | max_epochs=6,
35 | callbacks =[pl.callbacks.ModelCheckpoint(
36 | every_n_train_steps=5000,
37 | dirpath=args.data_dir,
38 | filename='fran-{step:05d}',
39 | )]
40 | )
41 |
42 | fran_trainer.fit(fran_model, dataloader)
--------------------------------------------------------------------------------
/training/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ry-lu/pytorch-face-reaging-network/915d5acdc0fa15adda1b3a593d5188fc87a6e5c3/training/__init__.py
--------------------------------------------------------------------------------
/training/trainer.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from torch.nn.modules import BCEWithLogitsLoss
3 | import torch.optim as optim
4 | import matplotlib.pyplot as plt
5 | import pytorch_lightning as pl
6 | from piq import LPIPS
7 | import torch.nn as nn
8 |
9 | device = 'cuda' if torch.cuda.is_available() else 'cpu'
10 |
11 | # Basic losses
12 | adversarial_loss = BCEWithLogitsLoss()
13 | l1_loss = nn.L1Loss()
14 | perceptual_loss = LPIPS().to(device)
15 |
16 | # Default loss weights
17 | lambda_l1 = 1
18 | lambda_perceptual = 1
19 | lambda_adversarial = 0.05
20 |
21 | # Basic pl lightning module for checkpointing and logging
22 | class FRAN(pl.LightningModule):
23 | def __init__(self, generator, discriminator):
24 | super(FRAN, self).__init__()
25 | self.generator = generator
26 | self.discriminator =discriminator
27 | self.automatic_optimization = False
28 | self.my_step =0
29 |
30 | def forward(self, x):
31 | with torch.no_grad():
32 | model_output = self.generator(x)
33 | return model_output
34 |
35 | def training_step(self, batch, batch_idx):
36 | opt_g, opt_d = self.optimizers()
37 |
38 | opt_g.zero_grad()
39 | opt_d.zero_grad()
40 |
41 |
42 | inputs = batch['input'].to(self.device)
43 | normalized_input_image = batch['normalized_input_image'].to(self.device)
44 | normalized_target_image = batch['normalized_target_image'].to(self.device)
45 |
46 |
47 | target_age = batch['target_age'].to(self.device)
48 | # Forward pass
49 | outputs = self.generator(inputs)
50 |
51 | predicted_images = normalized_input_image+outputs
52 | predicted_images_with_age = torch.cat((predicted_images, target_age), dim=1)
53 |
54 | real_labels = torch.ones(inputs.shape[0], 1, 32, 32).to(self.device)
55 | fake_labels = torch.zeros(inputs.shape[0], 1, 32, 32).to(self.device)
56 |
57 | # Compute discriminator losses
58 | real_loss = adversarial_loss(self.discriminator(torch.cat((normalized_target_image, target_age), dim=1)), real_labels)
59 | fake_loss = adversarial_loss(self.discriminator(predicted_images_with_age.detach()), fake_labels)
60 |
61 | d_loss = (real_loss+fake_loss) / 2
62 |
63 | self.manual_backward(d_loss)
64 | opt_d.step()
65 |
66 | # Compute generator loss
67 | l1_loss_value = l1_loss(predicted_images, normalized_target_image)
68 | perceptual_loss_value = perceptual_loss(predicted_images, normalized_target_image)
69 | adversarial_loss_value = adversarial_loss(self.discriminator(predicted_images_with_age), real_labels)
70 |
71 | total_loss = lambda_adversarial*adversarial_loss_value+ lambda_perceptual*perceptual_loss_value + lambda_l1*l1_loss_value
72 |
73 | self.manual_backward(total_loss)
74 | opt_g.step()
75 |
76 | # Log loss
77 | self.log('fake_loss', fake_loss, prog_bar=True)
78 | self.log('discriminator_loss', d_loss, prog_bar=True)
79 | self.log('total_loss', total_loss, prog_bar=True)
80 | self.log('gen_adversarial_loss', lambda_adversarial*adversarial_loss_value, prog_bar=True)
81 | self.log('perceptual_loss', perceptual_loss_value.mean()*lambda_perceptual, prog_bar=True)
82 | self.log('l1_loss', l1_loss_value*lambda_l1, prog_bar=True)
83 |
84 | # Display images every 500 steps
85 | if self.my_step % 500 == 0:
86 |
87 | sample_image = inputs[0]
88 | model_output = outputs.detach()
89 |
90 | plt.figure(figsize=(10, 5))
91 | plt.subplot(1, 5, 1)
92 | plt.imshow(((normalized_input_image[0].cpu().permute(1,2,0).numpy()+1)*127.5).astype('uint'))
93 | plt.title(f"Input Image, Age: {int(sample_image[3][0][0]*100)}")
94 | plt.axis('off')
95 |
96 | plt.subplot(1, 5, 2)
97 | plt.imshow(((normalized_target_image[0].cpu().permute(1,2,0).numpy()+1)*127.5).astype('uint'))
98 | plt.title("Target Image")
99 | plt.axis('off')
100 |
101 | new_image = (((normalized_input_image[0].cpu()+model_output[0].cpu()).permute(1,2,0).numpy()+1)*127.5).astype('uint')
102 | plt.subplot(1, 5, 3)
103 | plt.imshow(new_image)
104 | plt.title(f"Output Image, Age: {int(sample_image[4][0][0]*100)}")
105 | plt.axis('off')
106 |
107 | new_image = (((torch.abs(normalized_target_image[0].cpu()-normalized_input_image[0].cpu())).permute(1,2,0).numpy()+1)*127.5).astype('uint')
108 | plt.subplot(1, 5, 4)
109 | plt.imshow(new_image)
110 | plt.title(f"Tar RGB Diff")
111 | plt.axis('off')
112 |
113 | new_image = (((torch.abs(model_output[0].cpu())).permute(1,2,0).numpy()+1)*127.5).astype('uint')
114 | plt.subplot(1, 5, 5)
115 | plt.imshow(new_image)
116 | plt.title(f"Pred RGB Diff")
117 | plt.axis('off')
118 |
119 | plt.show()
120 |
121 | self.my_step +=1
122 |
123 | def configure_optimizers(self):
124 | generator_optimizer = optim.Adam(self.generator.parameters(), lr=0.0001)
125 | discriminator_optimizer = optim.Adam(self.discriminator.parameters(), lr=0.0001)
126 |
127 | return [generator_optimizer, discriminator_optimizer]
--------------------------------------------------------------------------------