Difficulty relating traffic light annotations
hondaathma opened this issue · comments
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,
- Mostly all states are []
- tl_frames are larger than tl_bbox and have some '3' in them. such frameids do not exist
- 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.
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.
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
Thanks for pointing the problem. there was an issue in the data interface and resolved it.