texturedesign / texturize

🤖🖌️ Generate photo-realistic textures based on source images or (soon) PBR materials. Remix, remake, mashup! Useful if you want to create variations on a theme or elaborate on an existing texture.
GNU Affero General Public License v3.0
706 stars 32 forks source link

texturize enhance: pic should be PIL Image or ndarray #47

Open terrainer opened 1 year ago

terrainer commented 1 year ago

Full traceback: Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\tools\miniconda3\envs\texturize\Scripts\texturize.exe\__main__.py", line 7, in <module> File "C:\tools\miniconda3\envs\texturize\Lib\site-packages\texturize\__main__.py", line 154, in main cmd = commands.Enhance(target_arr, source_arr, zoom=zoom) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\tools\miniconda3\envs\texturize\Lib\site-packages\texturize\commands.py", line 105, in __init__ self.target = load_tensor_from_image(target, device="cpu") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\tools\miniconda3\envs\texturize\Lib\site-packages\texturize\io.py", line 58, in load_tensor_from_image return V.to_tensor(image).unsqueeze(0).to(device, dtype) ^^^^^^^^^^^^^^^^^^ File "C:\tools\miniconda3\envs\texturize\Lib\site-packages\torchvision\transforms\functional.py", line 140, in to_tensor raise TypeError(f"pic should be PIL Image or ndarray. Got {type(pic)}") TypeError: pic should be PIL Image or ndarray. Got <class 'tuple'>

Getting this when trying to use the enhance command with two RGB, 8 bits-per-channel, PNG files. Unsure what I'm doing wrong. Command used: texturize enhance tests/lowres.png with tests/highres.png --zoom=4