Questions on the selection of Tiling Data for small defect targets in large-scale images #1890
Replies: 16 comments 2 replies
-
Hello. In your case, you don't really need If you want the tiler to work, you'll also need to add this to callbacks: tiling = TilerConfigurationCallback(
enable=config.dataset.tiling.apply,
tile_size=config.dataset.tiling.tile_size,
stride=config.dataset.tiling.stride,
)
callbacks.append(tiling) If you don't, then tiling won't even happen, that might explain why you don't see the difference. Hope this helped 😄 |
Beta Was this translation helpful? Give feedback.
-
@blaz-r Thank you very much for your answer! I now understand the problem. However, I would like to ask which file you would like to add the callbacks to. Because I am not a computer major, some details may not be clear. Thank you very much! |
Beta Was this translation helpful? Give feedback.
-
Inside add tiling = TilerConfigurationCallback(
enable=config.dataset.tiling.apply,
tile_size=config.dataset.tiling.tile_size,
stride=config.dataset.tiling.stride,
)
callbacks.append(tiling) |
Beta Was this translation helpful? Give feedback.
-
Ok, I'll try it, thank you very much!! |
Beta Was this translation helpful? Give feedback.
-
@blaz-r I'm sorry to bother you again, but if I enable tiling operation, the image_size in config.yaml is still set to 256, or it needs to be adjusted to the original image size, I have some doubts about this. |
Beta Was this translation helpful? Give feedback.
-
Image size stays the same, because the image loaded is still in its original size, same with the final anomaly map. The models that support tiling will then use tiling configuration to split images from original size into the defined tiles. |
Beta Was this translation helpful? Give feedback.
-
@blaz-r Thank you for your timely reply. I have some questions after reading the code again: For example, I found that there is a call of "self.tiler.tile" in torch_model.py of the patchcore model, but it is not found in the efficient_ad file, or it is enough to add the code you mentioned above in the callback. (Because I find def tile is more important in class Tiler) |
Beta Was this translation helpful? Give feedback.
-
Not all models support tiling due to various reasons. Efficient AD doesn't. |
Beta Was this translation helpful? Give feedback.
-
@blaz-r I have question about this, when the tiling is applied, did you mean the image size stay the same when it is loaded (via dataloader) regardless the setting of image_size in the dataset? |
Beta Was this translation helpful? Give feedback.
-
No, sorry, what I've written is a bit confusing. For example, let's say we have an image with resolution of 1024x1024. We keep the image_size as is, that is Hope this clears things up, if not, let me know and I'll gladly explain better, it is afterall quite a specific thing in Anomalib. |
Beta Was this translation helpful? Give feedback.
-
I am having the same situation where I am supposed to be working on high dimension images with small defects, but this needs a huge amount of memory. Any insights ? |
Beta Was this translation helpful? Give feedback.
-
You will additionally need to lower the batch size. We are actively working on a design that will perform the tiling and then train a separate model, to solve this issue. It will be available soon. |
Beta Was this translation helpful? Give feedback.
-
Looking forward to it ! |
Beta Was this translation helpful? Give feedback.
-
Hi there, |
Beta Was this translation helpful? Give feedback.
-
@blaz-r, when you have time can you help here? |
Beta Was this translation helpful? Give feedback.
-
@kubikub, as @blaz-r mentioned above, a more comprehensive tiling mechanism will be enabled with this PR #1226. If you are interested, please keep an eye on it. There is also a paper that we recently published explaining how it works |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was surprised to see that there is a "Tiling" data processing method in the project, which is more friendly to small targets, but I have a few questions:
If my data image resolution is 8000*2000, and not each of them happens to be a full number (the resolution may be other numbers, just the image scale is approximate), then my tile_size if consistent with the stride, the whole image does not seem to be evenly divided. And I'm not sure how much random_tile_count I should use; Also, when will "remove_border_count" and "use_random_tiling" be enabled?
I chose the following default tiling parameter, and the training effect on 8000*2000 data is not better than that without using it; Or what is the best way to handle the data for such large aspect ratios? I would appreciate it if you could reply.
tiling:
apply: true
tile_size: 256
stride: 256
remove_border_count: 0
use_random_tiling: False
random_tile_count: 16
Beta Was this translation helpful? Give feedback.
All reactions