Skip to content

Commit

Permalink
Fixing named arguments in SR
Browse files Browse the repository at this point in the history
  • Loading branch information
placccebo committed Jul 30, 2024
1 parent f4db753 commit 19d3239
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion samples/opencv_cuda_bg_remover_mog2/bgremover.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def process_frame(self, buffer: Gst.Buffer, frame_meta: NvDsFrameMeta):
frame_mat_copy = frame_mat.clone()

back_sub = self.back_subtractors[frame_meta.source_id]
self.gaussian_filter.apply(frame_mat_copy, frame_mat_copy, stream=stream)
self.gaussian_filter.apply(
frame_mat_copy, frame_mat_copy, stream=stream
)
cu_mat_fg = back_sub.apply(frame_mat_copy, -1, stream)
res_image = frame_mat_copy.copyTo(cu_mat_fg, stream)

Expand Down
12 changes: 10 additions & 2 deletions samples/super_resolution/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,17 @@ def process_frame(self, buffer: Gst.Buffer, frame_meta: NvDsFrameMeta):
)

# Place original frame and super resolution frame side by side
opencv_utils.alpha_comp(aux_mat, scaled_image, (0, 0), cuda_stream)
opencv_utils.alpha_comp(
aux_mat, sr_image_np, (sr_image_np.shape[1], 0), cuda_stream
aux_mat,
scaled_image,
(0, 0),
stream=cuda_stream,
)
opencv_utils.alpha_comp(
aux_mat,
sr_image_np,
(sr_image_np.shape[1], 0),
stream=cuda_stream,
)
else:
self.logger.warning('Super resolution attribute not found.')
Expand Down

0 comments on commit 19d3239

Please sign in to comment.