MCPcopy
hub / github.com/ultralytics/yolov5 / run

Method run

utils/callbacks.py:60–76  ·  view source on GitHub ↗

Loop through the registered actions and fire all callbacks on main thread Args: hook: The name of the hook to check, defaults to all args: Arguments to receive from YOLOv5 thread: (boolean) Run callbacks in daemon thread kwargs: Keywo

(self, hook, *args, thread=False, **kwargs)

Source from the content-addressed store, hash-verified

58 return self._callbacks[hook] if hook else self._callbacks
59
60 def run(self, hook, *args, thread=False, **kwargs):
61 """
62 Loop through the registered actions and fire all callbacks on main thread
63
64 Args:
65 hook: The name of the hook to check, defaults to all
66 args: Arguments to receive from YOLOv5
67 thread: (boolean) Run callbacks in daemon thread
68 kwargs: Keyword Arguments to receive from YOLOv5
69 """
70
71 assert hook in self._callbacks, f"hook '{hook}' not found in callbacks {self._callbacks}"
72 for logger in self._callbacks[hook]:
73 if thread:
74 threading.Thread(target=logger['callback'], args=args, kwargs=kwargs, daemon=True).start()
75 else:
76 logger['callback'](*args, **kwargs)

Callers 12

runFunction · 0.80
trainFunction · 0.80
runFunction · 0.80
testFunction · 0.80
export_openvinoFunction · 0.80
export_edgetpuFunction · 0.80
export_tfjsFunction · 0.80
device_countFunction · 0.80
restapi.pyFile · 0.80
trainFunction · 0.80
trainFunction · 0.80
forwardMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected