First, thanks very much for this implementation.
When we read the data from dataset, it comes with an image and its annotation (bbox). If used SSD300, the image size is resized to [300, 300]:
# taken from augmentations.py
class Resize(object):
def __init__(self, size=300):
self.size = size
def __call__(self, image, boxes=None, labels=None):
image = cv2.resize(image, (self.size,
self.size))
return image, boxes, labels
However, why boxes NOT changed accordingly?
Could you help me with this please?
The boxes are not changed accordingly because we are trying to learn to scale the boxes we predict to their actual dimensions. You can see in the demo notebook that the predicted boxes are displayed on top of the original size image (not one that is scaled to 300x300).
@amdegroot I am sorry, still not get the idea. In my mind, during training you estimate the bbox and compare with ground truth. During testing, however, you estimate the bbox with the trained model, and scale it according to image size to get actual bbox. You do not do such scaling during training to match with ground truth, dont you? any help really appreciated. Thanks.
Maybe I know what you mean.
Actually, once you got the relative bbox (values are between 0 and 1), you can keep the relative values fixed. When you need the actual bbox at some moments, just change them according to the image size at the same moment.
i,e. when you change the actual image size, the relative bbox values don't change. You can have try it.
@amdegroot I am sorry, still not get the idea. In my mind, during training you estimate the bbox and compare with ground truth. During testing, however, you estimate the bbox with the trained model, and scale it according to image size to get actual bbox. You do not do such scaling during training to match with ground truth, dont you? any help really appreciated. Thanks.
Most helpful comment
The boxes are not changed accordingly because we are trying to learn to scale the boxes we predict to their actual dimensions. You can see in the demo notebook that the predicted boxes are displayed on top of the original size image (not one that is scaled to 300x300).