vitrivr / cineast

Cineast is a multi-feature content-based mulitmedia retrieval engine. It is capable of retrieving images, audio- and video sequences as well as 3d models based on edge or color sketches, textual descriptions and example objects.
MIT License
57 stars 50 forks source link

Inefficient SkeletonPose TensorFlow model loading #303

Closed Spiess closed 2 years ago

Spiess commented 2 years ago

Models used for pose detection in images are loaded every time a SkeletonPose class is instantiated, even for similarity queries not using pose extraction.

The following steps should be taken to avoid this:

sauterl commented 2 years ago

Even though the commit bfb6fb1f does not address this issue properly, @Spiess please have a look at this on the branch and report your findings with respect to speedup.

Spiess commented 2 years ago

Do you know if it is necessary to use thread-level caching? The example you are referencing only uses OpenCV functions and models, if I understand correctly, and there this might be necessary, but for TensorFlow models this may even cause problems depending on if the default session is global or thread local.

lucaro commented 2 years ago

Yes, in this case, it might make sense to explicitly avoid parallelism since tensorflow already uses all compute resources it can get (at least in CPU mode).