GMU:Procedural Cut/Assignment Object Recognition: Difference between revisions

From Medien Wiki
No edit summary
No edit summary
Line 21: Line 21:
=== Auto_detecting_words_in_srt ===
=== Auto_detecting_words_in_srt ===
[[File:guichu.py]]
[[File:guichu.py]]
#library srt link: https://github.com/cdown/srt
#pip install -U srt
#copy paste srt file as following(focus on the format at head and tail)
#it returns a sequence of subtitle classes object, contains index,time,contant usw.
#using for loop searching desired word in every object.content.
#it returns the time interval at the start and the end
#use srt.timedelta_to_srt_timestamp convert the time to normal one