[detectionview] fix bug, when no detection is in the current selection

This commit is contained in:
Jan Grewe 2025-03-01 16:50:27 +01:00
parent 6c54a86cde
commit 50d982c93b

View File

@ -142,9 +142,10 @@ class DetectionView(QWidget):
scores = self._data.selectedData("confidence")
image_rect = self._pixmapitem.boundingRect() if self._pixmapitem is not None else QRectF(0,0,0,0)
num_detections = len(frames)
for i, (id, f, t, l, s) in enumerate(zip(ids, frames, tracks, userlabeled, scores)):
c = Tracks.fromValue(t).toColor()
c.setAlpha(int(i * 255 / num_detections))
if keypoint >= 0:
x = coordinates[i, keypoint, 0]
y = coordinates[i, keypoint, 1]