Giter VIP home page Giter VIP logo

yaofanguk / video-subtitle-extractor Goto Github PK

View Code? Open in Web Editor NEW
4.9K 4.9K 553.0 1.22 GB

视频硬字幕提取,生成srt文件。无需申请第三方API,本地实现文本识别。基于深度学习的视频字幕提取框架,包含字幕区域检测、字幕内容提取。A GUI tool for extracting hard-coded subtitle (hardsub) from videos and generating srt files.

License: Apache License 2.0

Python 99.32% Jupyter Notebook 0.48% Cython 0.19% Shell 0.01%
deep-learning extract hardsub ocr ripper srt subrip subtitles

video-subtitle-extractor's People

Contributors

eritpchy avatar koz39 avatar latot avatar neoyxm avatar thefiercewarrior avatar yaofanguk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video-subtitle-extractor's Issues

乱码是为什么呢?

win10,Anaconda环境,非虚拟机,视频是项目里自带的test.mp4

Snipaste_2021-08-20_23-05-53
Snipaste_2021-08-20_23-06-06

换了个视频还是乱码

安装出错。

(videoEnv) D:\Users\video-subtitle-extractor-main\video-subtitle-extractor-main>pip install -r requirements(win).txt
Requirement 'tensorflow @ https://github.com/fo40225/tensorflow-windows-wheel/raw/master/1.4.0/py36/GPU/cuda91cudnn7avx2/tensorflow_gpu-1.4.0-cp36-cp36m-win_amd64.whl' looks like a filename, but the file does not exist
Exception:
Traceback (most recent call last):
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\site-packages\pip\commands\install.py", line 312, in run
wheel_cache
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\site-packages\pip\basecommand.py", line 295, in populate_requirement_set
wheel_cache=wheel_cache):
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\site-packages\pip\req\req_file.py", line 93, in parse_requirements
for req in req_iter:
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\site-packages\pip\req\req_file.py", line 158, in process_line
isolated=isolated, options=req_options, wheel_cache=wheel_cache
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\site-packages\pip\req\req_install.py", line 211, in from_line
link = Link(path_to_url(p))
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\site-packages\pip\download.py", line 465, in path_to_url
url = urllib_parse.urljoin('file:', urllib_request.pathname2url(path))
File "D:\ProgramData\Anaconda3\envs\videoEnv\lib\nturl2path.py", line 60, in pathname2url
raise OSError(error)
OSError: Bad path: D:\Users\video-subtitle-extractor-main\video-subtitle-extractor-main\tensorflow @ https:\github.com\fo40225\tensorflow-windows-wheel\raw\master\1.4.0\py36\GPU\cuda91cudnn7avx2\tensorflow_gpu-1.4.0-cp36-cp36m-win_amd64.whl
You are using pip version 9.0.1, however version 20.2.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

字幕時間不精準

我使用google colab辨識了幾部超過20分的影片後發現字幕的時間並不精準
不論解析度為何
通常字幕會提早0~3秒顯示出來
不知道更改config.py能不能改善這個問題?

Seperate English

A separate English language option is needed so that Chinese text is auto ignored.

建议当磁盘空间不足时自动暂停或有空间后自动恢复

目前版本当磁盘空间不足时好像会一直循环报错,但当磁盘空间恢复后(发现出错手动删除其他文件腾出几个G的空间)却没有恢复执行,还是一直报错不能生成字幕。我的电脑显卡性能不太好,一部影片基本要一两天。遇到这种情况只能从头再来。
所以想能不能当遇到磁盘空间不足时能自动暂停,等空间恢复后能手动或自动继续。当然这只是个优化,目前的功能已经很强大了!

