Move cudnn.benchmarks(True) to LoadStreams (#9258)

* Move cudnn.benchmarks(True) to LoadStreams

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Move cudnn.benchmarks(True) to LoadStreams

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-09-02 14:12:10 +02:00
1 parent 9da6d0f9f5
commit ffdb58b0e0
3 files changed
+4 -54

No files matched your search

-2
View File
@@ -31,7 +31,6 @@ import sys
from pathlib import Path
import torch
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
FILE = Path(__file__).resolve()
@@ -89,7 +88,6 @@ def run(
# Dataloader
if webcam:
view_img = check_imshow()
cudnn.benchmark = True # set True to speed up constant image size inference
dataset = LoadStreams(source, img_size=imgsz, transforms=classify_transforms(imgsz[0]))
bs = len(dataset) # batch_size
else: