python ubuntu dlib 8- 输出人脸坐标

python 未结 0 148
附近看到
附近看到 2021-05-28 09:30
悬赏:97

输入图片检测人脸,输出人脸坐标
 
 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()))
 
 ---------------------
 

相关标签:
回答
  • 消灭零回复
提交回复