Update/inplace ops (#5233)
* Clip Objects365 autodownload labels (#5214) Fixes out of bounds labels that seem to affect ~10% of images in dataset. * Inplace ops
This commit is contained in:
1 parent
0000334a6f
commit
13f7275555
3 files changed
+6
-5
No files matched your search
@@ -139,7 +139,7 @@ def run(weights=ROOT / 'yolov5s.pt', # model.pt path(s)
|
||||
else:
|
||||
img = torch.from_numpy(img).to(device)
|
||||
img = img.half() if half else img.float() # uint8 to fp16/32
|
||||
img = img / 255.0 # 0 - 255 to 0.0 - 1.0
|
||||
img /= 255.0 # 0 - 255 to 0.0 - 1.0
|
||||
if len(img.shape) == 3:
|
||||
img = img[None] # expand for batch dim
|
||||
t2 = time_sync()
|
||||
|
||||
Reference in new issue
Block a user