Skip to content

Commit

Permalink
Add arguments to PyWastedVisualSortTrack for python usage (#108)
Browse files Browse the repository at this point in the history
* Added Attributes to PyWastedVisualSortTrack for python implementation purposes

* Added observed features to PyWastedVisualSorttrack
  • Loading branch information
calvinbeeguard authored Feb 19, 2024
1 parent f7a73de commit 45101a3
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/trackers/visual_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PyUniversal2DBox> {
unsafe { std::mem::transmute(self.0.predicted_boxes.clone()) }
}

#[getter]
fn observed_boxes(&self) -> Vec<PyUniversal2DBox> {
unsafe { std::mem::transmute(self.0.observed_boxes.clone()) }
}

#[getter]
fn observed_features(&self) -> Vec<f32> {
unsafe { std::mem::transmute(self.0.observed_features.clone()) }
}
}

#[pyclass]
Expand Down

0 comments on commit 45101a3

Please sign in to comment.