Skip to content

Commit

Permalink
fixes to tests and bench
Browse files Browse the repository at this point in the history
  • Loading branch information
bwsw committed Jul 27, 2023
1 parent 94beeb0 commit 83b3741
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/insight-platform/Similari"
readme = "README.md"
keywords = ["machine-learning", "similarity", "tracking", "SORT", "DeepSORT"]
categories = ["algorithms", "data-structures", "computer-vision", "science"]
version = "0.26.4"
version = "0.26.5"
edition = "2021"
license="Apache-2.0"
rust-version = "1.66"
Expand All @@ -18,7 +18,7 @@ name = "similari"

[features]
default = ["python"]
python = ["dep:pyo3", "dep:pyo3-build-config"]
python = ["dep:pyo3", "dep:pyo3-build-config","dep:pyo3-log"]

[dependencies]
itertools = "0.10"
Expand All @@ -31,8 +31,8 @@ crossbeam = "0.8"
rand = "0.8"
log = "0.4"
nalgebra = "0.32"
pathfinding = "4.2"
geo = "0.23"
pathfinding = "4.3"
geo = "0.25"
rayon = "1.7"
env_logger = "0.10"

Expand All @@ -41,6 +41,10 @@ version = "0.18"
features = ["extension-module"]
optional = true

[dependencies.pyo3-log]
version = "0.8"
optional = true

[build-dependencies]
pyo3-build-config = { version = "0.18", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions benches/nms_oriented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ fn bench_nms(objects: usize, b: &mut Bencher) {
for (indx, i) in iterators.iter_mut().enumerate() {
let b = i.next();
let bb: Universal2DBox = b.unwrap().into();
observations.push((bb.rotate(indx as f32 / 10.0).gen_vertices(), None));
observations.push((bb.rotate(indx as f32 / 10.0).gen_vertices().clone(), None));
}
nms(&observations, 0.8, None);
nms(observations.as_slice(), 0.8, None);
});
}
1 change: 1 addition & 0 deletions python/visual_sort/visual_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_opts():
tracker = VisualSort(shards=1, opts=get_opts())


assert False

# let's say frame_objs is a list of objs detected in a frame
for frame_objs in frames:
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ mod python {
#[pymodule]
#[pyo3(name = "similari")]
fn similari(_py: Python, m: &PyModule) -> PyResult<()> {
let _ = env_logger::try_init();
pyo3_log::init();

m.add_class::<PyBoundingBox>()?;
m.add_class::<PyUniversal2DBox>()?;
Expand Down
3 changes: 1 addition & 2 deletions src/trackers/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ mod tests {
request.add(0, Universal2DBox::new(0.0, 0.0, Some(0.5), 1.0, 5.0));
request.add(0, Universal2DBox::new(5.0, 5.0, Some(0.0), 1.5, 10.0));
request.add(1, Universal2DBox::new(0.0, 0.0, Some(1.0), 0.7, 5.1));
let batch = request.get_batch();
drop(batch);
let _batch = request.get_batch();
assert_eq!(result.batch_size(), 2);

assert!(request.send((0, vec![])));
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/tracker_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ where
/// change auto waste job periodicity
///
fn set_auto_waste(&mut self, periodicity: usize) {
let mut obj = self.get_auto_waste_obj_mut();
let obj = self.get_auto_waste_obj_mut();
obj.periodicity = periodicity;
obj.counter = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/bbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl Universal2DBox {
}

#[inline]
pub fn gen_vertices(&mut self) -> &mut Self {
pub fn gen_vertices(&mut self) -> &Self {
if self.angle.is_some() {
self._vertex_cache = Some(self.get_vertices());
}
Expand Down

0 comments on commit 83b3741

Please sign in to comment.