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

Difficulty relating traffic light annotations #2

Closed
hondaathma opened this issue Jan 27, 2020 · 3 comments
Closed

Difficulty relating traffic light annotations #2

hondaathma opened this issue Jan 27, 2020 · 3 comments

Comments

@hondaathma
Copy link

Hi,
I am trying to relate the traffic light annotations to the pedestrian tracklets. I am reading the data_cache/pie_database.pkl to visualize the annotations.

Here when I read

AnnData = I[set][vid]
traffic_annots = AnnData['traffic_annotations']
TLS = traffic_annots['1_1_1tl']
tl_frames = TLS['frames']
tl_bbox = TLS['bbox']
tl_state=TLS['state']

Now issues arise,

  1. Mostly all states are []
  2. tl_frames are larger than tl_bbox and have some '3' in them. such frameids do not exist
  3. tl_bbox dont exactly fall on the correct spot.

For example

        for idx, b in enumerate(tl_bbox):
            i = cv2.imread(imgloc + set + '/' + vid + '/' + str(tl_frames[idx]).zfill(5) + '.png')
            if i is not None:
                cv2.rectangle(i, (int(b[0]), int(b[1])), (int(b[2]), int(b[3])), (0, 255, 0), 2, cv2.LINE_AA)
                cv2.imshow('TL', cv2.resize(i, None, fx=0.5, fy=0.5))

The traffic light starts drifting with the car motion. The first TL is correct but then it keeps drifting away.
https://drive.google.com/open?id=1CanNpO29LtOYB2uapb2DJE6SlnPGrE8t

Is there something wrong with pkl creation ? Or am I reading the boxes wrong.

P.S : a visualization script might go a along way.

@hondaathma
Copy link
Author

I have an update to the previous question.

tl_frames=list(np.unique([t for t in tl_frames if t != 3]))

Now all I did was remove the 3s in frame names and remove duplicates. now the bbox length matches the frame length and the drift issues is resolved.

The only problem now remains is that state of traffic light is unkown.

@hondaathma
Copy link
Author

 if obj_label == 'traffic_light':
                        annotations[traffic_annt][obj_id]['state'].append(b.find('./attribute[@name=\"state\"]').text)

Found the fix at pie_data.py Lines 389-390

@aras62
Copy link
Owner

aras62 commented Mar 23, 2020

Thanks for pointing the problem. there was an issue in the data interface and resolved it.

@aras62 aras62 closed this as completed Jul 8, 2020
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