-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
texturize enhance: pic should be PIL Image or ndarray #47
Comments
Just got the same issue:
|
I get the same error and it persists regardless of which PyTorch & torchvision version is in use. However, I have used texturize successfully two years ago. I still have the env I used then and it works (texturize version 0.12). So you could try to install that
and see if it works. It is not the latest version though. |
Seems to me that the errors result as follows First the source and the target are extracted from the command line here texturize/src/texturize/__main__.py Lines 141 to 142 in 637a213
using this function Lines 15 to 26 in 637a213
In Remake texturize/src/texturize/commands.py Lines 120 to 124 in 637a213
Lines 47 to 59 in 637a213
I have not tried to modify the code but a simple solution might be to modify this line texturize/src/texturize/__main__.py Line 142 in 637a213
to this
Edits: due to copy-paste errors the links to code were not correct in the original posting, now corrected. |
Tried to test the change I proposed but not being familiar with poetry tool did not find a way to run my version. |
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
The text was updated successfully, but these errors were encountered: