python ubuntu dlib 8- 输出人脸坐标

123 阅读1分钟

输入图片检测人脸,输出人脸坐标

import sys
import dlib
if len(sys.argv) < 1:
print("need specify the image file")
exit()

image_file = sys.argv[1]
img = dlib.load_rgb_image(image_file)

# Locations of candidate objects will be saved into rects
rects = []
dlib.find_candidate_object_locations(img, rects, min_size=500)

print("number of rectangles found {}".format(len(rects)))
for k, d in enumerate(rects):
print("Detection {}: Left: {} Top: {} Right: {} Bottom: {}".format(
k, d.left(), d.top(), d.right(), d.bottom()))

---------------------
作者:_iorilan
来源:CSDN
原文:blog.csdn.net/lan_liang/a…
版权声明:本文为博主原创文章,转载请附上博文链接!

更多python学习资料可关注:gzitcast