ultralytics 8.3.44 improve Triton Inference Server metadata (#17921)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
530e6b9342
commit
c284a9e974
4 changed files with 20 additions and 2 deletions
|
|
@ -48,6 +48,16 @@ from ultralytics import YOLO
|
|||
# Load a model
|
||||
model = YOLO("yolo11n.pt") # load an official model
|
||||
|
||||
# Retreive metadata during export
|
||||
metadata = []
|
||||
|
||||
|
||||
def export_cb(exporter):
|
||||
metadata.append(exporter.metadata)
|
||||
|
||||
|
||||
model.add_callback("on_export_end", export_cb)
|
||||
|
||||
# Export the model
|
||||
onnx_file = model.export(format="onnx", dynamic=True)
|
||||
```
|
||||
|
|
@ -107,7 +117,13 @@ The Triton Model Repository is a storage location where Triton can access and lo
|
|||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
parameters {
|
||||
key: "metadata"
|
||||
value: {
|
||||
string_value: "%s"
|
||||
}
|
||||
}
|
||||
""" % metadata[0]
|
||||
|
||||
with open(triton_model_path / "config.pbtxt", "w") as f:
|
||||
f.write(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue