You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: musicalgestures/_blurfaces.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ def mg_blurfaces(self,
80
80
save_data=True,
81
81
data_format='csv',
82
82
color=(0, 0, 0),
83
-
use_gpu=True,
83
+
use_gpu=False,
84
84
target_name=None,
85
85
overwrite=False):
86
86
"""
@@ -102,7 +102,7 @@ def mg_blurfaces(self,
102
102
save_data (bool, optional): Whether to save the scaled coordinates of the face mask (time (ms), x1, y1, x2, y2) for each frame to a file. Defaults to True.
103
103
data_format (str, optional): Specifies format of blur_faces-data. Accepted values are 'csv', 'tsv' and 'txt'. For multiple output formats, use list, e.g. ['csv', 'txt']. Defaults to 'csv'.
104
104
color (tuple, optional): Customized color of the rectangle boxes. Defaults to black (0, 0, 0).
105
-
use_gpu (bool, optional): Whether to attempt GPU (CUDA) acceleration for face detection. Falls back to CPU automatically if CUDA is unavailable. Defaults to True.
105
+
use_gpu (bool, optional): Whether to attempt GPU (CUDA) acceleration for face detection. Falls back to CPU automatically if CUDA is unavailable. Defaults to False.
106
106
target_name (str, optional): Target output name. Defaults to None (which assumes that the input filename with the suffix "_blurred" should be used).
107
107
overwrite (bool, optional): Whether to allow overwriting existing files or to automatically increment target filenames to avoid overwriting. Defaults to False.
angle_of_view (int, optional): angle of view of camera, for reporting flow in meters per second. Defaults to 0.
70
70
scaledown (int, optional): factor to scaledown frame size of the video. Defaults to 1.
71
71
skip_empty (bool, optional): If True, repeats previous frame in the output when encounters an empty frame. Defaults to False.
72
-
use_gpu (bool, optional): Whether to attempt GPU (CUDA) acceleration using `cv2.cuda.FarnebackOpticalFlow`. When `True`, falls back to CPU automatically if CUDA is unavailable or the required OpenCV CUDA modules are not installed. When `False`, CPU processing is used unconditionally. Defaults to True.
72
+
use_gpu (bool, optional): Whether to attempt GPU (CUDA) acceleration using `cv2.cuda.FarnebackOpticalFlow`. When `True`, falls back to CPU automatically if CUDA is unavailable or the required OpenCV CUDA modules are not installed. When `False`, CPU processing is used unconditionally. Defaults to False.
73
73
target_name (str, optional): Target output name for the video. Defaults to None (which assumes that the input filename with the suffix "_flow_dense" should be used).
74
74
overwrite (bool, optional): Whether to allow overwriting existing files or to automatically increment target filenames to avoid overwriting. Defaults to False.
print('cv2.cuda.FarnebackOpticalFlow is unavailable (requires opencv-contrib built with CUDA). Switching to CPU for dense optical flow.')
112
111
elifget_cuda_device_count() <=0:
113
112
print('OpenCV CUDA backend is unavailable. Switching to CPU for dense optical flow.')
@@ -322,7 +321,7 @@ def sparse(
322
321
of_max_level=2,
323
322
of_criteria=(cv2.TERM_CRITERIA_EPS|
324
323
cv2.TERM_CRITERIA_COUNT, 10, 0.03),
325
-
use_gpu=True,
324
+
use_gpu=False,
326
325
target_name=None,
327
326
overwrite=False):
328
327
"""
@@ -337,7 +336,7 @@ def sparse(
337
336
of_win_size (tuple, optional): Size of the search window at each pyramid level. Defaults to (15, 15).
338
337
of_max_level (int, optional): 0-based maximal pyramid level number. If set to 0, pyramids are not used (single level), if set to 1, two levels are used, and so on. If pyramids are passed to input then the algorithm will use as many levels as pyramids have but no more than `maxLevel`. Defaults to 2.
339
338
of_criteria (tuple, optional): Specifies the termination criteria of the iterative search algorithm (after the specified maximum number of iterations criteria.maxCount or when the search window moves by less than criteria.epsilon). Defaults to (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03).
340
-
use_gpu (bool, optional): Whether to attempt GPU (CUDA) acceleration using `cv2.cuda.SparsePyrLKOpticalFlow`. When `True`, falls back to CPU automatically if CUDA is unavailable or the required OpenCV CUDA modules are not installed. When `False`, CPU processing is used unconditionally. Defaults to True.
339
+
use_gpu (bool, optional): Whether to attempt GPU (CUDA) acceleration using `cv2.cuda.SparsePyrLKOpticalFlow`. When `True`, falls back to CPU automatically if CUDA is unavailable or the required OpenCV CUDA modules are not installed. When `False`, CPU processing is used unconditionally. Defaults to False.
341
340
target_name (str, optional): Target output name for the video. Defaults to None (which assumes that the input filename with the suffix "_flow_sparse" should be used).
342
341
overwrite (bool, optional): Whether to allow overwriting existing files or to automatically increment target filenames to avoid overwriting. Defaults to False.
343
342
@@ -370,11 +369,10 @@ def sparse(
370
369
length=int(vidcap.get(cv2.CAP_PROP_FRAME_COUNT))
371
370
372
371
# Determine whether to use GPU-accelerated sparse optical flow
0 commit comments