版权属于:
人工智能炼丹师
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
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))
对于多CPU机器,加速DataFrame的apply方法
pip3 install torch-fidelity --no-dependencies
评论 (0)