附上错误日志
--- Logging error ---
Traceback (most recent call last):
File "D:\vse\Python\lib\logging_init_.py", line 1089, in emit
self.flush()
File "D:\vse\Python\lib\logging_init_.py", line 1069, in flush
self.stream.flush()
OSError: [Errno 22] Invalid argument
Call stack:
File "D:\vse\Python\lib\threading.py", line 890, in _bootstrap
self._bootstrap_inner()
File "D:\vse\Python\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "D:\vse\Python\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "D:\vse\resources\main.py", line 118, in run
self.extract_frame_by_det()
File "D:\vse\resources\main.py", line 278, in extract_frame_by_det
if self._compare_ocr_result(frame_last, frame):
File "D:\vse\resources\main.py", line 867, in _compare_ocr_result
area_text1 = "".join(self.__get_area_text(self.ocr.predict(img1)))
File "D:\vse\resources\main.py", line 36, in predict
detection_box, recognise_result = self.recogniser(image)
File "D:\vse\resources\backend\tools\infer\predict_system.py", line 109, in call
logger.info("rec_res num : {}, elapse : {}".format(
Message: 'rec_res num : 9, elapse : 0.05385446548461914'

运行错误

image

环境已经安装好,运行报上图中的错误

建议加一个暂停功能

有时候同时识别几部大影片,时间往往会超过24小时,此时CPU占用100,其他事情做不了,如果急用电脑只能强制关掉。希望加个暂停功能,使用电脑的时候暂停,空闲的时候继续识别。

疑似tensorflow的问题?

python ./main/demo.py

/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526:` FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
please input your video file path name:/Users/MyName/Downloads/1.mp4
fps: 25.0
Total Frames: 16946
Video Resolution: (360, 480)
Extracting frames, please wait...
WARNING:tensorflow:From /Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
[WARNING 2021-01-03 20:12:01,341 new_func:323] From /Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /Users/MyName/video-subtitle-extractor/nets/model_train.py:30: LSTMCell.init (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.
[WARNING 2021-01-03 20:12:01,531 new_func:323] From /Users/MyName/video-subtitle-extractor/nets/model_train.py:30: LSTMCell.init (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.
WARNING:tensorflow:From /Users/MyName/video-subtitle-extractor/nets/model_train.py:33: bidirectional_dynamic_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use keras.layers.Bidirectional(keras.layers.RNN(cell)), which is equivalent to this API
[WARNING 2021-01-03 20:12:01,532 new_func:323] From /Users/MyName/video-subtitle-extractor/nets/model_train.py:33: bidirectional_dynamic_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use keras.layers.Bidirectional(keras.layers.RNN(cell)), which is equivalent to this API
WARNING:tensorflow:From /Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/ops/rnn.py:443: dynamic_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use keras.layers.RNN(cell), which is equivalent to this API
[WARNING 2021-01-03 20:12:01,532 new_func:323] From /Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/ops/rnn.py:443: dynamic_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use keras.layers.RNN(cell), which is equivalent to this API
2021-01-03 20:12:01.807858: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Restore from checkpoints_mlt/ctpn_50000.ckpt
WARNING:tensorflow:From /Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
[WARNING 2021-01-03 20:12:01,809 new_func:323] From /Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
2021-01-03 20:12:01.851417: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: checkpoints_mlt/ctpn_50000.ckpt.data-00000-of-00001; No such file or directory
Traceback (most recent call last):
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.NotFoundError: checkpoints_mlt/ctpn_50000.ckpt.data-00000-of-00001; No such file or directory
[[{{node save/RestoreV2}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1276, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: checkpoints_mlt/ctpn_50000.ckpt.data-00000-of-00001; No such file or directory
[[node save/RestoreV2 (defined at ./main/demo.py:324) ]]

Caused by op 'save/RestoreV2', defined at:
File "./main/demo.py", line 448, in
tf.app.run()
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "./main/demo.py", line 439, in main
text_detect()
File "./main/demo.py", line 324, in text_detect
saver = tf.train.Saver(variable_averages.variables_to_restore())
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 832, in init
self.build()
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 844, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 881, in _build
build_save=build_save, build_restore=build_restore)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal
restore_sequentially, reshape)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 332, in _AddRestoreOps
restore_sequentially)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 580, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1572, in restore_v2
name=name)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()

NotFoundError (see above for traceback): checkpoints_mlt/ctpn_50000.ckpt.data-00000-of-00001; No such file or directory
[[node save/RestoreV2 (defined at ./main/demo.py:324) ]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1286, in restore
names_to_keys = object_graph_key_mapping(save_path)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1591, in object_graph_key_mapping
checkpointable.OBJECT_GRAPH_PROTO_KEY)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 370, in get_tensor
status)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: Key _CHECKPOINTABLE_OBJECT_GRAPH not found in checkpoint

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./main/demo.py", line 448, in
tf.app.run()
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "./main/demo.py", line 439, in main
text_detect()
File "./main/demo.py", line 330, in text_detect
saver.restore(sess, model_path)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1292, in restore
err, "a Variable name or other graph key that is missing")
tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

checkpoints_mlt/ctpn_50000.ckpt.data-00000-of-00001; No such file or directory
[[node save/RestoreV2 (defined at ./main/demo.py:324) ]]

Caused by op 'save/RestoreV2', defined at:
File "./main/demo.py", line 448, in
tf.app.run()
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "./main/demo.py", line 439, in main
text_detect()
File "./main/demo.py", line 324, in text_detect
saver = tf.train.Saver(variable_averages.variables_to_restore())
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 832, in init
self.build()
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 844, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 881, in _build
build_save=build_save, build_restore=build_restore)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal
restore_sequentially, reshape)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 332, in _AddRestoreOps
restore_sequentially)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 580, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1572, in restore_v2
name=name)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/Users/MyName/opt/anaconda3/envs/videoEnv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()

NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

checkpoints_mlt/ctpn_50000.ckpt.data-00000-of-00001; No such file or directory
[[node save/RestoreV2 (defined at ./main/demo.py:324) ]]`

CPU版本运行卡住了

我的电脑是集成显卡,所以运行的CPU版本,在选好字幕区域后,点击运行,消息框中显示[处理中]开启提取关键帧,然后就没下文了...命令行窗口显示E1202 16:07:26.463443 16968 analysis_config.cc:91] Please compile with gpu to EnableGpu()...e[37m--- fused 0 pairs of fc gru patternse[0m
等了十分钟都没动静. 但进程一直在运行,CUP占用33%左右,内存占用1.8G左右...
大神帮忙分析下是什么问题呢?

批量处理图片

请问您的程序里面的text_recogniser()能否一次处理多张图片?

识别英语单词会位置错乱

识别出一句话,比如 That was a great idea, right? 他识别出就会变成 That right? a great idea, right? was 或者 Thatwasa great idea, right?

Error: Can not import avx core while this file exists: D:\subtitle\python-3.7.0\lib\site-packages\paddle\fluid\core_avx.pyd

打开exe无反应,通过 run.bat 可以看到有如下报错

D:\subtitle>python-3.7.0\python.exe src\gui.py
Error: Can not import avx core while this file exists: D:\subtitle\python-3.7.0\lib\site-packages\paddle\fluid\core_avx.pyd
Traceback (most recent call last):
  File "src\gui.py", line 19, in <module>
    import config
  File "src\config.py", line 12, in <module>
    from paddle import fluid
  File "D:\subtitle\python-3.7.0\lib\site-packages\paddle\__init__.py", line 29, in <module>
    from .fluid import monkey_patch_variable
  File "D:\subtitle\python-3.7.0\lib\site-packages\paddle\fluid\__init__.py", line 35, in <module>
    from . import framework
  File "D:\subtitle\python-3.7.0\lib\site-packages\paddle\fluid\framework.py", line 36, in <module>
    from . import core
  File "D:\subtitle\python-3.7.0\lib\site-packages\paddle\fluid\core.py", line 289, in <module>
    raise e
  File "D:\subtitle\python-3.7.0\lib\site-packages\paddle\fluid\core.py", line 254, in <module>
    from .core_avx import *
ImportError: DLL load failed: 找不到指定的模块。

环境如下:

版本:vse_windows_CPU.zip

OS 名称:          Microsoft Windows 10 家庭中文版
OS 版本:          10.0.19042 暂缺 Build 19042
系统型号:         20T6A002CD
系统类型:         x64-based PC
处理器:           安装了 1 个处理器。
                  [01]: AMD64 Family 23 Model 96 Stepping 1 AuthenticAMD ~2000 Mhz
BIOS 版本:        LENOVO R1AET37W (1.13 ), 2021/4/9
修补程序:         安装了 9 个修补程序。
                  [01]: KB5003254
                  [02]: KB4534170
                  [03]: KB4537759
                  [04]: KB4545706
                  [05]: KB4562830
                  [06]: KB4577266
                  [07]: KB4580325
                  [08]: KB5004945
                  [09]: KB5003742
Hyper-V 要求:     虚拟机监视器模式扩展: 是
                  固件中已启用虚拟化: 是
                  二级地址转换: 是
                  数据执行保护可用: 是

UnicodeEncodeError

When running the 启动程序.exe I get the following error after choosing the language and accuracy:
Traceback (most recent call last): File "D:\vse_windows_GPU\vse\resources\gui.py", line 14, in <module> set_language_mode(os.path.join(os.path.dirname(__file__), 'settings.ini')) File "D:\vse_windows_GPU\vse\resources\backend\tools\settings.py", line 25, in set_language_mode print('\u9009\u62e9\u4e86:', values['-LANGUAGE-']) File "D:\vse_windows_GPU\vse\Python\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined> 2021-11-20 11:02:57,694 ERROR: 在执行终端命令时检测到了失败,完整信息如下: PS D:\vse_windows_GPU\vse> cd "D:\vse_windows_GPU\vse\resources"; ./../Python/python.exe "D:\vse_windows_GPU\vse\resources\gui.py" ; echo "---QPT OUTPUT STATUS CODE---" $? Traceback (most recent call last): File "D:\vse_windows_GPU\vse\resources\gui.py", line 14, in <module> set_language_mode(os.path.join(os.path.dirname(__file__), 'settings.ini')) File "D:\vse_windows_GPU\vse\resources\backend\tools\settings.py", line 25, in set_language_mode print('\u9009\u62e9\u4e86:', values['-LANGUAGE-']) File "D:\vse_windows_GPU\vse\Python\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>
Is there anything I can do to make this run?

EasyOCR

Just wanted to let you know about https://github.com/JaidedAI/EasyOCR . It supports multiple languages and has some nice features like paragraph/lines detection. It can be used to detect and/or recognize text.

Thank you for your work and keep it up 👍

ES support

Hi hi, it is possible to have spanish support?

Thx.

设置好位置之后运行,报错了

echo "---QPT OUTPUT STATUS CODE---" $?
W1105 21:43:25.326297 9656 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.5, Runtime API Version: 11.2
W1105 21:43:25.534201 9656 device_context.cc:422] device: 0, cuDNN Version: 8.3.

GPU 該如何運行

你好, 我已經跟著步驟到要安裝依賴,
可是出現
(videoEnv) C:\Users\Bee>pip install -r requirements_gpu.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements_gpu.txt'

然後不知道如何繼續下去了

ubantu 18.04 《Failed to load the native TensorFlow runtime》

环境 :ubantu 18.04
安装 :pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
问题 :
(vw) python ./main/demo.py
Traceback (most recent call last):
File "/home/bigdata/anaconda3/envs/vw/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/bigdata/anaconda3/envs/vw/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/bigdata/anaconda3/envs/vw/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/home/bigdata/anaconda3/envs/vw/lib/python3.6/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/home/bigdata/anaconda3/envs/vw/lib/python3.6/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: /home/bigdata/anaconda3/envs/vw/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: invalid ELF header

vse_windows_GPU.zip.002无法下载

网页显示:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.
AKIAIWNJYAX4CSVEH53A
AWS4-HMAC-SHA256 20210920T225629Z 20210920/us-east-1/s3/aws4_request 52fd3b7b02b226ee22f5e02db98ade461a64d99186dc53618822803eabf0f432
f372da1662fa7b5773c2c3b58744d8a75a09e23be04c12e0d011000aec614c9e
41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 32 31 30 39 32 30 54 32 32 35 36 32 39 5a 0a 32 30 32 31 30 39 32 30 2f 75 73 2d 65 61 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 35 32 66 64 33 62 37 62 30 32 62 32 32 36 65 65 32 32 66 35 65 30 32 64 62 39 38 61 64 65 34 36 31 61 36 34 64 39 39 31 38 36 64 63 35 33 36 31 38 38 32 32 38 30 33 65 61 62 66 30 66 34 33 32
GET /301192992/c2873f5e-879c-4b6c-a029-f599cec5cfba X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210920%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210920T225629Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&actor_id=91099215&key_id=0&repo_id=301192992&response-content-disposition=attachment%3B%20filename%3Dvse_windows_GPU.zip.002&response-content-type=application%2Foctet-stream host:github-production-release-asset-2e65be.s3.amazonaws.com host UNSIGNED-PAYLOAD
47 45 54 0a 2f 33 30 31 31 39 32 39 39 32 2f 63 32 38 37 33 66 35 65 2d 38 37 39 63 2d 34 62 36 63 2d 61 30 32 39 2d 66 35 39 39 63 65 63 35 63 66 62 61 0a 58 2d 41 6d 7a 2d 41 6c 67 6f 72 69 74 68 6d 3d 41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 26 58 2d 41 6d 7a 2d 43 72 65 64 65 6e 74 69 61 6c 3d 41 4b 49 41 49 57 4e 4a 59 41 58 34 43 53 56 45 48 35 33 41 25 32 46 32 30 32 31 30 39 32 30 25 32 46 75 73 2d 65 61 73 74 2d 31 25 32 46 73 33 25 32 46 61 77 73 34 5f 72 65 71 75 65 73 74 26 58 2d 41 6d 7a 2d 44 61 74 65 3d 32 30 32 31 30 39 32 30 54 32 32 35 36 32 39 5a 26 58 2d 41 6d 7a 2d 45 78 70 69 72 65 73 3d 33 30 30 26 58 2d 41 6d 7a 2d 53 69 67 6e 65 64 48 65 61 64 65 72 73 3d 68 6f 73 74 26 61 63 74 6f 72 5f 69 64 3d 39 31 30 39 39 32 31 35 26 6b 65 79 5f 69 64 3d 30 26 72 65 70 6f 5f 69 64 3d 33 30 31 31 39 32 39 39 32 26 72 65 73 70 6f 6e 73 65 2d 63 6f 6e 74 65 6e 74 2d 64 69 73 70 6f 73 69 74 69 6f 6e 3d 61 74 74 61 63 68 6d 65 6e 74 25 33 42 25 32 30 66 69 6c 65 6e 61 6d 65 25 33 44 76 73 65 5f 77 69 6e 64 6f 77 73 5f 47 50 55 2e 7a 69 70 2e 30 30 32 26 72 65 73 70 6f 6e 73 65 2d 63 6f 6e 74 65 6e 74 2d 74 79 70 65 3d 61 70 70 6c 69 63 61 74 69 6f 6e 25 32 46 6f 63 74 65 74 2d 73 74 72 65 61 6d 0a 68 6f 73 74 3a 67 69 74 68 75 62 2d 70 72 6f 64 75 63 74 69 6f 6e 2d 72 65 6c 65 61 73 65 2d 61 73 73 65 74 2d 32 65 36 35 62 65 2e 73 33 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 0a 0a 68 6f 73 74 0a 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44
6DBJ56ZKZKANEENN
wlSWJroGD7rjIwyQZRBEKx+PhtWriVMRAJTZ3jyBWtKAsA1QG4bKn1mQekoeXaq4wIkKz3VX3/s=

GPU版本运行不正常

试了下最新release的GPU版,执行测试视频没有字幕输出,srt文件是空的

还有GPU启动很慢,这个能优化吗?

[SUGGESTIONS] G-Colab and better text detection

Hi there, I didn't tested it yet (since I don't own any discrete GPUs in my main hw configs) but your software seems cool.

It would be great for people like me to have a Google-Colab version of it.

Check out these in order to have an idea:

You can build your own (of course) but you can also ask to add it to MixLab:

Last but not least, it would be great to establish some kind of collaboration with these projects in order to achieve a better text detection:

Hope that inspires !

RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_8.dll) that Paddle depends on is not configured correctly.

Running the vse_windows_GPU.7z version I get the error:

RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_8.dll) that Paddle depends on is not configured correctly. (error code is 126)
Suggestions:

  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
  • Linux: set LD_LIBRARY_PATH by export LD_LIBRARY_PATH=...
  • Windows: set PATH by `set PATH=XXX; (at C:\home\workspace\Paddle_release\paddle\fluid\platform\dynload\dynamic_loader.cc:265)

As far as I understand the dependencies are being installed when running the program the first time. I can also find the cudnn64_8.dll in the "vse\opt\CUDA" folder.

Is there anything I can do about this?

优化识别次数80%,请教如何用容器运行您的代码

我在win10上直接跑是可以运行的,识别率很高,比Tesseract好很多,就是比较慢 ;
我的环境:nvidia-smi 11.4 nvcc 11.1 GTX1660s,win10,cpu=10400
我在识别之前做了一些优化,可以减少识别次数,提高速度。
这是我写的pyqt5界面,没写完,里面有下面前两步的代码:
https://gitee.com/m986883511/python_demo/blob/master/%E5%AD%97%E5%B9%95%E7%A1%AC%E6%8F%90%E5%8F%96/main.py

1、FFMPEG提取视频音频
2、spleeter separate分离音频人声
3、pydub中的detect_nonsilent方法,按照停顿切割音频并定位时间点
4、根据时间点使用您的代码识别字幕

这样做之后,一段字幕因语音停顿最多只会识别3次,可以将识别次数大约减少80%

我想做个容器直接部署就能运行您的程序,
我只是个自动化脚本工程师,深度学习并不深入,很多报错看不懂,我想做个容器封装您的程序,然后通过flask写个api,图片通过base64编码传输,这样就能调用后台了,容器传播也方便。

我在ufoym/deepo:cpu的docker容器中运行报错(win10)

image

您前面有回答过是cudnn和cuda版本不兼容导致的,有傻瓜式直接用的环境镜像吗?
这是我找到的镜像仓库:https://hub.docker.com/r/ufoym/deepo/tags?page=1&ordering=last_updated
我的电脑上的深度学习环境好不容易装上,真的不想换版本,能在windows上用容器运行您的cpu版本吗?ubuntu也行。

時間耗費太久。吃掉太多硬碟空間

用了最新的時間軸精準版,但速度太久且佔硬碟空間很大,一個90分鐘的影片,用了10幾20GB的硬碟空間,花了超過24小時的時間,仍然沒完成,最後硬碟空間不足終告失敗。

关于视频打开异常问题

作者你好!我用了你的项目,感觉准确率特别高,几乎没有什么错误,在这里非常感谢你的分享,但是我今天在使用的时候遇到了一个问题,困惑了我很久,就是我下载的视频,用你的可视化界面打开的时候,是打不开的,但是当我先打开一个其他可用视频,然后再打开我之前那个打不开的视频的时候,我就可以看到这个视频的画面了(这个问题视频我用某些播放器可以打开,某些播放器只能听到音频),请问一下这是什么原因,因为我找不到这个视频的其他资源了,所以想像你请教一下

生成关键帧的问题

在生成关键帧卡了很长时间,CPU100%,GPU没有动,生成结束后才开始使用GPU,可以优化吗

能否采用VideoSubFinder_5.50_x64加你的文字识别做一个速度快的程序

尊敬的作者:

你的这video-subtitle-extractor非常优秀,我用win10独立包(没有安装python),把一部50分钟的纪录片硬字幕转软字幕,只有几个错别字,已经是非常非常高的识别率了。一个软件三步,操作非常简单。但50分钟的纪录片要6小时才完成。

我另外试了VideoSubFinder_5.50_x64,配合“识别RGBImages 2.5.exe”,掉用百度文字识别接口,识别率差不多,但这方法速度非常快,10分钟就完成,缺点1是需要用2个软件,先运行VideoSubFinder_5.50_x64,再运行“识别RGBImages 2.5.exe”转出srt,缺点2(主要缺点),百度文字识别只有1年的免费期,到期就要缴费才能文字识别。而你的软件除了识别时间长点,其他都非常完美。

所以,非常感谢你提供这软件。

还是冒昧地请求,能不能采用VideoSubFinder_5.50_x64加你的文字识别引擎,出个硬字幕提取软件,这样速度快还是本地识别。

对于我的冒昧请求,如果你不认可,请不要介意,原谅我的冒失。你这软件已经非常优秀了。

关于环境

作者您好,近期下载了你的代码之后在windows,cpu上运行很好,但是速度很慢,因此尝试在ubuntu18.04上运行您的代码,cuda版本为11.2,cudnn版本为8.2.0,飞浆版本为2.0.1,运行之后报错
image
请问这是什么原因呢?
gpu如图所示:
image

this main.py not

This main.py not running

(videoEnv) C:\Users\dangh>cd test

(videoEnv) C:\Users\dangh\test>cd video-subtitle-extractor

(videoEnv) C:\Users\dangh\test\video-subtitle-extractor>python main.py
Running Verify Fluid Program ...
W0818 00:59:54.542205 20912 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 11.4, Runtime API Version: 10.2
W0818 00:59:54.548205 20912 device_context.cc:422] device: 0, cuDNN Version: 7.6.
Your Paddle Fluid works well on SINGLE GPU or CPU.
Your Paddle Fluid works well on MUTIPLE GPU or CPU.
Your Paddle Fluid is installed successfully! Let's start deep Learning with Paddle Fluid now
使用GPU进行加速
请输入视频完整路径:C:\Users\dangh\test\video-subtitle-extractor\main\EP02.mp4
帧数:49924.0,帧率:25.00011155895556
【处理中】开启提取视频关键帧...

GPU版本不能运行(CUDNN库找不到)

CUDN及CUDNN已经配置好环境且测试通过,如下图
02
但运行GPU版本时仍然报错说找不到CUDNN库
03
我发现好像是版本问题,我是GTX1650 TI的显卡,按照说明装的是cudn10.1和cudnn-7.6.5,对应的库应该是cudnn64_7.dll
但GPU版本报错说找不到cudnn64_8.dll, 这个肯定是没有的,GPU版本默认找cudnn-8+吗?
麻烦作者帮忙指点下怎么改呢?

慢速需要怎样的配置希望能够说明一下

我的配置是i7-7700HQ+GTX1060-6G笔记本显卡+16GB内存,选慢速要么是out of menory内存不够,要么是选关键帧选了几个小时都还没选玩。不知道到底需要什么配置跑。

cudaa和cuddn环境问题

首先给博主赞,其次遇到cudaa环境问题的,可以直接拉取paddle官方的docker镜像,我试了没问题。还有conda install前一定启用python3.8的环境,要不solving environment一直卡着

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.