支持视频内容检索和课件自动生成的库
Project description
介绍
主要功能:
- 视频内容搜索
- 课件生成
其它能力:
- 生成可序列化的信息: 包括帧的标题,文本内容,播放位置
- 框选搜索结果
- 多配置
更新
- 初始化可以指定项目路径, 方便不同路径下运行, 输出产生的路径不变
支持的视频类型: 中文为主, 以PPT作为主体讲授的视频
鲁棒性:
- 动画切换
- 内容递增
- 中英文内容
- 人像的讲解
- 无重复
快速使用:
- 安装
步骤 1 安装Paddle框架 选择CPU或GPU其一安装即可
cpu版:
python3 -m pip install paddlepaddle==2.3.0 -i https://mirror.baidu.com/pypi/simple
GPU版 (通常需要安装CUDA等显卡适配软件)
不同环境的安装方式不同, 点击查看详情
步骤 2
pip install -i https://test.pypi.org/simple/ vsearcher=={version}
- 使用案例
from vsearcher import VSearcher
def test():
VSearcher.init(static_folder="app/static", output_dir='vs-output') # 设置输出文件夹
video_path = "./test.mp4" # 视频文件路径:请填入真实的文件可访问视频路径
video = VSearcher.executeVideo(video_file_path=video_path) # 处理视频 生成 注释文件
courseware = video.cw # 获取生成的课件的路径
result = VSearcher.search(video, '关键字') # 视频检索
VSearcher.releaseByOutputDir(video.output_dir) # 清空处理期间产生的文件
print(f'courseware: {courseware}')
print(f'search_result: {dict(result)}')
if __name__ == '__main__':
test()
- 问题
3.1 在linux环境下可能出现cv2相关的异常问题
解决方案 1: 安装如下包
pip install opencv-contrib-python
pip install opencv-python-headless
pip install openpyxl
若执行方案1之后还有报错,则执行如下命令即可
pip uninstall opencv-contrib-python
pip uninstall opencv-python-headless
pip uninstall openpyxl
pip install opencv-contrib-python
pip install opencv-python-headless
pip install openpyxl
3.2 出现如下异常信息
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
解决
pip3 install protobuf==3.20
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vsearcher-0.2.14.tar.gz
(37.7 kB
view hashes)
Built Distribution
vsearcher-0.2.14-py3-none-any.whl
(39.1 kB
view hashes)
Close
Hashes for vsearcher-0.2.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c477d471e0f74bc61822b1a69b741b6fc041fde33af159887c45e67940d83ab0 |
|
MD5 | 60958a5c8cdee8b785378a3da1c48d99 |
|
BLAKE2b-256 | bc33b9646a8ed92b1c8f06e3fed66b1dfc274388f2f21c3dc81f3bcf567b81d0 |