You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When no object is detected at a given timestamp, there is no track for this timestamp even if there is a groundtruth. This should be supported by the Accuracy metrics, but it produces an error.
Current Behavior
When there is a gap in the detections, the function accuracy_at_time tries to get a non existing timestamp key from the tracks and returns an error.
{
"name": "IndexError",
"message": "timestamp not found in states",
"stack": "---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[13], line 1
----> 1 metrics = metric_manager.generate_metrics()
File ~/Library/Caches/pypoetry/virtualenvs/cosita-K1LlpWRX-py3.12/lib/python3.12/site-packages/stonesoup/metricgenerator/manager.py:91, in MultiManager.generate_metrics(self)
89 print(\"appel self.associate_tracks(generator)\")
90 self.associate_tracks(generator)
---> 91 metric_list = generator.compute_metric(self)
92 if not isinstance(metric_list, list): # If not already a list, force it to be one
93 metric_list = [metric_list]
File ~/Library/Caches/pypoetry/virtualenvs/cosita-K1LlpWRX-py3.12/lib/python3.12/site-packages/stonesoup/metricgenerator/tracktotruthmetrics.py:114, in SIAPMetrics.compute_metric(self, manager, **kwargs)
112 Nt = self.num_tracks_at_time(tracks, timestamp)
113 N_sum += Nt
--> 114 PAt = self.accuracy_at_time(manager, timestamp, self.position_measure)
115 PA_sum += PAt
116 VAt = self.accuracy_at_time(manager, timestamp, self.velocity_measure)
File ~/Library/Caches/pypoetry/virtualenvs/cosita-K1LlpWRX-py3.12/lib/python3.12/site-packages/stonesoup/metricgenerator/tracktotruthmetrics.py:327, in SIAPMetrics.accuracy_at_time(self, manager, timestamp, measure)
325 for association in associations:
326 truth, track = self.truth_track_from_association(association)
--> 327 error_sum += measure(track[timestamp], truth[timestamp])
328 return error_sum
File ~/Library/Caches/pypoetry/virtualenvs/cosita-K1LlpWRX-py3.12/lib/python3.12/site-packages/stonesoup/types/state.py:307, in StateMutableSequence.__getitem__(self, index)
305 return state
306 else:
--> 307 raise IndexError('timestamp not found in states')
308 elif isinstance(index, slice):
309 return StateMutableSequence(self.states.__getitem__(index))
IndexError: timestamp not found in states"
}
Expected Behavior
The accuracy metrics should ignore timestamps where the track is not defined. Additionnaly the function num_tracks_at_time should take into account timestamps when the track is associated to a truth in terms of time interval, but not defined at the given timestamp.
🐛 Bug Report
Description
When no object is detected at a given timestamp, there is no track for this timestamp even if there is a groundtruth. This should be supported by the Accuracy metrics, but it produces an error.
Current Behavior
When there is a gap in the detections, the function accuracy_at_time tries to get a non existing timestamp key from the tracks and returns an error.
Expected Behavior
The accuracy metrics should ignore timestamps where the track is not defined. Additionnaly the function num_tracks_at_time should take into account timestamps when the track is associated to a truth in terms of time interval, but not defined at the given timestamp.
Steps to Reproduce
Provide the steps to reproduce the problem:
Additional Information
Environment
The text was updated successfully, but these errors were encountered: