Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect ground truth due to missing import of MultiLineString #68

Open
haerrel opened this issue May 6, 2023 · 1 comment
Open

Incorrect ground truth due to missing import of MultiLineString #68

haerrel opened this issue May 6, 2023 · 1 comment

Comments

@haerrel
Copy link

haerrel commented May 6, 2023

Problem

The CollectLane and CollectRNNLanes classes in lane_formating.py are responsible for computing the ground truth information for the CondLaneNet. As part of this process, the clamp_line function is used to determine the "valid ground truth points". However, in some cases, this function returns incorrect information.

Specifically, when the clamp_line function hits the line elif isinstance(I, MultiLineString):, it raises an exception because MultiLineString is not imported. As a result, the execution continues in the except branch, and the function returns None, which leads to incorrect ground truth.

Code Example

def clamp_line(line, box, min_length=0):
    left, top, right, bottom = box
    loss_box = Polygon([[left, top], [right, top], [right, bottom],
                        [left, bottom]])
    line_coords = np.array(line).reshape((-1, 2))
    if line_coords.shape[0] < 2:
        return None
    try:
        line_string = LineString(line_coords)
        I = line_string.intersection(loss_box)
        if I.is_empty:
            return None
        if I.length < min_length:
            return None
        if isinstance(I, LineString):

            pts = list(I.coords)
            return pts
        elif isinstance(I, MultiLineString): # <------ exception is raised here because MultiLineString is not imported
            pts = []
            Istrings = list(I)
            for Istring in Istrings:
                pts += list(Istring.coords)
            return pts
    except:
        return None

Impact

This issue can have significant impact on the performance of the model. On my dataset (which is different from the datasets used in the paper), this has led to significantly different results for F1, precision, and recall.

Around 7-8% of all lanes in my dataset where affected by this problem.

@NigussieAbate
Copy link

NigussieAbate commented Mar 21, 2024

I have faced ground truth problem and I think that is the reason lowered the evaluation score. Would you look at the problem link?
#72 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants