Py之dlib:Python库之dlib库的简介、安装、使用方法详细攻略

Py之dlib:Python库之dlib库的简介、安装、使用方法详细攻略

2023年8月2日发(作者:)

Py之dlib:Python库之dlib库的简介、安装、使⽤⽅法详细攻略Py之dlib:Python库之dlib库的简介、安装、使⽤⽅法详细攻略⽬录dlib库的简介 ⼀个机器学习的开源库,包含了机器学习的很多算法,使⽤起来很⽅便,直接包含头⽂件即可,并且不依赖于其他库(⾃带图像编解码库源码)。Dlib可以帮助您创建很多复杂的机器学习⽅⾯的软件来帮助解决实际问题。⽬前Dlib已经被⼴泛的⽤在⾏业和学术领域,包括机器⼈,嵌⼊式设备,移动电话和⼤型⾼性能计算环境。Dlib是⼀个使⽤现代C++技术编写的跨平台的通⽤库,遵守Boost Software licence. 主要特点如下:

完善的⽂档:每个类每个函数都有详细的⽂档,并且提供了⼤量的⽰例代码,如果你发现⽂档描述不清晰或者没有⽂档,告诉作者,作者会⽴刻添加。

可移植代码:代码符合ISO C++标准,不需要第三⽅库⽀持,⽀持win32、Linux、Mac OS X、Solaris、HPUX、BSDs 和 POSIX系统

线程⽀持:提供简单的可移植的线程API

⽹络⽀持:提供简单的可移植的Socket API和⼀个简单的Http服务器

图形⽤户界⾯:提供线程安全的GUI API

数值算法:矩阵、⼤整数、随机数运算等

机器学习算法:图形模型算法:

图像处理:⽀持读写Windows BMP⽂件,不同类型⾊彩转换

数据压缩和完整性算法:CRC32、Md5、不同形式的PPM算法

测试:线程安全的⽇志类和模块化的单元测试框架以及各种测试assert⽀持⼀般⼯具:XML解析、内存管理、类型安全的big/little endian转换、序列化⽀持和容器类 dlib库的安装dlib压缩包集合:本博客提供三种⽅法进⾏安装T1⽅法:pip install dlib此⽅法是需要在你安装cmake、Boost环境的计算机使⽤T2⽅法:conda install -c menpo dlib=18.18此⽅法适合那些已经安装好conda库的环境的计算机使⽤,conda库的安装本博客有详细攻略,请⾃⾏翻看。T3⽅法:pip install dlib-19.8.1-cp36-cp36m-win_哈哈,⼤功告成!如有资料或问题需求,请留⾔!dlib库的使⽤函数0、利⽤_frontal_face_detector函数实现⼈脸检测可视化1、hog提取特征的函数_frontal_face_detector() #⼈脸特征提取器,该函数是在C++⾥⾯定义的help(_frontal_face_detector())Help on fhog_object_detector in module object:class fhog_object_detector(ce) | This object represents a sliding window histogram-of-oriented-gradients based object detector. | | Method resolution order: | fhog_object_detector | ce | | | Methods defined here: | | __call__(...) | __call__( (fhog_object_detector)arg1, (object)image [, (int)upsample_num_times=0]) -> rectangles : | requires | - image is a numpy ndarray containing either an 8bit grayscale or RGB | image. | - upsample_num_times >= 0 | ensures | - This function runs the object detector on the input image and returns | a list of detections. | - Upsamples the image upsample_num_times before running the basic | detector. | | __getstate__(...) | __getstate__( (fhog_object_detector)arg1) -> tuple | | __init__(...) | __init__( (object)arg1) -> None | | __init__( (object)arg1, (str)arg2) -> object : | __init__( (object)arg1, (str)arg2) -> object : | Loads an object detector from a file that contains the output of the | train_simple_object_detector() routine or a serialized C++ object of type | object_detector>>. | | __reduce__ = (...) | | __setstate__(...) | __setstate__( (fhog_object_detector)arg1, (tuple)arg2) -> None | | run(...) | run( (fhog_object_detector)arg1, (object)image [, (int)upsample_num_times=0 [, (float)adjust_threshold=0.0]]) -> tuple : | requires | - image is a numpy ndarray containing either an 8bit grayscale or RGB | image. | - upsample_num_times >= 0 | ensures | - This function runs the object detector on the input image and returns | a tuple of (list of detections, list of scores, list of weight_indices). | - Upsamples the image upsample_num_times before running the basic | detector. | | save(...) | save( (fhog_object_detector)arg1, (str)detector_output_filename) -> None : | Save a simple_object_detector to the provided path. | | ---------------------------------------------------------------------- | Static methods defined here: | | run_multiple(...) | run_multiple( (list)detectors, (object)image [, (int)upsample_num_times=0 [, (float)adjust_threshold=0.0]]) -> tuple : | requires | - detectors is a list of detectors. | - image is a numpy ndarray containing either an 8bit grayscale or RGB | image. | - upsample_num_times >= 0 | ensures | - This function runs the list of object detectors at once on the input image and returns | a tuple of (list of detections, list of scores, list of weight_indices). | - Upsamples the image upsample_num_times before running the basic | detector. | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __instance_size__ = 160 | | __safe_for_unpickling__ = True | | ---------------------------------------------------------------------- | Methods inherited from ce: | | __new__(*args, **kwargs) from | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors inherited from ce: | | __dict__ | | __weakref__2、CNN提取特征的函数cnn_face_detector = _face_detection_model_v1(cnn_face_detection_model)help(_face_detection_model_v1)Help on class cnn_face_detection_model_v1 in module :class cnn_face_detection_model_v1(ce) | | Method resolution order: | cnn_face_detection_model_v1 | ce | | | Methods defined here: | | __call__(...) | __call__( (cnn_face_detection_model_v1)arg1, (object)img [, (int)upsample_num_times=0]) -> mmod_rectangles : | Find faces in an image using a deep learning model. | - Upsamples the image upsample_num_times before running the face | detector. | | __call__( (cnn_face_detection_model_v1)arg1, (list)imgs [, (int)upsample_num_times=0 [, (int)batch_size=128]]) -> mmod_rectangless : | takes a list of images as input returning a 2d list of mmod rectangles | | __init__(...) | __init__( (object)arg1, (str)arg2) -> None | | __reduce__ = (...) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __instance_size__ = 984 | | ---------------------------------------------------------------------- | Methods inherited from ce: | | __new__(*args, **kwargs) from | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors inherited from ce: | | __dict__ | | __weakref__ | This object detects human faces in an image. The constructor loads the face detection model from a file. You can download a pre-trained model from dli

发布者:admin,转转请注明出处:http://www.yc00.com/web/1690910227a461090.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信