Closed wetoo-cando closed 6 months ago
This is a good catch, I did not think about the problems it could create. We should update the data pipeline, thank you.
Hello, instead of removing the rotation augmentation completely, I suggest changing the border mode:
A.Rotate(limit=180, border_mode=cv2.BORDER_CONSTANT)
Instead of mirroring, this will just add a black border and should be less confusing during the training.
Thanks @thohemp !
I noticed an inconsistency in data augmentation using Albumentations.
When you rotate the (cropped) image, Albumentations seems to fill up corner areas (which are empty due to the rotation) by mirroring pixels in the nearby area. In some situations with an object of interest near the image corner, the object in the image gets overwritten by mirrored pixels. However, the transformed keypoints corr. to the object still remain. This results in a training image with keypoints "apparently in the middle of nowhere".
This cannot be good for training. Has anyone noticed this before? For now I am setting
A.Rotate(limit=0)
(effectively removing the rotation randomization). A better way of course would be to remove the rotated keypoints if the object gets overwritten.https://github.com/NVlabs/Deep_Object_Pose/blob/1655459de50cfcbf01f7d24775f834cab400aa25/scripts/train2/utils_dope.py#L258C8-L267C10