remove imwrite from augment
This commit is contained in:
parent
d79c3bd076
commit
b3e1d74478
|
@ -236,13 +236,13 @@ class Darknet(nn.Module):
|
||||||
return self.forward_once(x)
|
return self.forward_once(x)
|
||||||
else: # Augment images (inference and test only) https://github.com/ultralytics/yolov3/issues/931
|
else: # Augment images (inference and test only) https://github.com/ultralytics/yolov3/issues/931
|
||||||
img_size = x.shape[-2:] # height, width
|
img_size = x.shape[-2:] # height, width
|
||||||
s = [0.83, 1.33] # scales
|
s = [0.83, 0.67] # scales
|
||||||
y = []
|
y = []
|
||||||
for i, xi in enumerate((x,
|
for i, xi in enumerate((x,
|
||||||
torch_utils.scale_img(x.flip(3), s[0], same_shape=False), # flip-lr and scale
|
torch_utils.scale_img(x.flip(3), s[0], same_shape=False), # flip-lr and scale
|
||||||
torch_utils.scale_img(x, s[1], same_shape=False), # scale
|
torch_utils.scale_img(x, s[1], same_shape=False), # scale
|
||||||
)):
|
)):
|
||||||
cv2.imwrite('img%g.jpg' % i, 255 * xi[0].numpy().transpose((1, 2, 0))[:, :, ::-1])
|
# cv2.imwrite('img%g.jpg' % i, 255 * xi[0].numpy().transpose((1, 2, 0))[:, :, ::-1])
|
||||||
y.append(self.forward_once(xi)[0])
|
y.append(self.forward_once(xi)[0])
|
||||||
|
|
||||||
y[1][..., :4] /= s[0] # scale
|
y[1][..., :4] /= s[0] # scale
|
||||||
|
|
Loading…
Reference in New Issue