Closed Shakesbeer333 closed 3 years ago
SSD is trained without considering image aspect ration. So there is no need to pad image like in Faster R-CNN.
ToPercentCoords
is called before Resize
, so it's OK for Resize
to discard the original aspect ration.
https://github.com/lufficc/SSD/blob/50373c79b861d5d239be4206fafc6661cea040b4/ssd/data/transforms/__init__.py#L14-L15
Hi @lufficc,
I have the feeling that the resizing of the (ground truth) boxes is wrong. The resizing is "bypassed" by taking the relative values of x1,y1,x2,y2 with regards to the original image shape. However, this leads to wrong results, as the images are resized to the squared shape = size x size (i.e. 512 x 512 or 300 x 300), thus, discarding the original aspect ration.
A possible solution would be to change the
Resize
class in the following way:`class Resize(object): def init(self, size=300): self.size = size
`
This pads the shorter images size, such that the original aspect ration is kept.
Please let me know your thoughts about this.