MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / move_to_separate_thread

Function move_to_separate_thread

deeplabcut/gui/utils.py:49–65  ·  view source on GitHub ↗
(func: Callable, capture_outputs: bool = False)

Source from the content-addressed store, hash-verified

47
48
49def move_to_separate_thread(func: Callable, capture_outputs: bool = False):
50 thread = QtCore.QThread()
51 if capture_outputs:
52 worker = CaptureWorker(func)
53 else:
54 worker = Worker(func)
55
56 worker.finished.connect(worker.deleteLater)
57 worker.moveToThread(thread)
58 thread.started.connect(worker.run)
59
60 def stop_thread():
61 thread.quit()
62 thread.wait()
63
64 worker.finished.connect(stop_thread)
65 return worker, thread
66
67
68def parse_version(version: str) -> tuple[int, int, int]:

Callers 5

__init__Method · 0.90
extract_framesMethod · 0.90
run_transformerMethod · 0.90
analyze_videosMethod · 0.90

Calls 3

CaptureWorkerClass · 0.85
WorkerClass · 0.85
connectMethod · 0.80

Tested by

no test coverage detected