ultralytics 8.1.40 search in Python sets {} for speed (#9450)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
30484d5925
commit
ea527507fe
41 changed files with 97 additions and 93 deletions
|
|
@ -159,7 +159,7 @@ class Exporter:
|
|||
_callbacks (dict, optional): Dictionary of callback functions. Defaults to None.
|
||||
"""
|
||||
self.args = get_cfg(cfg, overrides)
|
||||
if self.args.format.lower() in ("coreml", "mlmodel"): # fix attempt for protobuf<3.20.x errors
|
||||
if self.args.format.lower() in {"coreml", "mlmodel"}: # fix attempt for protobuf<3.20.x errors
|
||||
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python" # must run before TensorBoard callback
|
||||
|
||||
self.callbacks = _callbacks or callbacks.get_default_callbacks()
|
||||
|
|
@ -171,9 +171,9 @@ class Exporter:
|
|||
self.run_callbacks("on_export_start")
|
||||
t = time.time()
|
||||
fmt = self.args.format.lower() # to lowercase
|
||||
if fmt in ("tensorrt", "trt"): # 'engine' aliases
|
||||
if fmt in {"tensorrt", "trt"}: # 'engine' aliases
|
||||
fmt = "engine"
|
||||
if fmt in ("mlmodel", "mlpackage", "mlprogram", "apple", "ios", "coreml"): # 'coreml' aliases
|
||||
if fmt in {"mlmodel", "mlpackage", "mlprogram", "apple", "ios", "coreml"}: # 'coreml' aliases
|
||||
fmt = "coreml"
|
||||
fmts = tuple(export_formats()["Argument"][1:]) # available export formats
|
||||
flags = [x == fmt for x in fmts]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue