Docs Ruff codeblocks reformat and fix (#12847)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
be5cf7a033
commit
68031133fd
9 changed files with 167 additions and 178 deletions
|
|
@ -153,15 +153,16 @@ Experimentation by NVIDIA led them to recommend using at least 500 calibration i
|
|||
model = YOLO("yolov8n.pt")
|
||||
model.export(
|
||||
format="engine",
|
||||
dynamic=True, #(1)!
|
||||
batch=8, #(2)!
|
||||
workspace=4, #(3)!
|
||||
dynamic=True, # (1)!
|
||||
batch=8, # (2)!
|
||||
workspace=4, # (3)!
|
||||
int8=True,
|
||||
data="coco.yaml", #(4)!
|
||||
data="coco.yaml", # (4)!
|
||||
)
|
||||
|
||||
# Load the exported TensorRT INT8 model
|
||||
model = YOLO("yolov8n.engine", task="detect")
|
||||
|
||||
# Run inference
|
||||
result = model.predict("https://ultralytics.com/images/bus.jpg")
|
||||
```
|
||||
|
|
@ -385,36 +386,14 @@ Expand sections below for information on how these models were exported and test
|
|||
model = YOLO("yolov8n.pt")
|
||||
|
||||
# TensorRT FP32
|
||||
out = model.export(
|
||||
format="engine",
|
||||
imgsz:640,
|
||||
dynamic:True,
|
||||
verbose:False,
|
||||
batch:8,
|
||||
workspace:2
|
||||
)
|
||||
|
||||
out = model.export(format="engine", imgsz=640, dynamic=True, verbose=False, batch=8, workspace=2)
|
||||
|
||||
# TensorRT FP16
|
||||
out = model.export(format="engine", imgsz=640, dynamic=True, verbose=False, batch=8, workspace=2, half=True)
|
||||
|
||||
# TensorRT INT8 with calibration `data` (i.e. COCO, ImageNet, or DOTAv1 for appropriate model task)
|
||||
out = model.export(
|
||||
format="engine",
|
||||
imgsz:640,
|
||||
dynamic:True,
|
||||
verbose:False,
|
||||
batch:8,
|
||||
workspace:2,
|
||||
half=True
|
||||
)
|
||||
|
||||
# TensorRT INT8
|
||||
out = model.export(
|
||||
format="engine",
|
||||
imgsz:640,
|
||||
dynamic:True,
|
||||
verbose:False,
|
||||
batch:8,
|
||||
workspace:2,
|
||||
int8=True,
|
||||
data:"data.yaml" # COCO, ImageNet, or DOTAv1 for appropriate model task
|
||||
format="engine", imgsz=640, dynamic=True, verbose=False, batch=8, workspace=2, int8=True, data="coco8.yaml"
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue