Skip to content

Commit 8221fc6

Browse files
author
iperov
committed
initial commit
0 parents  commit 8221fc6

18 files changed

+243
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 iperov
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.

README.md

+222
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
# Simple Synthetic Head Generator (SSHG)
2+
3+
Generate your own synthetic human head dataset for free using Blender software. The dataset can be used in face analyzation, model pretraining, and other machine learning tasks.
4+
5+
## Limitations
6+
7+
The facial model has extensive deformations to ensure high variability. This makes it difficult to adapt eyes and teeth for such deformations.
8+
Therefore, eyes and teeth are not present in the 3D model. You cannot use the dataset for tasks that require eyes or teeth, for example relighting. A random background is drawn instead.
9+
10+
## Random background
11+
12+
The simplicity is that I don't need to draw real world environments, real hats, real glasses, real clothes, and other things.
13+
Random pictures from the real world that don't contain faces (not noise) are enough for the neural network to ignore everything but the head or face itself.
14+
15+
## Example results
16+
17+
Currently, the effectiveness of dataset for real-world tasks is unproven. Feel free to train the models and post your results in Issues section.
18+
19+
# Requirements
20+
21+
Blender 4.2 or higher. No additional dependencies or plugins required.
22+
23+
# Installation
24+
25+
For ease of use, a ready-made *one-click to run* archive for Windows is available [here](https://github.com/iperov/SSHG/releases), containing:
26+
27+
1) Blender 4.2 Portable
28+
29+
2) Project folder
30+
31+
3) .bat files
32+
33+
# User manual
34+
35+
## Start rendering without Blender UI
36+
37+
run SSHG_render.bat - infinite render using current settings. The output will be placed in SSHG\render\
38+
39+
run SSHG_render_CUDA.bat - same + override render device to CUDA
40+
41+
## Change the settings
42+
43+
1) run SSHG_blender.bat
44+
45+
2) change SSHG settings in the SSHG tab
46+
47+
3) change device settings in Edit -> Preferences -> System
48+
49+
3) save the project
50+
51+
4) close Blender
52+
53+
## SSHG tab settings
54+
55+
### Resolution
56+
57+
Output square resolution of all images. Default: 1024
58+
59+
### Face coverage
60+
61+
Increases facial coverage of the output image in all directions from the center. Default: 2.80
62+
63+
### Face Y offset
64+
65+
Shifts the face along the Y axis of the output image plane. Default: -0.14
66+
67+
### Face Y axis offset
68+
69+
Shifts the yaw-axis around which the head spins. With this parameter, the face can be aligned similar to classic umeyama-align by 2D Landmarks, or rotated around the center of the head. Default: 0.0
70+
71+
### Allow simulation
72+
73+
Allows hair simulation.
74+
75+
### Allow random occlusion
76+
77+
Allows facial occlusions with random backgrounds shaped like hands, microphones, glasses, cigarettes, and the like.
78+
79+
### Allow random glare
80+
81+
Add glare to HEAD and SKIN modes with random probability.
82+
83+
### Output dir
84+
85+
Name of output dir relative to .blend root dir.
86+
87+
### Output types
88+
89+
Check the checkboxes for the desired output types.
90+
91+
### [Single] button
92+
93+
Render single.
94+
95+
### [Infinite] button
96+
97+
Render infinite. UI will not unlock.
98+
99+
## Output type examples
100+
101+
HEAD
102+
103+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/HEAD.jpg)
104+
105+
HEAD_DEPTH
106+
107+
Center head towards cam +15cm = 1.0
108+
Center head towards cam -15cm = 0.0
109+
110+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/HEAD_DEPTH.jpg)
111+
112+
HAIR
113+
114+
Hair-only on transparent background.
115+
116+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/HAIR.jpg)
117+
118+
SKIN
119+
120+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/SKIN.jpg)
121+
122+
SKIN_DEPTH
123+
124+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/SKIN_DEPTH.jpg)
125+
126+
SKIN_EM_MASK
127+
128+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/SKIN_EM_MASK.jpg)
129+
130+
SKIN_NORMAL
131+
132+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/SKIN_NORMAL.jpg)
133+
134+
FRONTAL_SKIN_NORMAL
135+
136+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/FRONTAL_SKIN_NORMAL.jpg)
137+
138+
SKIN_WF_MASK
139+
140+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/SKIN_WF_MASK.jpg)
141+
142+
FRONTAL_SKIN_WF_MASK
143+
144+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/FRONTAL_SKIN_WF_MASK.jpg)
145+
146+
WF_MASK
147+
148+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/WF_MASK.jpg)
149+
150+
HAIR_MASK
151+
152+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/HAIR_MASK.jpg)
153+
154+
BEARD_MASK
155+
156+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/BEARD_MASK.jpg)
157+
158+
EYEBROWS_MASK
159+
160+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/EYEBROWS_MASK.jpg)
161+
162+
EYELASHES_MASK
163+
164+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/EYELASHES_MASK.jpg)
165+
166+
OCCLUSION_MASK
167+
168+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/OCCLUSION_MASK.jpg)
169+
170+
JSON_DATA
171+
172+
```python
173+
{
174+
"resolution" : 1024,
175+
176+
"face_coverage": 2.8,
177+
178+
"face_y_offset": -0.14,
179+
180+
"face_y_axis_offset": 0.0,
181+
182+
"pitch": -7.898, # Head pitch relative to view in degrees.
183+
# Looking up is +90, straight is 0, down is -90.
184+
185+
"yaw": -96.860 # Head yaw relative to view in degrees.
186+
# Looking left (from view) is -90, straight is 0, right is +90.
187+
188+
# no roll, because it is always zero
189+
190+
"landmarks": { # name : pos dict.
191+
"l_eye_l_corner": [676.218, 469.937], # x,y from top-left corner
192+
"l_eye_r_corner": [595.341, 486.307],
193+
"r_eye_l_corner": [495.657, 489.591],
194+
"r_eye_r_corner": [407.453, 478.049],
195+
"nose_tip": [584.718, 593.121],
196+
"nose_l_corner": [607.680, 599.532],
197+
"nose_r_corner": [510.877, 604.725],
198+
"mouth_l_corner": [626.172, 707.490],
199+
"mouth_r_corner": [484.847, 708.083],
200+
"chin_center": [559.415, 868.429]
201+
}
202+
}
203+
```
204+
205+
Landmarks example
206+
207+
![Picture](https://github.com/iperov/SSHG/blob/master/doc/type_examples/JSON_lmrks.png)
208+
209+
# Changelog
210+
211+
2025.01.01 Initial release
212+
213+
# Citation
214+
215+
@software{SSHG,
216+
author = {iperov},
217+
title = {{Simple Synthetic Head Generator}},
218+
url = {https://github.com/iperov/SSHG},
219+
version = {1.0.0},
220+
month = {01},
221+
year = {2025}
222+
}

doc/type_examples/BEARD_MASK.jpg

12.1 KB
Loading

doc/type_examples/EYEBROWS_MASK.jpg

9.38 KB
Loading

doc/type_examples/EYELASHES_MASK.jpg

6.46 KB
Loading
70.1 KB
Loading
19.8 KB
Loading

doc/type_examples/HAIR.jpg

153 KB
Loading

doc/type_examples/HAIR_MASK.jpg

143 KB
Loading

doc/type_examples/HEAD.jpg

213 KB
Loading

doc/type_examples/HEAD_DEPTH.jpg

127 KB
Loading

doc/type_examples/JSON_lmrks.png

558 KB
Loading

doc/type_examples/OCCLUSION_MASK.jpg

23.1 KB
Loading

doc/type_examples/SKIN.jpg

147 KB
Loading

doc/type_examples/SKIN_DEPTH.jpg

35 KB
Loading

doc/type_examples/SKIN_EM_MASK.jpg

9.67 KB
Loading

doc/type_examples/SKIN_NORMAL.jpg

67.4 KB
Loading

doc/type_examples/SKIN_WF_MASK.jpg

20 KB
Loading

0 commit comments

Comments
 (0)