torchcv
torchcv copied to clipboard
Non Normalized coordinates
Hi, I am working on face detection using your ssd model. One thing I noticed that my model was giving zero loss, i.e all the ious were zero. After long inspection https://github.com/kuangliu/torchcv/blob/6291f3e1e4bbf6467fd6b1e79001d34a59481bb6/examples/ssd/train.py#L63 this line passes the boxes coordinates as it is. It should be normalized to get correct iou
Yeah, i also noticed that you tested the VOC dataset by the image size of 300*300.
@vaishnavm217 to fix this do we just do something like this? to normalise the bounding boxes.
w,h = image.size
boxes /= torch.Tensor([w,h,w,h]).expand_as(boxes)
That's more appropriate. But assuming a square image as input, you can just divide it by any one of the dimension.
On Sun, 15 Jul 2018, 10:22 Leon, [email protected] wrote:
@vaishnavm217 https://github.com/vaishnavm217 to fix this do we just do something like this? to normalise the bounding boxes.
w,h = image.size boxes /= torch.Tensor([w,h,w,h]).expand_as(boxes)— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kuangliu/torchcv/issues/30#issuecomment-405067321, or mute the thread https://github.com/notifications/unsubscribe-auth/AQy9UHw_G5TtJTRyZOSs4DGpGYW8B_O4ks5uGsqmgaJpZM4UlnKK .
@vaishnavm217 thank you for the confirmation. much appreciated. I'm testing out the train now and it's working well.
Just looking ahead. When I run it through prediction or evaluation, where would the best place to denormalise the labels?.