Commit b44c43c
Optimize compose_frame by removing redundant mask copy (#223)
The `segment` method of `ImageSegmenter` returns a new numpy array (created by `cv2.GaussianBlur`).
Wrapping this in `copy.copy` is redundant and adds unnecessary overhead (memory allocation and data copying).
This commit removes the `copy.copy` call and the unused `copy` import.
Micro-benchmark results show ~16% improvement in the copy operation time for 1280x720 frames.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: fangfufu <2323403+fangfufu@users.noreply.github.com>1 parent 5b0cd96 commit b44c43c
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
328 | 327 | | |
329 | 328 | | |
330 | 329 | | |
331 | | - | |
| 330 | + | |
332 | 331 | | |
333 | 332 | | |
334 | 333 | | |
| |||
0 commit comments