ultralytics 8.0.163 add new gpu-latest runner to CI actions (#4565)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maia Numerosky <17316848+maianumerosky@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-08-26 03:45:19 +02:00 committed by GitHub
parent 431cef3955
commit b4dca690d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 153 additions and 17 deletions

View file

@ -182,6 +182,7 @@ class ProfileModels:
num_warmup_runs=10,
min_time=60,
imgsz=640,
half=True,
trt=True,
device=None):
self.paths = paths
@ -189,6 +190,7 @@ class ProfileModels:
self.num_warmup_runs = num_warmup_runs
self.min_time = min_time
self.imgsz = imgsz
self.half = half
self.trt = trt # run TensorRT profiling
self.device = device or torch.device(0 if torch.cuda.is_available() else 'cpu')
@ -209,12 +211,12 @@ class ProfileModels:
model_info = model.info()
if self.trt and self.device.type != 'cpu' and not engine_file.is_file():
engine_file = model.export(format='engine',
half=True,
half=self.half,
imgsz=self.imgsz,
device=self.device,
verbose=False)
onnx_file = model.export(format='onnx',
half=True,
half=self.half,
imgsz=self.imgsz,
simplify=True,
device=self.device,