Python 工具库使用

人工智能炼丹师
2021-04-25 / 0 评论 / 150 阅读 / 正在检测是否收录...

用 magic vs filetype 实现视频类型判断

magic 比filetype更好用,能判断更多的类型,能够直接从文件buffer中判断

import magic # pip install python-magic
import filetype # pip install filetype
src_file = "x.some"
print(filetype.guess(src_file))
print(magic.from_file(src_file, mime=True))
print(magic.from_buffer(open(src_file, 'rb'), mime=True))

jupyterlab IDE 函数定义跳转工具

parallel_apply[依赖pandarallel库]

对于多CPU机器,加速DataFrame的apply方法

安装python包,不更新其他依赖[--no-dependencies]

pip3 install torch-fidelity --no-dependencies

0

评论 (0)

取消
粤ICP备2021042327号