tfaehse / DashcamCleaner

Censor identifiable information in videos, in particular dashcam recordings in Germany.
GNU Affero General Public License v3.0
130 stars 27 forks source link

Performance improvement: process blurring of batches in parallel #59

Closed tfaehse closed 1 year ago

tfaehse commented 1 year ago

Analysing the callgraph of the tool shows that ~40% of execution time is spent blurring identified detections:

More detections (and the usage of the beautiful feather_edges option) can yet increase the amount of time spent on blurring. Also, faster inference times (especially when using GPUs, which wasn't done in this profiling run) would increase this share further, to ~75% in some cases. callgraph With that in mind, a (simple) improvement is to process the blurring of identified regions in parallel, on a per-batch level. This comes with a few side effects:

With this step done, the "limiting factors" remaining are:

However, each of these steps feature parallelisation in their own scope. For the most part (and depending on your hardware), this change should lead to significantly higher resource utilisation.