Skip to content

Optimize Ernie 4.5 VL timestamp rendering with cached overlays#43484

Open
raimbekovm wants to merge 1 commit intohuggingface:mainfrom
raimbekovm:optimize-ernie-timestamp-rendering
Open

Optimize Ernie 4.5 VL timestamp rendering with cached overlays#43484
raimbekovm wants to merge 1 commit intohuggingface:mainfrom
raimbekovm:optimize-ernie-timestamp-rendering

Conversation

@raimbekovm
Copy link
Copy Markdown
Contributor

What does this PR do?

Optimizes timestamp rendering in Ernie 4.5 VL video processing by caching text overlays and using torch alpha blending instead of slow torch->PIL->torch conversion for each frame.

Performance improvement:

Mode Time/frame Speedup
Original ~2.2 ms 1x
Cold cache 1.5 ms 1.5x
Warm cache 0.17 ms ~13x

For 180 frames (default max): ~400ms → ~30ms

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline, Pull Request section?
  • Was this discussed/approved via a Github issue or the forum?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@yonigozlan @molbap

@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: ernie4_5_vl_moe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant