如何修改dlib python

时间:2017-04-14 03:34:44

标签: c++ face-detection python-c-api dlib

我想在dlib python中修改shape_predictor返回的形状,代码如下:

      sp = dlib.shape_predictor(predictor_path)
      dets = detector(img, 1)
      for k, d in enumerate(dets):
          shape = sp(img, d)
      for par in range(68):
          (shape.part(par)).x = int(10)
          (shape.part(par)).y = int(10)

但它返回了一个错误:

“属性:无法设置属性。”

shape_predictor函数的返回值是full_object_detection,c ++中的代码如下:

full_object_detection(
        const rectangle& rect_,
        const std::vector<point>& parts_
    ) : rect(rect_), parts(parts_) {}

我在c ++中修改代码,在函数shape_predictor函数中删除const。是否有另一种方法来修改返回的形状值?

0 个答案:

没有答案
相关问题