Giter Club home page Giter Club logo

Comments (2)

hpc203 avatar hpc203 commented on August 27, 2024
yolov8-face-landmarks-opencv-dnn on main via 🐍 v3.8.10
❯ py main.py
Traceback (most recent call last):
  File "main.py", line 171, in <module>
    boxes, scores, classids, kpts = YOLOv8_face_detector.detect(srcimg)
  File "main.py", line 75, in detect
    det_bboxes, det_conf, det_classid, landmarks = self.post_process(outputs, scale_h, scale_w, padh, padw)
  File "main.py", line 92, in post_process
    bbox = self.distance2bbox(anchors, bbox_pred, max_shape=(self.input_height, self.input_width)) * stride
  File "main.py", line 134, in distance2bbox
    x1 = points[:, 0] - distance[:, 0]
ValueError: operands could not be broadcast together with shapes (6400,) (1600,)

6400=80x80,1600=40x40,说明特征图的尺寸跟grid_anchor的尺寸不一致,原因是在python版本的opencv4.7.0里,forward函数输出特征图的尺寸,分别是40x40,20x20,80x80,我在main.py的注释里有说明这一点的。不过我已经更新了main.py,在初始化函数里生成的anchors是一个字典,字典的key是下采样尺度stride,这样在后处理函数里,根据特征图的尺寸跟输入分辨率计算出当前特征图的下采样尺度stride,根据当前的stride从anchors里提取到当前anchor,然后decode

from yolov8-face-landmarks-opencv-dnn.

AbdulSamadMalik avatar AbdulSamadMalik commented on August 27, 2024

非常感谢,它解决了错误。

from yolov8-face-landmarks-opencv-dnn.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.