Giter Club home page Giter Club logo

Comments (2)

dibyendu22 avatar dibyendu22 commented on June 10, 2024

Press n to see the next sample >>> Press Esc to quit...
Traceback (most recent call last):

Overload resolution failed:

  • Can't parse 'pt1'. Sequence item with index 0 has a wrong type
  • Can't parse 'pt1'. Sequence item with index 0 has a wrong type

from complex-yolov4-pytorch.

nikitamalviya avatar nikitamalviya commented on June 10, 2024

There an issue with the order or structure of the coordinates passed to cv2.line(), also the corners_int are in float values.

Replace the function drawRotatedBox with the below function in the module data_process/kitti_bev_utils.py

def drawRotatedBox(img, x, y, w, l, yaw, color):
    bev_corners = get_corners(x, y, w, l, yaw)
    corners_int = np.round(bev_corners).astype(int)  # Convert coordinates to integers
    cv2.polylines(img, [corners_int], True, color, 2)
    
    # Extract coordinates of the endpoints of the diagonal line
    pt1 = (corners_int[0, 0], corners_int[0, 1])  # Top-left corner
    pt2 = (corners_int[2, 0], corners_int[2, 1])  # Bottom-right corner
    
    # Draw the diagonal line
    cv2.line(img, pt1, pt2, (255, 255, 0), 2)

The modified function :
The function extracts the coordinates of the top-left and bottom-right corners from corners_int and creates tuples (x, y) for each point. These tuples are then passed as arguments pt1 and pt2 to cv2.line() to draw the diagonal line across the rotated box.
By ensuring that the coordinates are correctly structured as tuples of integers, this modification should resolve the error you're encountering when drawing the diagonal line.

from complex-yolov4-pytorch.

Related Issues (20)

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.