cqylunlun / GLASS

[ECCV 2024] Official Implementation and Dataset Release for <A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization>
MIT License
130 stars 17 forks source link

Change input size #9

Closed shiomi326 closed 1 month ago

shiomi326 commented 1 month ago

Hi Thanks for your great repo. I want to increase the input size. Like 512. Where do I need to change?

I know that I need to change arguments.

--resize 288
--image 288

But you set specific size in

def distribution_judge(img, name):

      img_ = cv2.resize(img, (289, 289))

So I need to change that or this methods need to use 288 size? Thanks.

cqylunlun commented 1 month ago

Thank you for your recognition. If you want to increase the input size to 512x512, you only need to modify arguments as follows:

--resize 512
--imagesize 512

Since distribution_judge does not affect the preprocessing of the training images, there is no need for any changes. For the purpose of this function or the selection of different variants, please refer to #6-1. Additionally, if your images are not square-shaped and you wish to output results in the original dimensions, you can refer to #6-2.

shiomi326 commented 1 month ago

Thanks for the detailed description and quick response. I will give that a try!

shiomi326 commented 1 month ago

It worked fine. Thank you @cqylunlun