GroundingDINO
GroundingDINO copied to clipboard
RandomResize during inference?
Quick question. Why do you do RandomResize during inference?
https://github.com/IDEA-Research/GroundingDINO/blob/2b62f419c292ca9c518daae55512fabc3fead4a4/demo/inference_on_a_image.py#L64
Quick question. Why do you do RandomResize during inference?
https://github.com/IDEA-Research/GroundingDINO/blob/2b62f419c292ca9c518daae55512fabc3fead4a4/demo/inference_on_a_image.py#L64
We can only set one scale in its args to make it into a single size transform here
Tracking down RandomResize implementation, the images are resized to a fixed square size of 800x800; no randomness is employed.
Note that it is [800] not 800, the former is a list of random sizes to choose from, whereas the later is a minimum limit on the sizes to use. Since we choose a random number from a list of one value only, the size is always fixed to 800.
I tried feeding images a few times and found that the images were resized while keeping the original ratio. The short side of the image will be resized to 800 if doing so the long side of the resized image will be less than or equal to 1333. Otherwise, the long side will be resized to 1333.