HeadsNet / README.md
tfnn's picture
Update README.md
1b6648d verified
|
raw
history blame
No virus
1.89 kB
---
license: mit
tags:
- thispersondoesnotexist
- stylegan
- stylegan2
- mesh
- model
- 3d
- asset
- generative
pretty_name: HeadsNet
size_categories:
- 1K<n<10K
---
# HeadsNet
This dataset uses the [thispersondoesnotexist_to_triposr_6748_3D_Heads ](https://huggingface.co/datasets/tfnn/thispersondoesnotexist_to_triposr_6748_3D_Heads) dataset as a foundation.
First normals are added to the ply files for each vertex, the easiest method to achieve this was with a simple [Blender](https://www.blender.org/) script:
```
import bpy
import glob
import pathlib
if not isdir(outputDir): mkdir(outputDir)
importDir = "ply/"
outputDir = "ply_norm/"
if not isdir(outputDir): mkdir(outputDir)
for file in glob.glob(importDir + "*.ply"):
model_name = pathlib.Path(file).stem
if pathlib.Path(outputDir+model_name+'.ply').is_file() == True: continue
bpy.ops.wm.ply_import(filepath=file)
bpy.ops.wm.ply_export(
filepath=outputDir+model_name+'.ply',
filter_glob='*.ply',
check_existing=False,
ascii_format=False,
export_selected_objects=False,
apply_modifiers=True,
export_triangulated_mesh=True,
export_normals=True,
export_uv=False,
export_colors='SRGB',
global_scale=1.0,
forward_axis='Y',
up_axis='Z'
)
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
bpy.ops.outliner.orphans_purge()
bpy.ops.outliner.orphans_purge()
bpy.ops.outliner.orphans_purge()
```
Importing the PLY without normals causes Blender to automatically generate them.