You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
As the title mentions, it should be possible to use the untile() given the right params. But the way the current implementation is, one needs to run tile() on an input tensor which initializes a bunch of variables for the object of the Tiler which are used downstream for untiling. So if someone wants to tile at one point and then untile at another (imagine a usecase of saving tiled images then loading them up and untiling separately), it wont work
Screenshots
No response
Pip/GitHub
pip
What version/branch did you use?
No response
Configuration YAML
NA
Logs
File "C:\Users\v.arora\PycharmProjects\IterMaskUnity\src\data\infer\dataset.py", line 55, in untile_image
return self.tiler.untile(tiles)
File "C:\Users\v.arora\AppData\Local\anaconda3\envs\itermask_unity\lib\site-packages\anomalib\data\utils\tiler.py", line 431, in untile
image = self.__fold(tiles)
File "C:\Users\v.arora\AppData\Local\anaconda3\envs\itermask_unity\lib\site-packages\anomalib\data\utils\tiler.py", line 302, in __fold
image_size = (self.batch_size, num_channels, int(self.resized_h * scale_h), int(self.resized_w * scale_w))
AttributeError: 'Tiler' object has no attribute 'batch_size'
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hi, thanks for reporting this. Tiler is intended to be used within the model, and is then exported together with model, preserving the batch size attribute. I had a similar issue when working on the tiled ensemble and fixed it by introducing this code before calling tiler untile: https://github.com/blaz-r/anomalib/blob/8e3d9d501da9db2aa754f3f0463718e2985af4e7/src/anomalib/pipelines/tiled_ensemble/components/utils/ensemble_tiling.py#L96-L100
this will not immediately work here, since the default shapes are different, but the idea should apply. Basically, when calling untile, you can just set the batch size based on the current input. Maybe this could be added to the base Tiler class, to enable untiling across different instances.
Hope that helps.
Describe the bug
Using untile() without running tile() first is not possible. Also this is not clear in the documentation
Dataset
N/A
Model
N/A
Steps to reproduce the behavior
Following gives an idea when tiling has been done separately and it is in interest to untile later:
OS information
OS information:
OS: Win11
Python version: 3.10
Anomalib version: 1.2
PyTorch version: 2.5
Expected behavior
Hi
As the title mentions, it should be possible to use the untile() given the right params. But the way the current implementation is, one needs to run tile() on an input tensor which initializes a bunch of variables for the object of the Tiler which are used downstream for untiling. So if someone wants to tile at one point and then untile at another (imagine a usecase of saving tiled images then loading them up and untiling separately), it wont work
Screenshots
No response
Pip/GitHub
pip
What version/branch did you use?
No response
Configuration YAML
NA
Logs
Code of Conduct
The text was updated successfully, but these errors were encountered: