Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthetic multi view facial generator #94

Merged
merged 319 commits into from Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
319 commits
Select commit Hold shift + click to select a range
9b7885a
Update readme.md
ekakalet Oct 12, 2021
c3fc9be
Update readme.md
ekakalet Oct 12, 2021
20e510e
Rename main.py to preprocessing_1.py
ekakalet Oct 12, 2021
5ee42dd
Rename inference.py to preprocessing_2.py
ekakalet Oct 12, 2021
d22304b
Update SyntheticDataGeneration.py
ekakalet Oct 12, 2021
1b85a16
Update SyntheticDataGeneration.py
ekakalet Oct 12, 2021
4d26f0c
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Oct 18, 2021
ca7ac94
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Oct 19, 2021
b6383d5
Update readme.md
ekakalet Oct 19, 2021
5263714
Delete bfm.ply
ekakalet Oct 19, 2021
52a7133
Delete bfm_refine.ply
ekakalet Oct 19, 2021
9141826
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Oct 21, 2021
2a5f58b
Update readme.md
ekakalet Oct 26, 2021
d66a7d7
Update SyntheticDataGeneration.py
ekakalet Oct 26, 2021
8dd2d3e
Update SyntheticDataGeneration.py
ekakalet Oct 26, 2021
fa80132
Update testSyntheticDataGeneration.py
ekakalet Oct 26, 2021
c4f3964
Update SyntheticDataGeneration.py
ekakalet Oct 29, 2021
173c993
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Oct 29, 2021
1c240b8
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Oct 29, 2021
84c18f2
Update tests/test_license.py
ekakalet Oct 29, 2021
e7c8934
Update SyntheticDataGeneration.py
ekakalet Oct 29, 2021
6d9eae8
Update SyntheticDataGeneration.py
ekakalet Oct 29, 2021
3eb09de
Update testSyntheticDataGeneration.py
ekakalet Oct 29, 2021
45cab28
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Oct 29, 2021
c6d6dbd
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Oct 29, 2021
8ad3515
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Oct 29, 2021
29e652e
Update README.md
ekakalet Oct 29, 2021
27da478
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Oct 29, 2021
e898e51
Update README.md
ekakalet Oct 29, 2021
fb4f667
ROS implementation
ekakalet Oct 29, 2021
38c6994
Update README.md
ekakalet Nov 1, 2021
a342f47
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 1, 2021
459f648
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Nov 1, 2021
2f7f007
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Nov 3, 2021
d9428ae
Create synthetic_facial_image_generator.md
ekakalet Nov 3, 2021
cd12f41
Update synthetic_facial_image_generator.md
ekakalet Nov 3, 2021
e39257c
Update index.md
ekakalet Nov 4, 2021
083f222
Update testSyntheticDataGeneration.py
ekakalet Nov 4, 2021
8bf980b
Update SyntheticDataGeneration.py
ekakalet Nov 4, 2021
ad27fdc
Update testSyntheticDataGeneration.py
ekakalet Nov 4, 2021
ffa349a
Update synthetic_facial_image_generator.md
ekakalet Nov 4, 2021
c09384b
Update synthetic_facial_image_generator.md
ekakalet Nov 4, 2021
ce98b29
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 4, 2021
1c41441
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 4, 2021
7d479bc
Update readme.md
ekakalet Nov 4, 2021
153dda7
Delete readme.md
ekakalet Nov 4, 2021
3104dc3
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 4, 2021
b87bae6
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 4, 2021
8dfdf70
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 4, 2021
aed757d
Update SyntheticDataGeneration.py
ekakalet Nov 5, 2021
2a35e81
Update testSyntheticDataGeneration.py
ekakalet Nov 5, 2021
500673b
Update testSyntheticDataGeneration.py
ekakalet Nov 5, 2021
585243e
Update testSyntheticDataGeneration.py
ekakalet Nov 5, 2021
9eea248
Delete synthetic_facial_generation.py
ekakalet Nov 5, 2021
c6d999f
Delete path_helper2.py
ekakalet Nov 5, 2021
1a00936
Delete path_helper.py
ekakalet Nov 5, 2021
2c6d4a6
Add files via upload
ekakalet Nov 5, 2021
ee6229c
Update synthetic_facial_generation.py
ekakalet Nov 5, 2021
201689a
Update synthetic_facial_generation.py
ekakalet Nov 5, 2021
b8791a0
Update synthetic_facial_generation.py
ekakalet Nov 5, 2021
c14c2ca
Update SyntheticDataGeneration.py
ekakalet Nov 5, 2021
aed270a
Update testSyntheticDataGeneration.py
ekakalet Nov 5, 2021
59e6370
Update testSyntheticDataGeneration.py
ekakalet Nov 5, 2021
90b4935
Update synthetic_facial_generation.py
ekakalet Nov 5, 2021
0ae0f06
Update synthetic_facial_generation.py
ekakalet Nov 5, 2021
e95df02
Update synthetic_facial_generation.py
ekakalet Nov 5, 2021
7cabc61
Update synthetic_facial_generation.py
ekakalet Nov 5, 2021
43175e8
Update README.md
ekakalet Nov 5, 2021
c01fbf3
Update README.md
ekakalet Nov 5, 2021
4991698
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 8, 2021
a14d3b9
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 8, 2021
573255d
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 8, 2021
df5d494
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 8, 2021
15ac1e3
Update projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 8, 2021
4301e59
new structure
ekakalet Nov 9, 2021
e41f6f9
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
ca3b953
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
9d29ff1
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
083d9fb
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
a73d561
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
ddf757a
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
2522b0c
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
d32c439
Delete projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 9, 2021
ea86ca8
Delete SyntheticDataGeneration.py
ekakalet Nov 9, 2021
3ce0999
Delete testSyntheticDataGeneration.py
ekakalet Nov 9, 2021
13daf76
Delete __init__.py
ekakalet Nov 9, 2021
5166983
Delete test_frontal.py
ekakalet Nov 9, 2021
5fde5c8
Delete test_multipose.py
ekakalet Nov 9, 2021
d8b0a1a
Delete train.py
ekakalet Nov 9, 2021
f4f9b29
Delete LICENSE
ekakalet Nov 9, 2021
a04a9f8
Update README.md
ekakalet Nov 9, 2021
89e3fac
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 12, 2021
fa0087e
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 12, 2021
714e94c
Update tests_sources.yml
ekakalet Nov 12, 2021
cea0858
Rename projects/data_generation/synthetic-multi-view-facial-image-gen…
ekakalet Nov 12, 2021
4098ed0
Update __init__.py
ekakalet Nov 12, 2021
e988f7d
Update __init__.py
ekakalet Nov 12, 2021
3105d04
Update __init__.py
ekakalet Nov 12, 2021
1d4a184
Delete __init__.py
ekakalet Nov 12, 2021
9399ec7
Create __init__.py
ekakalet Nov 12, 2021
80eda3f
Update __init__.py
ekakalet Nov 12, 2021
1c146f4
Delete __init__.py
ekakalet Nov 12, 2021
6c00f0c
Create __init__.py
ekakalet Nov 12, 2021
3947b1c
Delete __init__.py
ekakalet Nov 12, 2021
7124d8d
update
ekakalet Nov 12, 2021
897731f
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Nov 12, 2021
f5f9f4b
Delete SyntheticDataGeneration.py
ekakalet Nov 12, 2021
de97b1e
Delete testSyntheticDataGeneration.py
ekakalet Nov 12, 2021
33053f8
Merge branch 'master' into synthetic-multi-view-facial-generator
ad-daniel Nov 15, 2021
6bc2513
update for tests
ekakalet Nov 16, 2021
74b6276
update for tests
ekakalet Nov 16, 2021
961ff4f
Merge remote-tracking branch 'origin/synthetic-multi-view-facial-gene…
ekakalet Nov 16, 2021
401582e
Update test_synthetic_facial_generation.py
ekakalet Nov 16, 2021
89975da
update
ekakalet Nov 16, 2021
f713366
Update test_synthetic_facial_generation.py
ekakalet Nov 16, 2021
ce1300b
Rename tests/sources/tools/data_generation/test_synthetic_facial_gene…
ekakalet Nov 16, 2021
40464cd
update references
ekakalet Nov 16, 2021
2fded67
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Nov 16, 2021
ebfff54
Rename tests/sources/tools/data_generation/opendr_url.py to tests/sou…
ekakalet Nov 16, 2021
67152c4
Rename tests/sources/tools/data_generation/synthetic-multi-view-facia…
ekakalet Nov 16, 2021
0339004
Rename tests/sources/tools/data_generation/synthetic-multi-view-facia…
ekakalet Nov 16, 2021
9d5c840
Rename tests/sources/tools/data_generation/synthetic-multi-view-facia…
ekakalet Nov 16, 2021
1ae852c
Rename tests/sources/tools/data_generation/synthetic-mult-view-facial…
ekakalet Nov 16, 2021
1698686
Update opendr_url.py
ekakalet Nov 18, 2021
26adc8e
Update test_synthetic_facial_generation.py
ekakalet Nov 18, 2021
0b3af52
Update opendr_url.py
ekakalet Nov 18, 2021
7e3f1da
Create 3ddfa_url.py
ekakalet Nov 18, 2021
c128ae8
Update and rename projects/data_generation/synthetic-multi-view-facia…
ekakalet Nov 18, 2021
a54826b
Update SyntheticDataGeneration.py
ekakalet Nov 18, 2021
ec89cdb
Create test_multipose_url.py
ekakalet Nov 18, 2021
5644af4
Update SyntheticDataGeneration.py
ekakalet Nov 18, 2021
9e82c42
Update 3ddfa_url.py
ekakalet Nov 18, 2021
42adfea
Update test_multipose_url.py
ekakalet Nov 18, 2021
1ac8da5
Update 3ddfa_url.py
ekakalet Nov 18, 2021
8328991
Update SyntheticDataGeneration.py
ekakalet Nov 18, 2021
a48100f
Rename 3ddfa_url.py to help_url.py
ekakalet Nov 18, 2021
6bd7809
Update SyntheticDataGeneration.py
ekakalet Nov 18, 2021
a86b2c1
Update help_url.py
ekakalet Nov 18, 2021
5f9a7d9
Update test_multipose_url.py
ekakalet Nov 18, 2021
273a35b
Update test_multipose_url.py
ekakalet Nov 18, 2021
241a23f
update
ekakalet Nov 22, 2021
0236906
Update and rename tests/sources/tools/data_generation/synthetic-multi…
ekakalet Nov 22, 2021
f9e51d4
Rename tests/sources/tools/data_generation/synthetic-multi-view-facia…
ekakalet Nov 22, 2021
a269f21
update
ekakalet Nov 22, 2021
7220d17
rename
ekakalet Nov 22, 2021
9221287
updates
ekakalet Nov 22, 2021
7776455
update
ekakalet Nov 22, 2021
c33690c
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Nov 22, 2021
29b7a6f
update
ekakalet Nov 22, 2021
8341c6c
Delete opendr_url.py
ekakalet Nov 26, 2021
b18e701
Delete test_synthetic_facial_generation.py
ekakalet Nov 26, 2021
86929ee
Rename tests/sources/tools/data_generation/test_synthetic_facial_gene…
ekakalet Nov 26, 2021
2e05643
Rename tests/sources/tools/data_generation/__init__.py to tests/sourc…
ekakalet Nov 26, 2021
dfffc6a
update test
ekakalet Nov 26, 2021
5ee8523
update
ekakalet Nov 26, 2021
be10cec
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Nov 26, 2021
d65d6f2
Rename tests/sources/tools/data_generation/file_list.txt to tests/sou…
ekakalet Nov 26, 2021
6654491
Update __init__.py
ekakalet Nov 26, 2021
83cbcb7
init
ekakalet Nov 26, 2021
b7ca459
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Nov 26, 2021
c73c7b3
Update tests_sources.yml
ekakalet Nov 26, 2021
4dd3f61
Update tests_sources.yml
ekakalet Nov 26, 2021
72900f2
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Nov 26, 2021
a30b098
update paths
ekakalet Nov 27, 2021
7c7b7b1
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Nov 27, 2021
124668b
update
ekakalet Nov 29, 2021
9a0e928
update
ekakalet Nov 29, 2021
0d92898
update
ekakalet Nov 29, 2021
db2b0d1
Reorganize
ad-daniel Nov 29, 2021
b90d8d2
Merge branch 'master' into synthetic-multi-view-facial-generator
passalis Nov 30, 2021
67f7f4d
update
ekakalet Nov 30, 2021
3674c3d
update
ekakalet Nov 30, 2021
8aa2fb8
update
ekakalet Nov 30, 2021
21b1ec8
update
ekakalet Nov 30, 2021
5269c77
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Nov 30, 2021
af6d2b3
update tool
ekakalet Dec 3, 2021
0f80ce2
Delete test_synthetic_facial_generation.py
ekakalet Dec 3, 2021
c133a92
Delete file_list.txt
ekakalet Dec 3, 2021
4e9323a
Delete __init__.py
ekakalet Dec 3, 2021
c433b98
Delete __init__.py
ekakalet Dec 3, 2021
657f0ad
Update tests_sources.yml
ekakalet Dec 3, 2021
4c19081
update
ekakalet Dec 3, 2021
ff399cb
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Dec 3, 2021
815a17f
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Dec 3, 2021
8167b66
without pep errors
ekakalet Dec 3, 2021
9d05d2b
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Dec 3, 2021
44f3fda
reformat code
ekakalet Dec 3, 2021
7d82a2d
Delete projects/data_generation/OLD directory
ekakalet Dec 3, 2021
b731bf0
Update SyntheticDataGeneration.py
ekakalet Dec 6, 2021
dab026c
Update tool_synthetic_facial_generation.py
ekakalet Dec 6, 2021
0197908
Update render.py
ekakalet Dec 6, 2021
037eb21
Update SyntheticDataGeneration.py
ekakalet Dec 6, 2021
f87cdfa
Update SyntheticDataGeneration.py
ekakalet Dec 6, 2021
9a53daf
Update render.py
ekakalet Dec 6, 2021
d13a650
Update render.py
ekakalet Dec 6, 2021
5431eee
Update synthetic_facial_image_generator.md
ekakalet Dec 6, 2021
673e5cc
Update synthetic_facial_image_generator.md
ekakalet Dec 7, 2021
de9e45b
Update README.md
ekakalet Dec 7, 2021
90b9c1d
Update README.md
ekakalet Dec 7, 2021
87c8ac3
Delete __init__.py
ekakalet Dec 8, 2021
e5ed7ac
Delete __init__.py
ekakalet Dec 8, 2021
e8406ad
Update readme.md
ekakalet Dec 8, 2021
572d9c3
Update readme.md
ekakalet Dec 8, 2021
c359257
Delete realign_lmk
ekakalet Dec 8, 2021
5813b34
Add files via upload
ekakalet Dec 8, 2021
c3cf61f
Rename projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Dec 8, 2021
97cbb08
Update readme.md
ekakalet Dec 8, 2021
cddb57e
Update README.md
ekakalet Dec 8, 2021
d109aba
Delete tri.mat
ekakalet Dec 8, 2021
cdbfdbf
Add files via upload
ekakalet Dec 8, 2021
a87395e
Merge branch 'master' into synthetic-multi-view-facial-generator
ad-daniel Dec 9, 2021
417129b
Merge branch 'master' into synthetic-multi-view-facial-generator
passalis Dec 12, 2021
5c96055
Merge branch 'master' into synthetic-multi-view-facial-generator
ad-daniel Dec 13, 2021
4f2afc9
Merge branch 'master' into synthetic-multi-view-facial-generator
ad-daniel Dec 13, 2021
fdec9d4
Merge branch 'master' into synthetic-multi-view-facial-generator
ad-daniel Dec 13, 2021
090f3f4
Merge branch 'master' into synthetic-multi-view-facial-generator
ad-daniel Dec 14, 2021
15f7ce6
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Dec 14, 2021
c7069cc
final updates
ekakalet Dec 15, 2021
741398b
Merge branch 'synthetic-multi-view-facial-generator' of https://githu…
ekakalet Dec 15, 2021
e2b90c1
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Dec 15, 2021
66d5784
installation and import fixes
passalis Dec 16, 2021
75d0964
Merge branch 'master' into synthetic-multi-view-facial-generator
passalis Dec 16, 2021
aaab7f2
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Dec 16, 2021
541a52d
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Dec 17, 2021
152395b
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Dec 20, 2021
fe8fdd5
Merge branch 'master' into synthetic-multi-view-facial-generator
passalis Jan 21, 2022
e8c51b4
Bug fixes
ekakalet Jan 21, 2022
db0daa7
for execute in gpu_id 0
ekakalet Jan 21, 2022
c32f5f6
resolve pep8 errors
ekakalet Jan 21, 2022
662e3e3
Update synthetic_facial_generation.py
ekakalet Jan 21, 2022
6fa301b
bug fixes
passalis Jan 22, 2022
ed01cf7
Merge branch 'master' into synthetic-multi-view-facial-generator
ad-daniel Jan 31, 2022
7778398
Update docs/reference/index.md
ekakalet Jan 31, 2022
3f60856
Update docs/reference/synthetic_facial_image_generator.md
ekakalet Jan 31, 2022
422b743
Update docs/reference/synthetic_facial_image_generator.md
ekakalet Jan 31, 2022
912de15
Update docs/reference/synthetic_facial_image_generator.md
ekakalet Jan 31, 2022
a6e2925
Update docs/reference/synthetic_facial_image_generator.md
ekakalet Jan 31, 2022
a31dd95
Update docs/reference/synthetic_facial_image_generator.md
ekakalet Jan 31, 2022
b0d76ac
Update projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Jan 31, 2022
739f62f
Update projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Jan 31, 2022
5c91d9c
Update projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Jan 31, 2022
0dd5507
Update projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Jan 31, 2022
6e88186
Update projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Jan 31, 2022
f3a6f10
Update test_license.py
ekakalet Jan 31, 2022
c6bc9f4
Update test_license.py
ekakalet Jan 31, 2022
9cbda44
Update readme.md
ekakalet Jan 31, 2022
2f1fece
Update readme.md
ekakalet Jan 31, 2022
3d80d18
Delete projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Jan 31, 2022
2b60680
Delete projects/data_generation/synthetic_multi_view_facial_image_gen…
ekakalet Jan 31, 2022
60a4dea
Merge branch 'master' into synthetic-multi-view-facial-generator
ekakalet Feb 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/reference/index.md
Expand Up @@ -67,11 +67,15 @@ Neither the copyright holder nor any applicable licensor will be liable for any
- [single_demo_grasp Module](single-demonstration-grasping.md)

- `simulation` Module
- [human_model_generation Module](human_model_generation.md)
- `data_generation` Module
- [synthetic_facial_image_generation Module](synthetic_facial_image_generator.md)
- [human_model_generation Module](human-model-generation.md)
- `utils` Module
- [Hyperparameter Tuning Module](hyperparameter_tuner.md)
- `Stand-alone Utility Frameworks`
- [Engine Agnostic Gym Environment with Reactive extension (EAGERx)](eagerx.md)
- `Stand-alone Utility Frameworks`
- [Engine Agnostic Gym Environment with Reactive extension (EAGERx)](eagerx.md)

ekakalet marked this conversation as resolved.
Show resolved Hide resolved
- [ROSBridge Package](rosbridge.md)
- [C Inference API](c-api.md)
- [data.h](c-data-h.md)
Expand Down
61 changes: 61 additions & 0 deletions docs/reference/synthetic_facial_image_generator.md
@@ -0,0 +1,61 @@
## synthetic_facial_image_generator module

The *synthetic_facial_image_generator* module contains the *MultiviewDataGeneration* class, which implements the multi-view facial image rendering operation.

### Class MultiviewDataGeneration

The *MultiviewDataGeneration* class is a wrapper of the Rotate-and-Render [[1]](#R-R-paper) photorealistic multi-view facial image generator based on the original
[Rotate-and-Render implementation](https://github.com/Hangz-nju-cuhk/Rotate-and-Render).
It can be used to perform multi-view facial image generation from a single view image on the wild (eval).
The [MultiviewDataGeneration](#projects.data_generation.synthetic-multi-view-facial-image-generation.3ddfa.SyntheticDataGeneration.py ) class has the
following public methods:

#### `MultiviewDataGeneration` constructor
```python
MultiviewDataGeneration(self, args)
```

Constructor main parameters *args* explanation:

- **path_in**: *str, default='./example/Images'* \
An absolute path (path in) which indicates the folder that contains the set of single view facial image snapshots to be processed by the algorithm.
- **path_3ddfa**: *str, default='./'* \
An absolute path (path 3ddfa) which indicates the 3ddfa module folder of the software structure as presented in the repository. This path is necessary in order
for the software to create the folders for the intermediate / temporary storage of files generated during the pre-processing such as 3d face models, facial landmarks etc
ekakalet marked this conversation as resolved.
Show resolved Hide resolved
in the folder results of this path.
- **save_path**: *str, default='./results'* \
The output images are stored in the folder indicated by save path which is also a class input parameter.
- **val_yaw**: *str, default='10,20'* \
Definition of the yaw angles (in the interval [−90◦,90◦]) for which the rendered images will be produced.
ekakalet marked this conversation as resolved.
Show resolved Hide resolved
- **val_pitch**: *str, default=' 30,40'* \
Definition of the pitch angles (in the interval [−90◦,90◦]) for which the rendered images will be produced.
ekakalet marked this conversation as resolved.
Show resolved Hide resolved
- **device**: *{'cuda', 'cpu'}, default='cpu'* \
Specifies the device to be used.


#### `MultiviewDataGeneration.eval`
```python
MultiviewDataGeneration.eval()
```

This function is implementing the main procedure for the creation of the multi-view
facial images, which consists of three different stages. Instead of initializing the main
parameters of the 3DDFA network in the intializer , the first stage includes detection of the
candidate faces in the input images and 3D-head mesh fitting using 3DDFA. Moreover,
the second stage extracts the facial landmarks in order to derive the head pose and align
the images with the 3d head model mesh. Finally, the main functionality of the multiview
facial image rendering is executed by loading the respective network parameters.
ekakalet marked this conversation as resolved.
Show resolved Hide resolved

### Usage Example

```python
python3 tool_synthetic_facial_generation.py -path_in ./demos/imgs_input/ -path_3ddfa ./algorithm/DDFA/ -save_path ./results -val_yaw 10, 40 -val_pitch 10, 30 -device cuda
```
The corresponding paths for the input, output folders as well as the pitch and yaw angles for which the user wants to
produce the facial images can be easily incorporated in the class creation while the method is initialized.
The process is executed for the CNN parameters and GPUs specified in the arguments of the aforementioned command. Users that wish to modify these parameters shall change the respective input arguments which derived from a parser including the arguments path in, path_3ddfa, save_path, val_yaw, val_pitch etc.
ekakalet marked this conversation as resolved.
Show resolved Hide resolved

#### References
<a name="R-R-paper" href="https://github.com/Hangz-nju-cuhk/Rotate-and-Render">[1]</a>
Hang Zhou, Jihao Liu, Ziwei Liu, Yu Liu, Xiaogang Wang, Rotate-and-Render: Unsupervised Photorealistic Face Rotation from Single-View Images,
[arXiv](https://arxiv.org/abs/2003.08124#).
@@ -0,0 +1,71 @@
# Synthentic Multi-view Facial Image Generation based on Rotate-and-Render: Unsupervised Photorealistic Face Rotation from Single-View Images (CVPR 2020)

Based on: [[Rotate-and-Render: Unsupervised Photorealistic Face Rotation from Single-View Images]](https://arxiv.org/abs/2003.08124)

We utilize, with small modifications in order to be easily executed, publicly available code, namely an un-supervised framework that can synthesize photorealistic rotated facial images using as input a single facial image, or multiple such images (one per person).
The implemented method allows for rotating faces in the 3D space back and forth, and then re-rendering them to the 2D plane.
The generated multi-view facial images can be used for different learning tasks, such as in self-supervised learning tasks.

## Sources:
* Face Alignment in Full Pose Range: A 3D Total Solution (IEEE TPAMI 2017)
* Neural 3D Mesh Renderer (CVPR 2018)
* Rotate-and-Render: Unsupervised Photorealistic Face Rotation from Single-View Images (CVPR 2020)

## Requirements
* Python 3.6 is used. Basic requirements are listed in the 'requirements.txt'.

```
pip3 install -r requirements.txt
```
* Install the [Neural_Renderer](https://github.com/daniilidis-group/neural_renderer) following the instructions.
```
pip install git+https://github.com/cidl-auth/neural_renderer
```

* Download checkpoint and BFM model from [checkpoint.zip](ftp://opendrdata.csd.auth.gr/data_generation/synthetic_multi-view-facial-generator/ckpt_and_bfm.zip) put it in ```3ddfa``` and unzip it:
```bash
wget ftp://opendrdata.csd.auth.gr/data_generation/synthetic_multi-view-facial-generator/checkpoints.zip
unzip checkpoints.zip
unzip checkpoints/ckpt_and_bfm.zip -d 3ddfa
```
The 3D models are borrowed from [3DDFA](https://github.com/cleardusk/3DDFA).

* Compile cython code and download remaining models:
```bash
cd algorithm/DDFA/utils/cython/
python3 setup.py build_ext -i
cd ../../../..
mkdir algorithm/DDFA/models
mkdir algorithm/DDFA/example
wget https://github.com/cleardusk/3DDFA/blob/master/models/phase1_wpdc_vdc.pth.tar?raw=true -O algorithm/DDFA/models/phase1_wpdc_vdc.pth.tar
```

## Usage Example

1. Execute the one-step OPENDR function ```tool_synthetic_facial_generation.py``` specifying the input images folder, the output folder, the desired degrees (range -90 to 90) for generating the facial images in multiple view angles pitch and yaw as indicated in the command line:
```sh
python3 tool_synthetic_facial_generation.py -path_in ./demos/imgs_input/ -path_3ddfa ./algorithm/DDFA/ -save_path ./results -val_yaw 10, 40 -val_pitch 10, 30 -device cuda
```

3. The results can be found in ```results/rs_model/example/```, where multi-view facial images are generated for every person in a respective folder.

ekakalet marked this conversation as resolved.
Show resolved Hide resolved

## License
The usage of this software code Rotate-and-Render is under [CC-BY-4.0](https://github.com/Hangz-nju-cuhk/Rotate-and-Render/blob/master/LICENSE).
ekakalet marked this conversation as resolved.
Show resolved Hide resolved
The usage of this software code SPADE, SyncBN, 3DDFA are under [MIT License](https://github.com/tasostefas/opendr_internal/blob/synthetic-multi-view-facial-generator/projects/data_generation/synthetic-multi-view-facial-image-generation/3ddfa/LICENSE)
ekakalet marked this conversation as resolved.
Show resolved Hide resolved

## Acknowledgement
Large parts of the code are taken from:
* The structure of this codebase is borrowed from [SPADE](https://github.com/NVlabs/SPADE).
* The [SyncBN](https://github.com/vacancy/Synchronized-BatchNorm-PyTorch) module is used in the current code.
* The [3DDFA](https://github.com/cleardusk/3DDFA) implementation for 3D reconstruction.
* The code [Rotate-and-Render](https://github.com/Hangz-nju-cuhk/Rotate-and-Render/)

with the following modifications to make them compatible with the OpenDR specifications:
## Minor Modifications
1. All scripts: PEP8 changes
2. ```3ddfa/preprocessing_1.py, 3ddfa/preprocessing_2.py, test_multipose.py``` Modified to work as a callable functions
3. ```options/base_options.py, options/test_options.py ``` Commented out/change several parameters to be easily executed
4. ```models/networks/render.py``` Minor functional changes
5. The OPENDR created functions are ```SyntheticDataGeneration.py, tool_synthetic_facial_generation.py```
6. The rest are taken from the aforementioned repositories
@@ -0,0 +1,141 @@
# Copyright 2020-2021 OpenDR European Project
ekakalet marked this conversation as resolved.
Show resolved Hide resolved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# MIT License
#
# Copyright (c) 2019 Jian Zhao
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# !/usr/bin/env python3.7
# coding: utf-8
from tqdm import tqdm
from shutil import copyfile
import cv2
import os
from algorithm.DDFA import preprocessing_1
from algorithm.DDFA import preprocessing_2
from algorithm.Rotate_and_Render import test_multipose


class MultiviewDataGeneration():

def __init__(self, args):

self.path_in = args.path_in
self.key = str(args.path_3ddfa + "/example/Images/")
self.key1 = str(args.path_3ddfa + "/example/")
self.key2 = str(args.path_3ddfa + "/results/")
self.save_path = args.save_path
self.val_yaw = args.val_yaw
self.val_pitch = args.val_pitch
self.args = args

def eval(self):

# STAGE No1 : detect faces and fitting to 3d mesh by main.py execution
list_im = []

print("START")

a = open("file_list.txt", "w")
for subdir, dirs, files in os.walk(self.path_in):
current_directory_path = os.path.abspath(subdir)
for file in files:
name, ext = os.path.splitext(file)
if ext == ".jpg":
current_image_path = os.path.join(current_directory_path, file)
current_image = cv2.imread(current_image_path)
list_im.append(current_image_path)
a.write(str(file) + os.linesep)
cv2.imwrite(os.path.join(self.key, file), current_image)
self.args.files = list_im.copy()
list_im.clear()
preprocessing_1.main(self.args)
a.close()

# STAGE No2: Landmarks Output with inference.py execution

im_list2 = []
d = open(os.path.join(self.key1, 'realign_lmk'), "w")
for subdir, dirs, files in os.walk(self.path_in):
current_directory_path = os.path.abspath(subdir)
self.args.img_prefix = current_directory_path
self.args.save_dir = os.path.abspath(self.key2)
self.args.save_lmk_dir = os.path.abspath(self.key1)
if not os.path.exists(self.args.save_dir):
os.mkdir(self.args.save_dir)
if not os.path.exists(self.args.save_lmk_dir):
os.mkdir(self.args.save_lmk_dir)

list_lfw_batch = './file_list.txt'
dst = os.path.join(self.args.save_lmk_dir, "file_list.txt")
copyfile(list_lfw_batch, dst)
b = open("txt_name_batch.txt", "w")
for file in files:

with open(list_lfw_batch) as f:
img_list = [x.strip() for x in f.readlines()]

for img_idx, img_fp in enumerate(tqdm(img_list)):
if img_fp == str(file):
im_list2.append(str(file))
b.write(str(file) + os.linesep)
self.args.img_list = './txt_name_batch.txt'
b.close()
self.args.dump_lmk = 'true'
im_list2.clear()
preprocessing_2.main(self.args)
with open(os.path.join(self.args.save_lmk_dir, 'realign_lmk_')) as f:
img_list = [x.strip() for x in f.readlines()]
for img_idx, img_fp in enumerate(tqdm(img_list)):
d.write(img_fp + os.linesep)
d.close()

# STAGE No3: Generate Facial Images in specific pitch and yaw angles
test_multipose.main(self.save_path, self.val_yaw, self.val_pitch)

def fit(self):
raise NotImplementedError()

def infer(self):
raise NotImplementedError()

def load(self):
raise NotImplementedError()

def optimize(self):
raise NotImplementedError()

def reset(self):
raise NotImplementedError()

def save(self):
raise NotImplementedError()
@@ -0,0 +1,14 @@
model = load('model_refine.mat');
model = model.model_refine;

mu = model.mu_shape + model.mu_exp;
mu = reshape(mu, 3, length(mu) / 3);
tri = model.tri;
keypoints = model.keypoints;
pts68_3d = mu(:, keypoints);

render_face_mesh(mu, tri, pts68_3d);

A = getframe(gcf);
mimg = A.cdata;
imwrite(mimg, 'imgs/bfm_noneck.jpg', 'quality', 95);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,24 @@
**Todo:** Update the neck-removing processing pipeline from original BFM model.

The original version with neck:
ekakalet marked this conversation as resolved.
Show resolved Hide resolved
<p align="center">
<img src="imgs/bfm_noneck.jpg" alt="neck" width="400px">
</p>

[bfm.ply](https://github.com/Hangz-nju-cuhk/Rotate-and-Render/blob/master/3ddfa/BFM_Remove_Neck/bfm.ply)

The refined version without neck:
<p align="center">
<img src="imgs/bfm_refine.jpg" alt="no neck" width="400px">
</p>

[bfm_refine.ply](https://github.com/Hangz-nju-cuhk/Rotate-and-Render/blob/master/3ddfa/BFM_Remove_Neck/bfm_refine.ply)
These two images are rendered by MeshLab.

`bfm_show.m` shows how to render it with 68 keypoints in Matlab.

<p align="center">
<img src="imgs/bfm_refine.jpg" alt="no neck">
</p>

Attention: the z-axis value of `bfm.ply` and `bfm_refine.ply` file are opposed in `model_refine.mat`, do not use these two `ply` file in training.
@@ -0,0 +1,22 @@
function render_face_mesh(vertex, tri, pts68_3d)
trisurf(tri', vertex(1, :), vertex(2, :), vertex(3, :), ones(size(vertex, 2),1), 'edgecolor', 'none');

re=[1 1 1];
colormap(re);

light('Position', [0 0 1], 'Style', 'infinite');
lighting gouraud
axis equal
view([0 90]);

if nargin == 3
hold on; plot3(pts68_3d(1,:), pts68_3d(2,:), pts68_3d(3,:)+1, '*');
end

xlabel('x');
ylabel('y');
zlabel('z');

axis on;
grid on;
end
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Jianzhu Guo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.