$ pip install UVTextureConverter
from UVTextureConverter import Normal2Atlas
from PIL import Image
import numpy as np
normal_tex = np.array(Image.open('input/normal.jpg'))
converter = Normal2Atlas(normal_size=512, atlas_size=200)
atlas_tex = converter.convert(normal_tex)
from UVTextureConverter import Atlas2Normal
from PIL import Image
import numpy as np
im = np.array(Image.open('input/atlas.png').convert('RGB')).transpose(1, 0, 2)
atlas_tex_stack = Atlas2Normal.split_atlas_tex(im)
converter = Atlas2Normal(atlas_size=200, normal_size=512)
normal_tex = converter.convert(atlas_tex_stack)
See the following notebooks for details and examples.
- convert_texture_between_normal_and_altas.ipynb: how to convert from atlas texture to normal texture, and vice versa.
- create_uv_texture_from_image_by_using_densepose.ipynb: how to convert a single rgb image to atlas texute by densepose and convert to normal texture.
- create_uv_texture_from_video_by_using_densepose.ipynb: how to convert video to atlas texture.
$ docker-compose build
$ docker-compose run --rm uvtexture_module
$ docker-compose run --rm -p 8888:8888 uvtexture_module
$ jupyter notebook --port 8888 --ip=0.0.0.0 --allow-root (in docker)