Skip to content

Commit e128a7b

Browse files
committed
Clipping prior boxes in point form
1 parent 4bf015c commit e128a7b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

layers/functions/prior_box.py

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from math import sqrt as sqrt
33
from itertools import product as product
44
import torch
5+
from layers.box_utils import point_form, center_size
56

67

78
class PriorBox(object):
@@ -51,5 +52,7 @@ def forward(self):
5152
# back to torch land
5253
output = torch.Tensor(mean).view(-1, 4)
5354
if self.clip:
55+
output = point_form(output)
5456
output.clamp_(max=1, min=0)
57+
output = center_size(output)
5558
return output

0 commit comments

Comments
 (0)