Skip to content

Commit ccbb4d0

Browse files
AmitMYclaude
andcommitted
fix: flush all reused HolisticPool instances regardless of static_image_mode
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a8efdf5 commit ccbb4d0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/python/pose_format/utils/holistic.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,12 @@ def acquire(cls, n: int, config: dict) -> list:
123123

124124
need = n - len(acquired)
125125

126-
# Clear tracking state for reused instances by processing a blank frame.
127-
# This flushes the PreviousLoopbackCalculator state so the next real frame
128-
# runs full detection instead of using stale tracking from a previous video.
129-
reused = acquired[:len(acquired) - need]
130-
if reused and not config.get('static_image_mode', False):
131-
with ThreadPoolExecutor(max_workers=len(reused)) as ex:
132-
list(ex.map(lambda h: h.process(cls._BLANK_FRAME), reused))
126+
# Clear internal graph state for reused instances by processing a blank frame.
127+
# Faster than reset() (which tears down and restarts the entire graph)
128+
# while flushing stale tracking/detection state from a previous video.
129+
if acquired:
130+
with ThreadPoolExecutor(max_workers=len(acquired)) as ex:
131+
list(ex.map(lambda h: h.process(cls._BLANK_FRAME), acquired))
133132

134133
if need > 0:
135134
with ThreadPoolExecutor(max_workers=need) as ex:

0 commit comments

Comments
 (0)