videocr-PaddleOCR
videocr-PaddleOCR copied to clipboard
Improve subtitle merge algorithm
The algorithm currently merges 2 subtitles by picking the one with the highest average confidence. Ideally, all characters with high confidence should be used if there is no conflict in their positions e.g.
If merging a (99) b (99) c (99)
and a (99) b (99) a (98) c (99)
, the result should be abac
instead of abc
Is this the reason why the subtitle appears wrong ( flipped and sometimes in the wrong order)?
@obedabit do you have an example?
@oliverfei Yes I do, here is an example, I have the following photo it has two line sentences, and the output is wrong on one line, it should be two lines and the last sentence should be the first.
output:
3 00:00:51,416 --> 00:00:55,583 right in front of you, of course you'd be depressed. No, if someone else kissed the person you liked
Ah ok. That's cause the library doesn't account the multiline scenario at the moment which is unrelated to this issue.
so should we make an issue for It or you will fix it without one?
I pushed something if you want to try it out
It is ok, amazing work
The subtitle merging algorithm used by this library is too bad for subtitles that appear as if they were typed rather than appearing in a single frame.