From 45101a3c191c22794187c4de1e857304345e9458 Mon Sep 17 00:00:00 2001 From: calvinbeeguard <160246914+calvinbeeguard@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:45:44 +0100 Subject: [PATCH] Add arguments to PyWastedVisualSortTrack for python usage (#108) * Added Attributes to PyWastedVisualSortTrack for python implementation purposes * Added observed features to PyWastedVisualSorttrack --- src/trackers/visual_sort.rs | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/trackers/visual_sort.rs b/src/trackers/visual_sort.rs index e6cab62..b878eaf 100644 --- a/src/trackers/visual_sort.rs +++ b/src/trackers/visual_sort.rs @@ -166,6 +166,51 @@ pub mod python { fn __str__(&self) -> String { format!("{:#?}", self.0) } + + #[getter] + fn id(&self) -> u64 { + self.0.id + } + + #[getter] + fn epoch(&self) -> usize { + self.0.epoch + } + + #[getter] + fn predicted_bbox(&self) -> PyUniversal2DBox { + PyUniversal2DBox(self.0.predicted_bbox.clone()) + } + + #[getter] + fn observed_bbox(&self) -> PyUniversal2DBox { + PyUniversal2DBox(self.0.observed_bbox.clone()) + } + + #[getter] + fn scene_id(&self) -> u64 { + self.0.scene_id + } + + #[getter] + fn length(&self) -> usize { + self.0.length + } + + #[getter] + fn predicted_boxes(&self) -> Vec { + unsafe { std::mem::transmute(self.0.predicted_boxes.clone()) } + } + + #[getter] + fn observed_boxes(&self) -> Vec { + unsafe { std::mem::transmute(self.0.observed_boxes.clone()) } + } + + #[getter] + fn observed_features(&self) -> Vec { + unsafe { std::mem::transmute(self.0.observed_features.clone()) } + } } #[pyclass]