python - Python:如何在 Python 中反序列化经过训练的 dlib 模型数据(.dat)?
问题描述
我正在研究 python 中的 dlib 模型,现在将 C++ dnn_mmod_dog_hipsterizer 代码转换为 python 代码,以便使用其他 python 模块。
在 C++ 代码中,给定的 hipsterizer 数据被反序列化为 net(network)、sp(shape predictor)、glasses 和 mustache。但我找不到任何自定义反序列化的函数。只有 get_frontal_face_detector()、shape_detector() 等。
net_type net;
shape_predictor sp;
matrix<rgb_alpha_pixel> glasses, mustache;
deserialize(argv[1]) >> net >> sp >> glasses >> mustaches;
你能建议如何在 Python 中使用这些数据吗?
解决方案
推荐阅读
- python - 连接熊猫中列的值
- c++ - 如何将 DirectX 动画捕获为视频
- vba - WORD VBA 搜索并切换到高级
- python - 使用 partial() 进行多处理会引发 ForkingPickler 错误
- elasticsearch - 发布显式映射中不存在的字段类型时
- r - 如何在ggplot2中添加hline的图例
- java - 如何使用异步和使用多线程在Java中获取列表列表的交集
- firebase - Flutter:显示项目的总和
- apache-tika - Office 文件的 Mime 类型检测导致 application/x-tika-ooxml
- python - 有人能解释一下 gunicorn 如何处理 SIGTERM 或 SIGINT 信号吗