Closed powermano closed 1 year ago
In DN-DETR, detrex/layers/denoising.py
https://github.com/IDEA-Research/detrex/blob/main/detrex/layers/denoising.py#:~:text=boxes%20(torch.Tensor)%3A%20Bounding%20boxes%20in%20format%20%60%60(x1%2C%20y1%2C%20x2%2C%20y2)%60%60%20with
It should be: Bounding boxes in format ``(x_c, y_c, w, h)
Bounding boxes in format ``(x_c, y_c, w, h)
def apply_box_noise( boxes: torch.Tensor, box_noise_scale: float = 0.4, ): """ Args: boxes (torch.Tensor): Bounding boxes in format ``(x_c, y_c, w, h)`` with shape ``(num_boxes, 4)`` box_noise_scale (float): Scaling factor for box noising. Default: 0.4. """ if box_noise_scale > 0: diff = torch.zeros_like(boxes) diff[:, :2] = boxes[:, 2:] / 2 diff[:, 2:] = boxes[:, 2:] boxes += torch.mul((torch.rand_like(boxes) * 2 - 1.0), diff) * box_noise_scale boxes = boxes.clamp(min=0.0, max=1.0) return boxes
Thank you for your correction. We will modify this.
In DN-DETR, detrex/layers/denoising.py
https://github.com/IDEA-Research/detrex/blob/main/detrex/layers/denoising.py#:~:text=boxes%20(torch.Tensor)%3A%20Bounding%20boxes%20in%20format%20%60%60(x1%2C%20y1%2C%20x2%2C%20y2)%60%60%20with
It should be:
Bounding boxes in format ``(x_c, y_c, w, h)