|
| 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 | + |
| 104 | + |
| 105 | +HEAD_DEPTH |
| 106 | + |
| 107 | +Center head towards cam +15cm = 1.0 |
| 108 | +Center head towards cam -15cm = 0.0 |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +HAIR |
| 113 | + |
| 114 | +Hair-only on transparent background. |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | +SKIN |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | +SKIN_DEPTH |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | +SKIN_EM_MASK |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | +SKIN_NORMAL |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +FRONTAL_SKIN_NORMAL |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +SKIN_WF_MASK |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | +FRONTAL_SKIN_WF_MASK |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | +WF_MASK |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | +HAIR_MASK |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | +BEARD_MASK |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | +EYEBROWS_MASK |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | +EYELASHES_MASK |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | +OCCLUSION_MASK |
| 167 | + |
| 168 | + |
| 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 | + |
| 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 | +} |
0 commit comments