Skip to content

Commit c70800f

Browse files
author
Roman Donchenko
authored
Merge pull request #2189 from Wovchena/gesture_recognition-multiprocessing-workaround-for-mac
gesture_recognition: workaround multiprocessing for mac
2 parents 9431195 + 787121f commit c70800f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

demos/gesture_recognition_demo/python/gesture_recognition_demo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import time
2121
import json
2222
import os
23+
import multiprocessing
2324
from argparse import ArgumentParser, SUPPRESS
2425

2526
import cv2
@@ -251,4 +252,7 @@ def main():
251252

252253

253254
if __name__ == '__main__':
255+
# https://github.com/opencv/opencv/issues/5150#issuecomment-197413178
256+
# https://github.com/opencv/opencv/issues/5150#issuecomment-197540235
257+
multiprocessing.set_start_method('spawn')
254258
sys.exit(main() or 0)

demos/tests/run_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,5 +230,5 @@ def option_to_args(key, value):
230230

231231
sys.exit(0 if num_failures == 0 else 1)
232232

233-
if __name__ == main():
233+
if __name__ == '__main__':
234234
main()

0 commit comments

Comments
 (0)