Showing preview only (740K chars total). Download the full file or copy to clipboard to get everything.
Repository: insight-platform/Similari
Branch: main
Commit: b137c1db8f4a
Files: 123
Total size: 700.8 KB
Directory structure:
gitextract_brqpx5l4/
├── .cargo/
│ └── config.toml
├── .dockerignore
├── .github/
│ └── workflows/
│ └── build.yml
├── .gitignore
├── Cargo.toml
├── LICENSE
├── README.md
├── assets/
│ ├── benchmarks/
│ │ └── benchmarks.md
│ └── documentation/
│ └── python/
│ └── api.md
├── benches/
│ ├── batch_sort_iou_tracker.rs
│ ├── batch_sort_maha_tracker.rs
│ ├── bbox_own_areas.rs
│ ├── feature_tracker.rs
│ ├── kalman_2d_point.rs
│ ├── kalman_bbox.rs
│ ├── nms.rs
│ ├── nms_oriented.rs
│ ├── simple_search.rs
│ ├── simple_sort_iou_tracker.rs
│ ├── simple_sort_iou_tracker_oriented.rs
│ ├── simple_sort_maha_tracker.rs
│ ├── simple_sort_maha_tracker_oriented.rs
│ ├── simple_visual_sort_tracker.rs
│ └── track_search.rs
├── build.rs
├── docker/
│ ├── Dockerfile.manylinux_2_28_ARM64
│ ├── Dockerfile.manylinux_2_28_X64
│ └── build-manylinux.sh
├── examples/
│ ├── batch_sort_iou_tracker.rs
│ ├── incremental_track_build.rs
│ ├── middleware_sort_tracker.rs
│ ├── simple.rs
│ ├── simple_sort_iou_tracker.rs
│ ├── simple_sort_iou_tracker_oriented.rs
│ ├── simple_sort_maha_tracker.rs
│ ├── simple_sort_maha_tracker_oriented.rs
│ └── track_merging.rs
├── pyproject.toml
├── python/
│ ├── bb.py
│ ├── bugfixes/
│ │ ├── bug_vs_1/
│ │ │ ├── bug_visual_sort.py
│ │ │ └── in/
│ │ │ ├── fixed-1/
│ │ │ │ ├── bug_vs_1.json
│ │ │ │ └── bug_vs_2.json
│ │ │ ├── in-1.json
│ │ │ └── in-2.json
│ │ └── github-84.py
│ ├── clipping_intersection.py
│ ├── kalman_2d_point.py
│ ├── kalman_2d_vec.py
│ ├── kalman_bbox.py
│ ├── motchallenge/
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── config.py
│ │ ├── config.yml
│ │ ├── confs/
│ │ │ ├── original-sort-config.yml
│ │ │ └── similari-maha-sort-config.yml
│ │ ├── evaluator.py
│ │ ├── requirements.txt
│ │ ├── trackers.py
│ │ └── utils.py
│ ├── nms.py
│ ├── sort/
│ │ ├── batch_sort_iou.py
│ │ ├── batch_sort_iou_bench.py
│ │ ├── sort_idle.py
│ │ ├── sort_iou.py
│ │ ├── sort_iou_bench.py
│ │ ├── sort_iou_rotated.py
│ │ ├── sort_iou_scene_id.py
│ │ └── sort_maha.py
│ ├── visual_sort/
│ │ ├── batch_visual_sort.py
│ │ └── visual_sort.py
│ └── visual_sort.py
└── src/
├── distance.rs
├── examples/
│ └── iou.rs
├── examples.rs
├── lib.rs
├── prelude.rs
├── track/
│ ├── builder.rs
│ ├── notify.rs
│ ├── store/
│ │ ├── builder.rs
│ │ ├── store_tests.rs
│ │ └── track_distance.rs
│ ├── store.rs
│ ├── utils.rs
│ ├── voting/
│ │ ├── best.rs
│ │ └── topn.rs
│ └── voting.rs
├── track.rs
├── trackers/
│ ├── batch.rs
│ ├── epoch_db.rs
│ ├── kalman_prediction.rs
│ ├── sort/
│ │ ├── batch_api.rs
│ │ ├── metric.rs
│ │ ├── simple_api.rs
│ │ └── voting.rs
│ ├── sort.rs
│ ├── spatio_temporal_constraints.rs
│ ├── tracker_api.rs
│ ├── visual_sort/
│ │ ├── batch_api.rs
│ │ ├── metric/
│ │ │ └── builder.rs
│ │ ├── metric.rs
│ │ ├── observation_attributes.rs
│ │ ├── options.rs
│ │ ├── simple_api.rs
│ │ ├── track_attributes.rs
│ │ ├── visual_sort_py.rs
│ │ └── voting.rs
│ └── visual_sort.rs
├── trackers.rs
├── utils/
│ ├── bbox.rs
│ ├── clipping/
│ │ ├── bbox_own_areas.rs
│ │ └── clipping_py.rs
│ ├── clipping.rs
│ ├── kalman/
│ │ ├── kalman_2d_box.rs
│ │ ├── kalman_2d_point.rs
│ │ └── kalman_2d_point_vec.rs
│ ├── kalman.rs
│ ├── nms/
│ │ └── nms_py.rs
│ ├── nms.rs
│ ├── point.rs
│ └── primitive.rs
└── utils.rs
================================================
FILE CONTENTS
================================================
================================================
FILE: .cargo/config.toml
================================================
[target.x86_64-unknown-linux-gnu]
rustflags = "-C target-cpu=x86-64-v3"
[target.x86_64-pc-windows-gnu]
rustflags = "-C target-cpu=x86-64-v3"
# Apple Silicone fix
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
================================================
FILE: .dockerignore
================================================
dist
.idea
target
**/Dockerfile
*/Dockerfile
data
__pycache__
================================================
FILE: .github/workflows/build.yml
================================================
name: Similari
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
permissions:
contents: read
packages: read
pages: write
id-token: write
jobs:
linux:
strategy:
matrix:
include:
- docker_file: docker/Dockerfile.manylinux_2_28_ARM64
name: manylinux-arm
arch: linux/arm64
runner: ARM64
- docker_file: docker/Dockerfile.manylinux_2_28_X64
name: manylinux-x86
arch: linux/amd64
runner: X64
runs-on:
- ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
uses: docker/build-push-action@v5
with:
file: ${{ matrix.docker_file }}
platforms: ${{ matrix.arch }}
tags: similari
push: false
load: true
context: .
- name: Copy wheels
run: docker run --rm -v $(pwd)/distfiles:/tmp similari cp -R /opt/dist /tmp
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}-${{ matrix.runner }}
path: distfiles/dist
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pip
run: |
python -m ensurepip
python -m pip install --upgrade pip
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing distfiles/dist/*
windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.target }}
- name: Install pip
run: |
python -m ensurepip
python -m pip install --upgrade pip
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: .
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}-${{ matrix.python }}
path: dist
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing dist/*
macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install pip
run: |
python -m ensurepip
python -m pip install --upgrade pip
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}-${{ matrix.target }}-${{ matrix.python }}
path: dist
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing dist/*
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pip
run: |
python -m ensurepip
python -m pip install --upgrade pip
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}
path: dist
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing dist/*
================================================
FILE: .gitignore
================================================
/target
/Cargo.lock
.idea
dist
data
__pycache__
================================================
FILE: Cargo.toml
================================================
[package]
name = "similari-trackers-rs"
authors = ["Ivan Kudriavtsev <ivan.a.kudryavtsev@gmail.com>"]
description = "Machine learning framework for building object trackers and similarity search engines"
homepage = "https://github.com/insight-platform/Similari"
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.12"
edition = "2021"
license = "Apache-2.0"
rust-version = "1.66"
[lib]
crate-type = ["cdylib", "lib"]
name = "similari"
[features]
default = ["python"]
python = ["dep:pyo3", "dep:pyo3-build-config", "dep:pyo3-log"]
[dependencies]
itertools = "0.12"
anyhow = "1.0"
thiserror = "1.0"
once_cell = "1.19"
num_cpus = "1.16"
ultraviolet = "0.9"
crossbeam = "0.8"
rand = "0.8"
log = "0.4"
nalgebra = "0.32"
pathfinding = "4.8"
geo = "0.27"
rayon = "1.8"
env_logger = "0.10"
[dependencies.pyo3]
version = "0.23.4"
features = ["extension-module"]
optional = true
[dependencies.pyo3-log]
version = "0.12.1"
optional = true
[build-dependencies]
pyo3-build-config = { version = "0.23.4", optional = true }
[dev-dependencies]
wide = "0.7"
[profile.dev]
opt-level = 3
[profile.release]
opt-level = 3
codegen-units = 1
[profile.bench]
opt-level = 3
codegen-units = 1
[package.metadata.maturin]
python-source = "python"
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [2022] [Ivan A. Kudriavtsev <ivan.a.kudryavtsev@gmail.com>]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# Similari
Newer versions (renamed):
[](https://crates.io/crates/similari-trackers-rs)
[](https://crates.io/crates/similari-trackers-rs)
[](https://img.shields.io/github/license/insight-platform/Similari.svg)
[](https://pypi.org/project/similari-trackers-rs/)
Older versions:
[](https://crates.io/crates/similari)
[](https://crates.io/crates/similari)
[](https://img.shields.io/github/license/insight-platform/Similari.svg)
:star: Star us on GitHub — it motivates us a lot!
Similari is a Rust framework with Python bindings that helps build sophisticated tracking systems. With Similari one
can develop highly efficient parallelized [SORT](https://github.com/abewley/sort), [DeepSORT](https://github.com/nwojke/deep_sort), and
other sophisticated single observer (e.g. Cam) or multi-observer tracking engines.
## Introduction
The primary purpose of Similari is to provide means to build sophisticated in-memory multiple object tracking engines.
The framework helps build various kinds of tracking and similarity search engines - the simplest one that holds
vector features and allows comparing new vectors against the ones kept in the database. More sophisticated engines
operate over tracks - a series of observations for the same feature collected during the lifecycle. Such systems are
often used in video processing or other systems where the observer receives fuzzy or changing observation results.
## Out-of-The-Box Stuff
Similari is a framework to build custom trackers, however it provides certain algorithms as an end-user functionality:
**Bounding Box Kalman filter**, that predicts rectangular bounding boxes axis-aligned to scene, supports the oriented (rotated)
bounding boxes as well.
**2D Point Kalman filter**, that predicts 2D point motion.
**2D Point Vector Kalman filter**, that predicts the vector of independent 2D points motion (used in the Keypoint Tracker).
**Bounding box clipping**, that allows calculating the area of intersection for axis-aligned and oriented (rotated)
bounding boxes.
**Non-Maximum Suppression (NMS)** - filters rectangular bounding boxes co-axial to scene, and supports the oriented
bounding boxes.
**SORT tracking** algorithm (axis-aligned and oriented boxes are supported) - IoU and Mahalanobis distances are
supported.
**Batch SORT tracking** algorithm (axis-aligned and oriented boxes are supported) - IoU and Mahalanobis distances are
supported. Batch tracker allows passing multiple scenes to tracker in a single batch and get them back. If the platform
supports batching (like Nvidia DeepStream or Intel DL Streamer) the batch tracker is more beneficial to use.
**VisualSORT tracking** - a DeepSORT-like algorithm (axis-aligned and oriented boxes are supported) - IoU and
Mahalanobis distances are supported for positional tracking, euclidean, cosine distances are used for visual tracking on
feature vectors.
**Batch VisualSORT** - batched VisualSORT flavor;
## Applicability Notes
Although Similari allows building various tracking and similarity engines, there are competitive tools that sometimes
may fit better. The section will explain where it is applicable and what alternatives exist.
Similari fits best for the tracking tasks where objects are described by multiple observations for a certain feature
class, not a single feature vector. Also, their behavior is dynamic - you remove them from the index or modify them as
often as add new ones. This is a very important point - it is less efficient than tools that work with growing or static
object spaces.
**Fit**: track the person across the room: person ReID, age/gender, and face features are collected multiple times during
the tracking and used to merge tracks or provide aggregated results at the end of the track;
**Not fit**: plagiarism database, when a single document is described by a number (or just one) constant ReID vectors,
documents are added but not removed. The task is to find the top X most similar documents to a checked.
If your task looks like **Not fit**, can use Similari, but you're probably looking for `HNSW` or `NMS` implementations:
* HNSW Rust - [Link](https://github.com/jean-pierreBoth/hnswlib-rs)
* HNSW C/Python - [link](https://github.com/nmslib/hnswlib)
* NMSLib - [link](https://github.com/nmslib/nmslib)
Similari objects support following features:
**Track lifecycle** - the object is represented by its lifecycle (track) - it appears, evolves, and disappears. During
its lifetime object evolves according to its behavioral properties (attributes, and feature observations).
**Observations** - Similari assumes that an object is observed by an observer entity that collects its features
(uniform vectors) and custom observation attributes (like GPS or screen box position)multiple times. Those
features are presented by vectors of float numbers and observation attributes. When the observation happened, the
track is updated with gathered features. Future observations are used to find similar tracks in the index and merge them.
**Track Attributes** - Arbitrary attributes describe additional track properties aside from feature observations.
Track attributes is crucial part when you are comparing objects in the wild, because there may be attributes
disposition when objects are incompatible, like `animal_type` that prohibits you from comparing `dogs` and `cats`
between each other. Another popular use of attributes is a spatial or temporal characteristic of an object, e.g. objects
that are situated at distant locations at the same time cannot be compared. Attributes in Similari are dynamic and
evolve upon every feature observation addition and when objects are merged. They are used in both distance calculations
and compatibility guessing (which decreases compute space by skipping incompatible objects).
If you plan to use Similari to search in a large index, consider object attributes to split the lookup space. If the
attributes of the two tracks are not compatible, their distance calculations are skipped.
## Performance
The Similari is fast. It is usually faster than trackers built with Python and NumPy.
To run visual feature calculations performant the framework uses [ultraviolet](https://crates.io/crates/ultraviolet) -
the library for fast SIMD computations.
Parallel computations are implemented with index sharding and parallel computations based on a dedicated thread workers
pool.
Vector operations performance depends a lot on the optimization level defined for the build. On low or default
optimization levels Rust may not use f32 vectorization, so when running benchmarks take care of proper optimization
levels configured.
### Rust optimizations
Use `RUSTFLAGS="-C target-cpu=native"` to enable all cpu features like AVX, AVX2, etc. It is beneficial to ultraviolet.
Alternatively you can add build instructions to `.cargo/config`:
```
[build]
rustflags = "-C target-cpu=native"
```
Take a look at [benchmarks](benches) for numbers.
### Performance Benchmarks
Some benchmarks numbers are presented here: [Benchmarks](assets/benchmarks/benchmarks.md)
You can run your own benchmarks by:
```
rustup default nightly
cargo bench
```
## Apple Silicone Build Notes
You may need to add following lines into your `~/.cargo/config` to build the code on Apple Silicone:
```
[build]
rustflags = "-C target-cpu=native"
# Apple Silicone fix
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
```
## Python API
Python interface exposes ready-to-use functions and classes of Similari. As for now, the Python interface provides:
* the Kalman filter for axis-aligned and oriented (rotated) boxes prediction;
* the Kalman filter for 2D point motion prediction;
* the 2D Point Vector Kalman filter, that predicts the vector of independent 2D points motion (used in the Keypoint Tracker);
* NMS (Non-maximum suppression);
* the Sutherland-Hodgman clipping, intersection area for oriented (rotated) boxes;
* SORT with IoU and Mahalanobis metric;
* BatchSORT with IoU and Mahalanobis metric;
* VisualSORT - DeepSORT-like tracker with euclidean/cosine metric for visual features and IoU/Mahalanobis metric
for positional tracking (VisualSort).
* BatchVisualSORT - batched VisualSORT flavor;
Python API classes and functions can be explored in the python
[documentation](assets/documentation/python/api.md) and tiny [examples](python) provided.
There is also [MOTChallenge](python/motchallenge) evaluation kit provided which you can use to simply evaluate trackers
performance and metrics.
### Install Python API from PyPi
*Please, keep in mind that the PyPi package is built to conform broad range of platforms, so it may not be as fast as the one you build locally for your platform (see the following sections).*
Platforms:
* Linux: X86_64, ARM64, ARMv7;
* Windows: X86_64;
* MacOS: X86_64, ARM64.
```
pip3 install similari-trackers-rs
```
### Build Python API in Docker
You can build the wheel in the Docker and if you want to install it in the host system,
copy the resulting package to the host system as demonstrated by the following examples.
#### Rust 1.67 Base Image
If you use other rust libraries you may find it beneficial to build with base Rust
container (and Python 3.8):
```
docker build -t similari-trackers-rs -f docker/rust_1.67/Dockerfile .
# optional: copy and install to host system
docker run --rm -it -v $(pwd)/distfiles:/tmp similari-trackers-rs cp -R /opt/dist /tmp
pip3 install --force-reinstall distfiles/dist/*.whl
```
#### Python 3.8 Base Image
Python 3.8 is still a very frequently used. Here is how to build Similari with it:
```
docker build -t similari-trackers-rs -f docker/python_3.8/Dockerfile .
# optional: copy and install to host system
docker run --rm -it -v $(pwd)/distfiles:/tmp similari-trackers-rs cp -R /opt/dist /tmp
pip3 install --force-reinstall distfiles/dist/*.whl
```
#### Python 3.10 Base Image
If you use the most recent Python environment, you can build with base Python container:
```
docker build -t similari-trackers-rs -f docker/python_3.10/Dockerfile .
# optional: copy and install to host system
docker run --rm -it -v $(pwd)/distfiles:/tmp similari-trackers-rs cp -R /opt/dist /tmp
pip3 install --force-reinstall distfiles/dist/*.whl
```
**NOTE**: If you are getting the `pip3` error like:
```
ERROR: similari-trackers-rs-0.26.4-cp38-cp38-manylinux_2_28_x86_64.whl is not a supported wheel on this platform.
```
It means that the Python version in the host system doesn't match to the one that is in the image used
to build the wheel.
### Build Python API in Host System
#### Linux Instruction
0. Install up-to-date Rust toolkit:
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup update
```
1. Install build-essential tools `apt install build-essential -y`.
2. Install Python3 (>= 3.8) and the development files (`python3-dev`).
3. Install Maturin:
```
pip3 install --upgrade maturin~=0.15
```
4. **Not in VENV**. Build the python module:
```
RUSTFLAGS=" -C target-cpu=native -C opt-level=3" maturin build --release --out dist
pip3 install --force-reinstall dist/*.whl
```
4. **In VENV**. Build the python module:
```
RUSTFLAGS=" -C target-cpu=native -C opt-level=3" maturin develop
```
5. Usage examples are located at [python](python).
6. MOT Challenge Docker image for Similari trackers and conventional trackers is [here](python/motchallenge).
You can easily build all-in-one Docker image and try ours trackers.
## Manuals and Articles
Collected articles about how the Similari can be used to solve specific problems.
#### Medium.com
* IoU object tracker [example](https://medium.com/@kudryavtsev_ia/high-performance-object-tracking-engine-with-rust-59ccbc79cdb0);
* Re-ID object tracker [example](https://medium.com/@kudryavtsev_ia/feature-based-object-tracker-with-similari-and-rust-25d72d01d2e2);
* SORT object tracker [example](https://medium.com/p/9a1dd18c259c);
* Python SORT object tracker [example](https://medium.com/@kudryavtsev_ia/high-performance-python-sort-tracker-225c2b507562);
* Python Rotated SORT object tracker [example](https://medium.com/inside-in-sight/rotated-objects-tracking-with-angle-aware-detection-model-and-sort-tracker-42a96429898d);
* [Why You Need a High-Performance Tracking Systems For Multiple Object Tracking](https://medium.com/inside-in-sight/why-you-need-a-high-performance-tracking-systems-for-multiple-object-tracking-d1ffd56ca8b7?source=friends_link&sk=7685979b41a112709eab8386c8e56e08).
## Usage Examples
Take a look at samples in the repo:
* [simple.rs](examples/simple.rs) - an idea of simple usage.
* [track_merging.rs](examples/track_merging.rs) - an idea of intra-cam track merging.
* [incremental_track_build.rs](examples/incremental_track_build.rs) - very simple feature-based tracker.
* [simple_sort_iou_tracker.rs](examples/simple_sort_iou_tracker.rs) - SORT tracker (with Kalman filter, IoU).
* [simple_sort_iou_tracker_oriented.rs](examples/simple_sort_iou_tracker_oriented.rs) - Oriented (rotated) SORT tracker
(with Kalman filter, IoU).
* [simple_sort_maha_tracker.rs](examples/simple_sort_maha_tracker.rs) - SORT tracker (with Kalman filter, Mahalanobis).
* [simple_sort_maha_tracker_oriented.rs](examples/simple_sort_maha_tracker_oriented.rs) - Oriented SORT tracker (with Kalman filter, Mahalanobis).
* [middleware_sort_tracker.rs](examples/middleware_sort_tracker.rs) - SORT tracker (with Kalman filter, middleware implementation).
================================================
FILE: assets/benchmarks/benchmarks.md
================================================
# Benchmarks
All benchmarks numbers received on Run on 4 cores of Intel(R) Core(TM) i5-7440HQ CPU @ 2.80GHz.
Version: v0.22.5
**Non-Maximum Suppression (non-oriented boxes)**. Benchmark for filtering out of bounding boxes without orientation.
| Objects | Time (ns/iter) | FPS |
|---------|----------------:|--------:|
| 10 | 1,586 | 632000 |
| 100 | 148,906 | 6711 |
| 500 | 4,082,791 | 250 |
| 1000 | 13,773,713 | 72 |
The benchmark is located at [/benches/nms.rs](/benches/nms.rs).
**Non-Maximum Suppression (oriented boxes)**. Benchmark for filtering out of bounding boxes with angular orientation.
| Objects | Time (ns/iter) | FPS |
|---------|-----------------:|--------:|
| 10 | 2,169 | 461000 |
| 100 | 139,204 | 7100 |
| 300 | 1,752,410 | 570 |
| 500 | 4,571,784 | 218 |
| 1000 | 18,155,136 | 54 |
The benchmark is located at [/benches/nms_oriented.rs](/benches/nms_oriented.rs).
**SORT tracking (IoU)**. Benchmark for N simultaneously observed objects. The benchmark uses the heuristics that
separate the observed objects based on object distances.
The benchmark is located at [/benches/simple_sort_iou_tracker.rs](/benches/simple_sort_iou_tracker.rs).
| Objects | Time (ns/iter) | FPS |
|---------|-----------------:|--------:|
| 10 | 100,931 | 9900 |
| 100 | 1,779,434 | 561 |
| 500 | 18,705,819 | 53 |
**Oriented SORT tracking (IoU)**. Benchmark for N simultaneously observed **oriented** objects. The benchmark uses
the heuristics that separate the observed objects based on object distances.
The benchmark is located at [/benches/simple_sort_iou_tracker_oriented.rs](/benches/simple_sort_iou_tracker_oriented.rs).
| Objects | Time (ns/iter) | FPS |
|---------|-----------------:|-----:|
| 10 | 108,414 | 9170 |
| 100 | 1,601,062 | 624 |
| 500 | 18,945,655 | 52 |
**SORT tracking (Mahalanobis)**. Benchmark for N simultaneously observed objects. The benchmark uses heuristics
that separate the observed objects based on object distances.
The benchmark is located at [/benches/simple_sort_maha_tracker.rs](/benches/simple_sort_maha_tracker.rs).
| Objects | Time (ns/iter) | FPS |
|---------|---------------:|-----:|
| 10 | 105,311 | 9500 |
| 100 | 1,696,943 | 588 |
| 500 | 18,233,557 | 54 |
**Oriented SORT tracking (Mahalanobis)**. Benchmark for N simultaneously observed **oriented** objects. The benchmark
uses the heuristics that separate the observed objects based on object distances.
The benchmark is located at [/benches/simple_sort_maha_tracker_oriented.rs](/benches/simple_sort_maha_tracker_oriented.rs).
| Objects | Time (ns/iter) | FPS |
|---------|----------------:|-----:|
| 10 | 111,778 | 8900 |
| 100 | 1,567,771 | 636 |
| 500 | 17,762,559 | 56 |
**Visual (256 @ f32, hist=3) tracking**. Benchmark for N simultaneously observed objects. The benchmark doesn't use
heuristics that separate the observed objects based on object distances. The 3 last observations are used to select
winning track.
The benchmark located at [/benches/feature_tracker.rs](/benches/feature_tracker.rs).
| Objects | Time (ns/iter) | FPS |
|---------|----------------:|------:|
| 10 | 101,465 | 9900 |
| 100 | 4,020,673 | 250 |
| 500 | 61,716,729 | 16 |
**Visual SORT (aka DeepSORT) tracking**. Benchmark for N simultaneously observed objects with feature vectors. The benchmark uses heuristics
that separate the observed objects based on object distances. Every track holds 3 feature vectors for comparison with candidats.
The benchmark is located at [/benches/simple_visual_sort_tracker.rs](/benches/simple_visual_sort_tracker.rs).
| Objects | Vector Len | Time (ns/iter) | FPS |
|---------|------------:|----------------:|------:|
| 10 | 128 | 356,237 | 2800 |
| 10 | 256 | 404,416 | 2460 |
| 10 | 512 | 447,903 | 2230 |
| 10 | 1024 | 573,197 | 1740 |
| 10 | 2048 | 767,031 | 1300 |
| 50 | 128 | 1,923,861 | 519 |
| 50 | 256 | 2,105,886 | 474 |
| 50 | 512 | 2,249,694 | 444 |
| 50 | 1024 | 2,958,547 | 337 |
| 50 | 2048 | 4,563,691 | 218 |
| 100 | 128 | 3,807,716 | 262 |
| 100 | 256 | 4,717,401 | 211 |
| 100 | 512 | 5,775,469 | 173 |
| 100 | 1024 | 7,497,783 | 133 |
| 100 | 2048 | 10,527,237 | 94 |
**BatchSORT tracking (IoU)**. Benchmark for N simultaneously observed objects. The benchmark uses the heuristics that
separate the observed objects based on object distances.
The benchmark is located at [/benches/batch_sort_iou_tracker.rs](/benches/batch_sort_iou_tracker.rs).
| Objects | Time (ns/iter) | FPS |
|---------|-----------------:|-----:|
| 10 | 106,876 | 9300 |
| 100 | 1,616,542 | 618 |
| 500 | 20,454,230 | 48 |
**BatchSORT tracking (Mahalanobis)**. Benchmark for N simultaneously observed objects. The benchmark uses heuristics
that separate the observed objects based on object distances.
The benchmark is located at [/benches/batch_sort_maha_tracker.rs](/benches/batch_sort_maha_tracker.rs).
| Objects | Time (ns/iter) | FPS |
|---------|---------------:|-----:|
| 10 | 114,592 | 8695 |
| 100 | 1,533,445 | 649 |
| 500 | 18,270,742 | 54 |
================================================
FILE: assets/documentation/python/api.md
================================================
# Python API
Python API is generated with PyO3 & Maturin.
## Functions
[nms](https://docs.rs/similari/0.22.6/similari/utils/nms/nms_py/fn.nms_py.html) - non-maximum suppression implementation for oriented or axis-aligned bounding boxes.
```python
bbox1 = (BoundingBox(10.0, 11.0, 3.0, 3.8).as_xyaah(), 1.0)
bbox2 = (BoundingBox(10.3, 11.1, 2.9, 3.9).as_xyaah(), 0.9)
res = nms([bbox2, bbox1], nms_threshold = 0.7, score_threshold = 0.0)
print(res[0].as_ltwh())
```
[sutherland_hodgman_clip](https://docs.rs/similari/0.22.6/similari/utils/clipping/clipping_py/fn.sutherland_hodgman_clip_py.html) - calculates the resulting polygon for two oriented or axis-aligned bounding boxes.
```python
bbox1 = BoundingBox(0.0, 0.0, 5.0, 10.0).as_xyaah()
bbox2 = BoundingBox(0.0, 0.0, 10.0, 5.0).as_xyaah()
clip = sutherland_hodgman_clip(bbox1, bbox2)
print(clip)
```
[intersection_area](https://docs.rs/similari/0.22.6/similari/utils/clipping/clipping_py/fn.intersection_area_py.html) - calculates the area of intersection for two oriented or axis-aligned bounding boxes.
```python
bbox1 = BoundingBox(0.0, 0.0, 5.0, 10.0).as_xyaah()
bbox2 = BoundingBox(0.0, 0.0, 5.0, 10.0).as_xyaah()
bbox2.rotate(0.5)
clip = sutherland_hodgman_clip(bbox1, bbox2)
print(clip)
area = intersection_area(bbox1, bbox2)
print("Intersection area:", area)
```
## Classes
### Areas
[Universal2DBox](https://docs.rs/similari/0.22.6/similari/utils/bbox/struct.Universal2DBox.html) - universal 2D bounding
box format that represents oriented and axis-aligned bounding boxes.
```python
ubb = Universal2DBox(xc=3.0, yc=4.0, angle=0.0, aspect=1.5, height=5.0)
print(ubb)
ubb = Universal2DBox(3.0, 4.0, 0.0, 1.5, 5.0)
print(ubb)
ubb.rotate(0.5)
ubb.gen_vertices()
print(ubb)
polygon = ubb.get_vertices()
print(polygon.get_points())
print(ubb.area())
print(ubb.get_radius())
ubb = Universal2DBox.new_with_confidence(xc=3.0, yc=4.0, angle=0.0, aspect=1.5, height=5.0, confidence=0.85)
print(ubb)
```
[BoundingBox](https://docs.rs/similari/0.22.6/similari/utils/bbox/struct.BoundingBox.html) - convenience class that must
be transformed to Universal2DBox by calling `as_xyaah()` before passing to any methods.
```python
bb = BoundingBox(left=1.0, top=2.0, width=10.0, height=15.0)
print(bb)
bb = BoundingBox(1.0, 2.0, 10.0, 15.0)
print(bb.left, bb.top, bb.width, bb.height)
universal_bb = bb.as_xyaah()
print(universal_bb)
bb = BoundingBox.new_with_confidence(1.0, 2.0, 10.0, 15.0, 0.95)
print(bb)
```
[Polygon](https://docs.rs/similari/0.22.6/similari/utils/clipping/clipping_py/struct.PyPolygon.html) - return type
for [sutherland_hodgman_clip](https://docs.rs/similari/0.22.6/similari/utils/clipping/clipping_py/fn.sutherland_hodgman_clip_py.html).
It cannot be created manually, but returned from the function:
```python
bbox1 = BoundingBox(0.0, 0.0, 5.0, 10.0).as_xyaah()
bbox2 = BoundingBox(0.0, 0.0, 5.0, 10.0).as_xyaah()
bbox2.rotate(0.5)
clip = sutherland_hodgman_clip(bbox1, bbox2)
print(clip)
```
### Kalman Filter
[KalmanFilterState](https://docs.rs/similari/0.21.2/similari/utils/kalman/kalman_py/struct.PyKalmanFilterState.html) - predicted or updated
state of the oriented bounding box for Kalman filter.
[KalmanFilter](https://docs.rs/similari/0.21.2/similari/utils/kalman/kalman_py/struct.PyKalmanFilter.html) - Kalman filter implementation.
```python
f = KalmanFilter()
state = f.initiate(BoundingBox(0.0, 0.0, 5.0, 10.0).as_xyaah())
state = f.predict(state)
box_ltwh = state.bbox()
print(box_ltwh)
# if work with oriented box
# import Universal2DBox and use it
#
#box_xyaah = state.universal_bbox()
#print(box_xyaah)
state = f.update(state, BoundingBox(0.2, 0.2, 5.1, 9.9).as_xyaah())
state = f.predict(state)
box_ltwh = state.bbox()
print(box_ltwh)
```
### SORT Tracker
[PositionalMetricType](https://docs.rs/similari/0.22.6/similari/trackers/sort/struct.PyPositionalMetricType.html) - enum type that
allows setting the positional metric used by a tracker. Two positional metrics are supported:
* IoU(threshold) - intersection over union with threshold that defines when the area is too low to merge the track candidate
with the track, and it is required to form a new track;
* Mahalanobis - Mahalanobis distance is used to compute the distance between track candidates and
tracks kept in the store.
```python
metric = PositionalMetricType.iou(threshold=0.3)
metric = PositionalMetricType.maha()
```
#### Produced Tracks
[SortTrack](https://docs.rs/similari/0.22.6/similari/trackers/sort/struct.SortTrack.html) - the calling of the tracker's
`predict` causes the track candidates to be merged with the current tracks or form new tracks. The resulting information
is returned for each track in the form of the structure `SortTrack`. Fields are accessible by their names.
```python
...
custom_object_id = 13 # None is also a valid value
tracks = sort.predict([(box, custom_object_id)])
for t in tracks:
print(t)
```
Output:
```
SortTrack {
id: 2862991017811132132,
epoch: 1,
predicted_bbox: Universal2DBox {
xc: 13.5,
yc: 8.5,
angle: None,
aspect: 1.0,
height: 7.0,
confidence: 1.0,
_vertex_cache: None,
},
observed_bbox: Universal2DBox {
xc: 13.5,
yc: 8.5,
angle: None,
aspect: 1.0,
height: 7.0,
confidence: 1.0,
_vertex_cache: None,
},
scene_id: 0,
length: 1,
voting_type: Positional,
custom_object_id: None,
}
```
[WastedSortTrack](https://docs.rs/similari/0.22.6/similari/trackers/sort/struct.PyWastedSortTrack.html) - the trackers
return the structure for the track when it is wasted from the track store. Fields are accessible by their names. Despite
the `SortTrack` the `WastedSortTrack` includes historical data for predictions and observations.
```python
sort.skip_epochs(10)
wasted = sort.wasted()
print(wasted[0])
```
```
PyWastedSortTrack {
id: 3466318811797522494,
epoch: 1,
predicted_bbox: Universal2DBox {
xc: 13.5,
yc: 8.5,
angle: None,
aspect: 1.0,
height: 7.0,
confidence: 1.0,
_vertex_cache: None,
},
observed_bbox: Universal2DBox {
xc: 13.5,
yc: 8.5,
angle: None,
aspect: 1.0,
height: 7.0,
confidence: 1.0,
_vertex_cache: None,
},
scene_id: 0,
length: 1,
predicted_boxes: [
Universal2DBox {
xc: 13.5,
yc: 8.5,
angle: None,
aspect: 1.0,
height: 7.0,
confidence: 1.0,
_vertex_cache: None,
},
],
observed_boxes: [
Universal2DBox {
xc: 13.5,
yc: 8.5,
angle: None,
aspect: 1.0,
height: 7.0,
confidence: 1.0,
_vertex_cache: None,
},
],
}
```
#### Tracker Usage
[SORT](https://docs.rs/similari/0.22.6/similari/trackers/sort/simple_api/struct.Sort.html) - basic tracker that uses
only positional information for tracking. The SORT tracker is widely used in the environments with rare or no occlusions
happen. SORT is a high-performance low-resource tracker. Despite the original SORT, Similari SORT supports
both axis-aligned and oriented (rotated) bounding boxes.
The Similari SORT is able to achieve the following speeds:
| Objects | Time (ms/prediction) | FPS | CPU Cores |
|---------|---------------------:|------:|-----------:|
| 10 | 0.149 | 6711 | 1 |
| 100 | 1.660 | 602 | 1 |
| 200 | 4.895 | 204 | 2 |
| 300 | 8.991 | 110 | 4 |
| 500 | 17.432 | 57 | 4 |
| 1000 | 53.098 | 18 | 5 |
Comparing to a standard Python SORT from the original [repository](https://github.com/abewley/sort),
the Similari SORT tracker works several times faster:
| Objects | Time (ms/prediction) | FPS | CPU Cores (NumPy) | Similari Gain |
|---------|-----------------------:|-----:|-------------------:|---------------:|
| 10 | 1.588 | 620 | ALL | x10.8 |
| 100 | 11.976 | 83 | ALL | x7.25 |
| 200 | 25.160 | 39 | ALL | x5.23 |
| 300 | 40.922 | 24 | ALL | x4.58 |
| 500 | 74.254 | 13 | ALL | x4.38 |
| 1000 | 162.037 | 6 | ALL | x3 |
The examples of the tracker usage are located at:
* [SORT IOU](/python/sort/sort_iou.py) - IoU SORT tracker;
* [SORT_IOU_BENCH](/python/sort/sort_iou_bench.py) - IoU SORT tracker benchmark;
* [SORT_MAHA](/python/sort/sort_maha.py) - Mahalanobis SORT tracker;
* [SORT_IOU_ROTATED](/python/sort/sort_iou_rotated.py) - IoU SORT with rotated boxes.
Also, with Similari SORT you can use custom `scene_id` that allows combining several trackers in
one without the need to create a separate tracker for every object class. There are methods that support
`scene_id` passing:
* [SORT_IOU_SCENE_ID](/python/sort/sort_iou_scene_id.py) - IoU tracker with several scenes.
To increase the performance of the SORT in scenes with large number of objects one can use
[SpatioTemporalConstraints](https://docs.rs/similari/0.22.6/similari/trackers/spatio_temporal_constraints/struct.SpatioTemporalConstraints.html).
When certain tracks are not updated on the current prediction epoch and the `max_idle_epochs` is greater than `0` the
idle tracks can be accessible as well:
* [SORT_IDLE](/python/sort/sort_idle.py) - working with idle tracks;
* The Medium [article](https://medium.com/@kudryavtsev_ia/high-performance-python-sort-tracker-225c2b507562) where the tracker that
uses idle tracks is demonstrated.
##### Methods
```python
Sort(shards, bbox_history, max_idle_epochs, method, min_confidence, spatio_temporal_constraints)
```
Parameters:
* `shards` - the parallelism of the tracker, the more data holds, the more shards show be created,
1-2 shards is enough to manage up to 100 tracks, try it to get the lowest processing time;
* `bbox_history` - the number of predictions the tracks hold in the history; the history is only
accessible via `wasted()` method, if you are receiving and analyze the tracking info on every
prediction step, you can set it to `1`;
* `max_idle_epochs` - how long the track stays active in the tracker without updates;
* `method` - `PositionalMetricType` instance that defines the method used for distance calculation (IoU or Mahalanobis);
* `min_confidence` - minimal bounding box confidence allowed, when a bounding box has lowe confidence it is set to the parameter;
* `spatio_temporal_constraints` - additional limitations that define how far the observation may be from the prediction for the
next and following epochs; the parameter helps decrease the processing time, but if you don't care, just set to `None`.
```python
def skip_epochs(n: int)
```
Does fast-forward on `n` epochs for the scene `0`.
```python
def skip_epochs_for_scene(scene_id: int, n: int)
```
Does fast-forward on `n` epochs for the scene `scene_id`.
```python
def shard_stats() -> List[int]
```
Shows how many elements is kept in every shard. Imbalance may
lead to uneven cores load, but it can happen in the real world.
```python
def current_epoch() -> int
```
Returns the current epoch for scene `0`.
```python
def current_epoch_with_scene(scene_id: int) -> int
```
Returns the current epoch for scene `scene_id`.
```python
def predict(bboxes: List[(Universal2DBox, Optional[int] = None)]) -> List[SortTrack]
```
Predicts the tracks for specified bounding boxes. The second tuple parameter is the custom object id.
It is present in returned tracks and helps to find what track was chosen to the box without the need to
look for boxes in tracks by their coordinates.
```python
def predict_with_scene(scene_id: int, bboxes: List[(Universal2DBox, Optional[int] = None)]) -> List[SortTrack]
```
The same predict, but the scene id is set to `scene_id`. If there are some object classes, they can be tracked separately
with use of `scene_id`. The same apply to the case when the tracker tracks objects on multiple camers. `Scene_id` helps
efficiently manage multiple classes, cameras, etc. within the one tracker.
```python
def wasted() -> List[WastedSortTrack]
```
Returns the tracks that are expired.
```python
def clear_wasted()
```
Clears the expired tracks. Works faster than `wasted()` because doesn't require
capturing the information from the database.
```python
def idle_tracks() -> List[SortTrack]
```
Returns the tracks that are active but wasn't updated during the last
prediction. Scene is `0`.
```python
def idle_tracks_with_scene(scene_id: int) -> List[SortTrack]
```
Returns the tracks that are active but wasn't updated during the last
prediction. Scene is `scene_id`.
### Batch SORT Tracker
Batch SORT tracker is the same tracker as SORT tracker but allows passing to prediction
the batch with several scenes and receive the results back. In case, when the ML pipeline
supports the batching the Batch SORT tracker must be used, because it can efficeintly
handle results with less time required, when there are several independent scenes in the batch.
API is almost the same, except the `predict(...)`. See examples at:
* [BATCH_SORT_IOU_TRACKER](/python/sort/batch_sort_iou.py) - IoU flavor;
* [BATCH_SORT_IOU_BENCHMARK](/python/sort/batch_sort_iou_bench.py) - IoU performance benchmark.
### Visual SORT Tracker
Visual SORT tracker is DeepSORT flavour with improvements. It uses custom user ReID model and
positional tracking based on IoU or Mahalanobis distance.
#### Tracker Configuration
* [VisualSortOptions](https://docs.rs/similari/0.22.6/similari/trackers/visual/simple_api/options/struct.VisualSortOptions.html)
* [VisualMetricType](https://docs.rs/similari/0.22.6/similari/trackers/visual/metric/struct.PyVisualMetricType.html)
#### Tracker Usage
* [VisualObservation](https://docs.rs/similari/0.22.6/similari/trackers/visual/simple_api/simple_visual_py/struct.PyVisualObservation.html)
* [VisualObservationSet](https://docs.rs/similari/0.22.6/similari/trackers/visual/simple_api/simple_visual_py/struct.PyVisualObservationSet.html)
* [VisualSort](https://docs.rs/similari/0.22.6/similari/trackers/visual/simple_api/struct.VisualSort.html)
================================================
FILE: benches/batch_sort_iou_tracker.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::trackers::batch::PredictionBatchRequest;
use similari::trackers::sort::batch_api::BatchSort;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::PositionalMetricType::IoU;
use similari::trackers::sort::DEFAULT_SORT_IOU_THRESHOLD;
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::trackers::tracker_api::TrackerAPI;
use test::Bencher;
#[bench]
fn batch_sort_iou_00010(b: &mut Bencher) {
bench_batch_sort(10, b);
}
#[bench]
fn batch_sort_iou_00100(b: &mut Bencher) {
bench_batch_sort(100, b);
}
#[bench]
fn batch_sort_iou_00500(b: &mut Bencher) {
bench_batch_sort(500, b);
}
fn bench_batch_sort(objects: usize, b: &mut Bencher) {
let pos_drift = 1.0;
let box_drift = 0.001;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
1000.0 * i as f32,
1000.0 * i as f32,
50.0,
50.0,
pos_drift,
box_drift,
))
}
let mut iteration = 0;
let ncores = match objects {
10 => 1,
100 => 2,
_ => num_cpus::get(),
};
let mut tracker = BatchSort::new(
ncores,
ncores,
10,
1,
IoU(DEFAULT_SORT_IOU_THRESHOLD),
DEFAULT_MINIMAL_SORT_CONFIDENCE,
Some(SpatioTemporalConstraints::default().constraints(&[(1, 1.0)])),
1.0 / 20.0,
1.0 / 160.0,
);
let mut count = 0;
b.iter(|| {
count += 1;
let (mut batch, res) = PredictionBatchRequest::new();
for i in &mut iterators {
iteration += 1;
let b = i.next();
batch.add(0, (b.unwrap().into(), Some(1)));
}
tracker.predict(batch);
for _ in 0..res.batch_size() {
let (_scene, _tracks) = res.get();
}
});
eprintln!("Store stats: {:?}", tracker.active_shard_stats());
assert_eq!(
tracker.active_shard_stats().into_iter().sum::<usize>(),
objects
);
let wasted = tracker.wasted();
assert!(wasted.is_empty());
tracker.skip_epochs(2);
let wasted = tracker.wasted();
assert_eq!(wasted.len(), objects);
for w in wasted {
assert_eq!(w.get_attributes().track_length, count);
}
eprintln!("Benchmark complete");
}
================================================
FILE: benches/batch_sort_maha_tracker.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::prelude::PositionalMetricType::Mahalanobis;
use similari::trackers::batch::PredictionBatchRequest;
use similari::trackers::sort::batch_api::BatchSort;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::trackers::tracker_api::TrackerAPI;
use test::Bencher;
#[bench]
fn batch_sort_maha_00010(b: &mut Bencher) {
bench_batch_sort(10, b);
}
#[bench]
fn batch_sort_maha_00100(b: &mut Bencher) {
bench_batch_sort(100, b);
}
#[bench]
fn batch_sort_maha_00500(b: &mut Bencher) {
bench_batch_sort(500, b);
}
fn bench_batch_sort(objects: usize, b: &mut Bencher) {
let pos_drift = 1.0;
let box_drift = 0.001;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
1000.0 * i as f32,
1000.0 * i as f32,
50.0,
50.0,
pos_drift,
box_drift,
))
}
let mut iteration = 0;
let ncores = match objects {
10 => 1,
100 => 2,
_ => num_cpus::get(),
};
let mut tracker = BatchSort::new(
ncores,
ncores,
10,
1,
Mahalanobis,
DEFAULT_MINIMAL_SORT_CONFIDENCE,
Some(SpatioTemporalConstraints::default().constraints(&[(1, 1.0)])),
1.0 / 20.0,
1.0 / 160.0,
);
let mut count = 0;
b.iter(|| {
count += 1;
let (mut batch, res) = PredictionBatchRequest::new();
for i in &mut iterators {
iteration += 1;
let b = i.next();
batch.add(0, (b.unwrap().into(), Some(1)));
}
tracker.predict(batch);
for _ in 0..res.batch_size() {
let (_scene, _tracks) = res.get();
}
});
eprintln!("Store stats: {:?}", tracker.active_shard_stats());
assert_eq!(
tracker.active_shard_stats().into_iter().sum::<usize>(),
objects
);
let wasted = tracker.wasted();
assert!(wasted.is_empty());
tracker.skip_epochs(2);
let wasted = tracker.wasted();
assert_eq!(wasted.len(), objects);
for w in wasted {
assert_eq!(w.get_attributes().track_length, count);
}
}
================================================
FILE: benches/bbox_own_areas.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::utils::clipping::bbox_own_areas::{
exclusively_owned_areas, exclusively_owned_areas_normalized_shares,
};
use test::Bencher;
#[bench]
fn bbox_own_areas_00010(b: &mut Bencher) {
bench_bbox_own_areas(10, b);
}
#[bench]
fn bbox_own_areas_00025(b: &mut Bencher) {
bench_bbox_own_areas(25, b);
}
#[bench]
fn bbox_own_areas_00050(b: &mut Bencher) {
bench_bbox_own_areas(50, b);
}
#[bench]
fn bbox_own_areas_00100(b: &mut Bencher) {
bench_bbox_own_areas(100, b);
}
fn bench_bbox_own_areas(objects: usize, b: &mut Bencher) {
let pos_drift = 20.0;
let box_drift = 5.0;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
i as f32, i as f32, 10.0, 10.0, pos_drift, box_drift,
));
}
b.iter(|| {
let mut observations = Vec::new();
for i in &mut iterators {
let b = i.next();
observations.push(b.unwrap().into());
}
let input = observations.iter().collect::<Vec<_>>();
let polygons = exclusively_owned_areas(input.as_slice());
let areas =
exclusively_owned_areas_normalized_shares(input.as_slice(), polygons.as_slice());
assert_eq!(areas.len(), objects);
});
}
================================================
FILE: benches/feature_tracker.rs
================================================
#![feature(test)]
extern crate test;
use similari::distance::euclidean;
use similari::examples::FeatGen;
use similari::prelude::{NoopNotifier, ObservationBuilder, TrackStoreBuilder};
use similari::track::{
MetricOutput, MetricQuery, NoopLookup, Observation, ObservationMetric, ObservationMetricOk,
ObservationsDb, TrackAttributes, TrackAttributesUpdate, TrackStatus,
};
use similari::voting::topn::TopNVoting;
use similari::voting::Voting;
use std::time::Instant;
use test::Bencher;
const FEAT0: u64 = 0;
#[derive(Debug, Clone, Default)]
struct NoopAttributes;
#[derive(Clone, Debug)]
struct NoopAttributesUpdate;
impl TrackAttributesUpdate<NoopAttributes> for NoopAttributesUpdate {
fn apply(&self, _attrs: &mut NoopAttributes) -> anyhow::Result<()> {
Ok(())
}
}
impl TrackAttributes<NoopAttributes, ()> for NoopAttributes {
type Update = NoopAttributesUpdate;
type Lookup = NoopLookup<NoopAttributes, ()>;
fn compatible(&self, _other: &NoopAttributes) -> bool {
true
}
fn merge(&mut self, _other: &NoopAttributes) -> anyhow::Result<()> {
Ok(())
}
fn baked(&self, _observations: &ObservationsDb<()>) -> anyhow::Result<TrackStatus> {
Ok(TrackStatus::Ready)
}
}
#[derive(Clone, Default)]
pub struct TrackMetric;
impl ObservationMetric<NoopAttributes, ()> for TrackMetric {
fn metric(&self, mq: &MetricQuery<NoopAttributes, ()>) -> MetricOutput<()> {
let (e1, e2) = (mq.candidate_observation, mq.track_observation);
Some((
None,
match (e1.feature(), e2.feature()) {
(Some(x), Some(y)) => Some(euclidean(x, y)),
_ => None,
},
))
}
fn optimize(
&mut self,
_feature_class: u64,
_merge_history: &[u64],
_attrs: &mut NoopAttributes,
observations: &mut Vec<Observation<()>>,
_prev_length: usize,
_is_merge: bool,
) -> anyhow::Result<()> {
observations.reverse();
observations.truncate(3);
observations.reverse();
Ok(())
}
fn postprocess_distances(
&self,
unfiltered: Vec<ObservationMetricOk<()>>,
) -> Vec<ObservationMetricOk<()>> {
unfiltered
.into_iter()
.filter(|x| {
if let Some(d) = x.feature_distance {
d < 100.0
} else {
false
}
})
.collect()
}
}
fn benchmark(objects: usize, flen: usize, b: &mut Bencher) {
let ncores = match objects {
10 => 1,
100 => 2,
_ => num_cpus::get(),
};
let mut store = TrackStoreBuilder::new(ncores)
.metric(TrackMetric::default())
.default_attributes(NoopAttributes::default())
.notifier(NoopNotifier)
.build();
let voting: TopNVoting<()> = TopNVoting::new(1, 100.0, 1);
let pos_drift = 0.1;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(FeatGen::new(1000.0 * i as f32, flen, pos_drift));
}
let mut iteration = 0;
b.iter(|| {
let mut tracks = Vec::new();
let tm = Instant::now();
for i in &mut iterators {
iteration += 1;
let b = i.next().unwrap().feature().clone();
let t = store
.new_track(iteration)
.observation(
ObservationBuilder::new(FEAT0)
.observation(b.unwrap())
.build(),
)
.build()
.unwrap();
tracks.push(t);
}
let search_tracks = tracks.clone();
let elapsed = tm.elapsed();
eprintln!("Construction time: {:?}", elapsed);
let tm = Instant::now();
let (dists, errs) = store.foreign_track_distances(search_tracks, FEAT0, false);
let elapsed = tm.elapsed();
eprintln!("Lookup time: {:?}", elapsed);
let tm = Instant::now();
let winners = voting.winners(dists);
let elapsed = tm.elapsed();
eprintln!("Voting time: {:?}", elapsed);
assert!(errs.all().is_empty());
let tm = Instant::now();
for t in tracks {
let winners_opt = winners.get(&t.get_track_id());
if let Some(winners) = winners_opt {
let _res = store
.merge_external_noblock(winners[0].winner_track, t, None, false)
.unwrap();
} else {
store.add_track(t).unwrap();
}
}
let elapsed = tm.elapsed();
eprintln!("Merging time: {:?}", elapsed);
eprintln!("Store stats: {:?}", store.shard_stats());
});
}
#[bench]
fn ft_0010_256x3(b: &mut Bencher) {
benchmark(10, 256, b);
}
#[bench]
fn ft_0100_256x3(b: &mut Bencher) {
benchmark(100, 256, b);
}
#[bench]
fn ft_0500_256x3(b: &mut Bencher) {
benchmark(500, 256, b);
}
================================================
FILE: benches/kalman_2d_point.rs
================================================
#![feature(test)]
extern crate test;
use nalgebra::Point2;
use similari::examples::FeatGen2;
use similari::utils::kalman::kalman_2d_point::Point2DKalmanFilter;
use test::Bencher;
#[bench]
fn kalman_2d_point_100k(b: &mut Bencher) {
const N: usize = 100_000;
let f = Point2DKalmanFilter::default();
let mut pt = FeatGen2::new(-10.0, 2.0, 0.2);
b.iter(|| {
let v = pt.next().unwrap().feature().as_ref().unwrap().clone();
let n = v[0].as_array_ref();
let mut state = f.initiate(&Point2::from([n[0], n[1]]));
for _i in 0..N {
let v = pt.next().unwrap().feature().as_ref().unwrap().clone();
let n = v[0].as_array_ref();
state = f.predict(&state);
let p = Point2::from([n[0], n[1]]);
state = f.update(&state, &p);
}
});
}
================================================
FILE: benches/kalman_bbox.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::FeatGen2;
use similari::utils::bbox::Universal2DBox;
use similari::utils::kalman::kalman_2d_box::Universal2DBoxKalmanFilter;
use test::Bencher;
#[bench]
fn kalman_2d_box_100k(b: &mut Bencher) {
const N: usize = 100_000;
let f = Universal2DBoxKalmanFilter::default();
let mut pt = FeatGen2::new(-10.0, 2.0, 0.2);
b.iter(|| {
let v = pt.next().unwrap().feature().as_ref().unwrap().clone();
let n = v[0].as_array_ref();
let bbox = Universal2DBox::new(n[0], n[1], Some(0.0), 2.0, 5.0);
let mut state = f.initiate(&bbox);
for _i in 0..N {
let v = pt.next().unwrap().feature().as_ref().unwrap().clone();
let n = v[0].as_array_ref();
state = f.predict(&state);
let bb = Universal2DBox::new(n[0], n[1], Some(0.0), 2.0, 5.0);
state = f.update(&state, &bb);
}
});
}
================================================
FILE: benches/nms.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::utils::nms::nms;
use test::Bencher;
#[bench]
fn nms_00010(b: &mut Bencher) {
bench_nms(10, b);
}
#[bench]
fn nms_00100(b: &mut Bencher) {
bench_nms(100, b);
}
#[bench]
fn nms_00300(b: &mut Bencher) {
bench_nms(300, b);
}
#[bench]
fn nms_00500(b: &mut Bencher) {
bench_nms(500, b);
}
#[bench]
fn nms_01000(b: &mut Bencher) {
bench_nms(1000, b);
}
fn bench_nms(objects: usize, b: &mut Bencher) {
let pos_drift = 10.0;
let box_drift = 1.0;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
i as f32, i as f32, 50.0, 50.0, pos_drift, box_drift,
));
}
b.iter(|| {
let mut observations = Vec::new();
for i in &mut iterators {
let b = i.next();
observations.push((b.unwrap().into(), None));
}
nms(&observations, 0.8, None);
});
}
================================================
FILE: benches/nms_oriented.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::utils::bbox::Universal2DBox;
use similari::utils::nms::nms;
use test::Bencher;
#[bench]
fn nms_oriented_00010(b: &mut Bencher) {
bench_nms(10, b);
}
#[bench]
fn nms_oriented_00100(b: &mut Bencher) {
bench_nms(100, b);
}
#[bench]
fn nms_oriented_00300(b: &mut Bencher) {
bench_nms(300, b);
}
#[bench]
fn nms_oriented_00500(b: &mut Bencher) {
bench_nms(500, b);
}
#[bench]
fn nms_oriented_01000(b: &mut Bencher) {
bench_nms(1000, b);
}
fn bench_nms(objects: usize, b: &mut Bencher) {
let pos_drift = 10.0;
let box_drift = 1.0;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
i as f32, i as f32, 50.0, 50.0, pos_drift, box_drift,
));
}
b.iter(|| {
let mut observations = Vec::new();
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().clone(), None));
}
nms(observations.as_slice(), 0.8, None);
});
}
================================================
FILE: benches/simple_search.rs
================================================
#![feature(test)]
extern crate test;
use rand::{distributions::Uniform, Rng};
use similari::examples::{UnboundAttributeUpdate, UnboundAttrs, UnboundMetric};
use similari::prelude::{ObservationBuilder, TrackStoreBuilder};
use similari::track::notify::NoopNotifier;
use similari::track::utils::FromVec;
use similari::track::Feature;
use test::Bencher;
#[bench]
fn simple_0512_0001k(b: &mut Bencher) {
bench_capacity_len(512, 1000, b);
}
#[bench]
fn simple_0512_0010k(b: &mut Bencher) {
bench_capacity_len(512, 10000, b);
}
#[bench]
fn simple_0128_001k(b: &mut Bencher) {
bench_capacity_len(128, 1000, b);
}
#[bench]
fn simple_0128_010k(b: &mut Bencher) {
bench_capacity_len(128, 10000, b);
}
fn bench_capacity_len(vec_len: usize, count: usize, b: &mut Bencher) {
const DEFAULT_FEATURE: u64 = 0;
let mut db = TrackStoreBuilder::new(num_cpus::get())
.metric(UnboundMetric::default())
.default_attributes(UnboundAttrs::default())
.notifier(NoopNotifier)
.build();
let mut rng = rand::thread_rng();
let gen = Uniform::new(0.0, 1.0);
for i in 0..count {
let res = db.add(
i as u64,
DEFAULT_FEATURE,
Some(1.0),
Some(Feature::from_vec(
(0..vec_len).map(|_| rng.sample(&gen)).collect::<Vec<_>>(),
)),
Some(UnboundAttributeUpdate {}),
);
assert!(res.is_ok());
}
b.iter(|| {
let t = db
.new_track(count as u64 + 1)
.observation(
ObservationBuilder::new(DEFAULT_FEATURE)
.observation_attributes(1.0)
.observation(Feature::from_vec(
(0..vec_len).map(|_| rng.sample(&gen)).collect::<Vec<_>>(),
))
.build(),
)
.build()
.unwrap();
let (dists, errs) = db.foreign_track_distances(vec![t], DEFAULT_FEATURE, true);
assert_eq!(dists.all().len(), count);
assert!(errs.all().is_empty());
});
}
================================================
FILE: benches/simple_sort_iou_tracker.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::simple_api::Sort;
use similari::trackers::sort::PositionalMetricType::IoU;
use similari::trackers::sort::DEFAULT_SORT_IOU_THRESHOLD;
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::trackers::tracker_api::TrackerAPI;
use test::Bencher;
#[bench]
fn sort_iou_00010(b: &mut Bencher) {
bench_sort(10, b);
}
#[bench]
fn sort_iou_00100(b: &mut Bencher) {
bench_sort(100, b);
}
#[bench]
fn sort_iou_00500(b: &mut Bencher) {
bench_sort(500, b);
}
fn bench_sort(objects: usize, b: &mut Bencher) {
let pos_drift = 1.0;
let box_drift = 0.001;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
1000.0 * i as f32,
1000.0 * i as f32,
50.0,
50.0,
pos_drift,
box_drift,
))
}
let mut iteration = 0;
let ncores = match objects {
10 => 1,
100 => 2,
_ => num_cpus::get(),
};
let mut tracker = Sort::new(
ncores,
10,
1,
IoU(DEFAULT_SORT_IOU_THRESHOLD),
DEFAULT_MINIMAL_SORT_CONFIDENCE,
Some(SpatioTemporalConstraints::default().constraints(&[(1, 1.0)])),
1.0 / 20.0,
1.0 / 160.0,
);
let mut count = 0;
b.iter(|| {
count += 1;
let mut observations = Vec::new();
for i in &mut iterators {
iteration += 1;
let b = i.next();
observations.push((b.unwrap().into(), None));
}
let tracks = tracker.predict(&observations);
assert_eq!(tracks.len(), objects);
});
eprintln!("Store stats: {:?}", tracker.active_shard_stats());
assert_eq!(
tracker.active_shard_stats().into_iter().sum::<usize>(),
objects
);
let wasted = tracker.wasted();
assert!(wasted.is_empty());
tracker.skip_epochs(2);
let wasted = tracker.wasted();
assert_eq!(wasted.len(), objects);
for w in wasted {
assert_eq!(w.get_attributes().track_length, count);
}
}
================================================
FILE: benches/simple_sort_iou_tracker_oriented.rs
================================================
#![feature(test)]
extern crate test;
use rand::Rng;
use similari::examples::BoxGen2;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::simple_api::Sort;
use similari::trackers::sort::PositionalMetricType::IoU;
use similari::trackers::sort::DEFAULT_SORT_IOU_THRESHOLD;
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::trackers::tracker_api::TrackerAPI;
use similari::utils::bbox::Universal2DBox;
use test::Bencher;
#[bench]
fn sort_iou_oriented_00010(b: &mut Bencher) {
bench_sort(10, b);
}
#[bench]
fn sort_iou_oriented_00100(b: &mut Bencher) {
bench_sort(100, b);
}
#[bench]
fn sort_iou_oriented_00500(b: &mut Bencher) {
bench_sort(500, b);
}
fn bench_sort(objects: usize, b: &mut Bencher) {
let pos_drift = 1.0;
let box_drift = 0.001;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
1000.0 * i as f32,
1000.0 * i as f32,
50.0,
50.0,
pos_drift,
box_drift,
))
}
let mut iteration = 0;
let ncores = match objects {
10 => 1,
100 => 2,
_ => num_cpus::get(),
};
let mut tracker = Sort::new(
ncores,
10,
1,
IoU(DEFAULT_SORT_IOU_THRESHOLD),
DEFAULT_MINIMAL_SORT_CONFIDENCE,
Some(SpatioTemporalConstraints::default().constraints(&[(1, 1.0)])),
1.0 / 20.0,
1.0 / 160.0,
);
let mut rng = rand::thread_rng();
let mut count = 0;
b.iter(|| {
count += 1;
let mut observations = Vec::new();
for i in &mut iterators {
iteration += 1;
let b = Universal2DBox::from(i.next().unwrap()).rotate(rng.gen_range(0.0..1.0));
observations.push((b, None));
}
let tracks = tracker.predict(&observations);
assert_eq!(tracks.len(), objects);
});
let wasted = tracker.wasted();
assert!(wasted.is_empty());
eprintln!("Store stats: {:?}", tracker.active_shard_stats());
assert_eq!(
tracker.active_shard_stats().into_iter().sum::<usize>(),
objects
);
tracker.skip_epochs(2);
let wasted = tracker.wasted();
assert_eq!(wasted.len(), objects);
for w in wasted {
assert_eq!(w.get_attributes().track_length, count);
}
}
================================================
FILE: benches/simple_sort_maha_tracker.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::prelude::Sort;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::PositionalMetricType::Mahalanobis;
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::trackers::tracker_api::TrackerAPI;
use test::Bencher;
#[bench]
fn sort_maha_00010(b: &mut Bencher) {
bench_sort(10, b);
}
#[bench]
fn sort_maha_00100(b: &mut Bencher) {
bench_sort(100, b);
}
#[bench]
fn sort_maha_00500(b: &mut Bencher) {
bench_sort(500, b);
}
fn bench_sort(objects: usize, b: &mut Bencher) {
let pos_drift = 1.0;
let box_drift = 0.001;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
1000.0 * i as f32,
1000.0 * i as f32,
50.0,
50.0,
pos_drift,
box_drift,
))
}
let mut iteration = 0;
let ncores = match objects {
10 => 1,
100 => 2,
_ => num_cpus::get(),
};
let mut tracker = Sort::new(
ncores,
10,
1,
Mahalanobis,
DEFAULT_MINIMAL_SORT_CONFIDENCE,
Some(SpatioTemporalConstraints::default().constraints(&[(1, 1.0)])),
1.0 / 20.0,
1.0 / 160.0,
);
let mut count = 0;
b.iter(|| {
count += 1;
let mut observations = Vec::new();
for i in &mut iterators {
iteration += 1;
let b = i.next();
observations.push((b.unwrap().into(), None));
}
let tracks = tracker.predict(&observations);
assert_eq!(tracks.len(), objects);
});
eprintln!("Store stats: {:?}", tracker.active_shard_stats());
assert_eq!(
tracker.active_shard_stats().into_iter().sum::<usize>(),
objects
);
let wasted = tracker.wasted();
assert!(wasted.is_empty());
tracker.skip_epochs(2);
let wasted = tracker.wasted();
assert_eq!(wasted.len(), objects);
for w in wasted {
assert_eq!(w.get_attributes().track_length, count);
}
}
================================================
FILE: benches/simple_sort_maha_tracker_oriented.rs
================================================
#![feature(test)]
extern crate test;
use similari::examples::BoxGen2;
use similari::prelude::Sort;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::PositionalMetricType::Mahalanobis;
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::trackers::tracker_api::TrackerAPI;
use similari::utils::bbox::Universal2DBox;
use test::Bencher;
#[bench]
fn sort_maha_oriented_00010(b: &mut Bencher) {
bench_sort(10, b);
}
#[bench]
fn sort_maha_oriented_00100(b: &mut Bencher) {
bench_sort(100, b);
}
#[bench]
fn sort_maha_oriented_00500(b: &mut Bencher) {
bench_sort(500, b);
}
fn bench_sort(objects: usize, b: &mut Bencher) {
let pos_drift = 1.0;
let box_drift = 0.001;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
1000.0 * i as f32,
1000.0 * i as f32,
50.0,
50.0,
pos_drift,
box_drift,
))
}
let mut iteration = 0;
let ncores = match objects {
10 => 1,
100 => 2,
_ => num_cpus::get(),
};
let mut tracker = Sort::new(
ncores,
10,
1,
Mahalanobis,
DEFAULT_MINIMAL_SORT_CONFIDENCE,
Some(SpatioTemporalConstraints::default().constraints(&[(1, 1.0)])),
1.0 / 20.0,
1.0 / 160.0,
);
let mut count = 0;
b.iter(|| {
count += 1;
let mut observations = Vec::new();
for i in &mut iterators {
iteration += 1;
let b = Universal2DBox::from(i.next().unwrap())
.rotate(tracker.current_epoch() as f32 / 10.0);
observations.push((b, None));
}
let tracks = tracker.predict(&observations);
assert_eq!(tracks.len(), objects);
});
let wasted = tracker.wasted();
assert!(wasted.is_empty());
eprintln!("Store stats: {:?}", tracker.active_shard_stats());
assert_eq!(
tracker.active_shard_stats().into_iter().sum::<usize>(),
objects
);
tracker.skip_epochs(2);
let wasted = tracker.wasted();
assert_eq!(wasted.len(), objects);
for w in wasted {
assert_eq!(w.get_attributes().track_length, count);
}
}
================================================
FILE: benches/simple_visual_sort_tracker.rs
================================================
#![feature(test)]
extern crate test;
use rand::distributions::Uniform;
use rand::Rng;
use similari::examples::BoxGen2;
use similari::prelude::{VisualSort, VisualSortObservation, VisualSortOptions};
use similari::trackers::sort::PositionalMetricType;
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::trackers::tracker_api::TrackerAPI;
use similari::trackers::visual_sort::metric::VisualSortMetricType;
use test::Bencher;
#[bench]
fn visual_sort_iou_00010x3x0128(b: &mut Bencher) {
bench_visual_sort(10, 128, b);
}
#[bench]
fn visual_sort_iou_00050x3x0128(b: &mut Bencher) {
bench_visual_sort(50, 128, b);
}
#[bench]
fn visual_sort_iou_00100x3x0128(b: &mut Bencher) {
bench_visual_sort(100, 128, b);
}
#[bench]
fn visual_sort_iou_00010x3x0256(b: &mut Bencher) {
bench_visual_sort(10, 256, b);
}
#[bench]
fn visual_sort_iou_00050x3x0256(b: &mut Bencher) {
bench_visual_sort(50, 256, b);
}
#[bench]
fn visual_sort_iou_00100x3x0256(b: &mut Bencher) {
bench_visual_sort(100, 256, b);
}
#[bench]
fn visual_sort_iou_00010x3x0512(b: &mut Bencher) {
bench_visual_sort(10, 512, b);
}
#[bench]
fn visual_sort_iou_00050x3x0512(b: &mut Bencher) {
bench_visual_sort(50, 512, b);
}
#[bench]
fn visual_sort_iou_00100x3x0512(b: &mut Bencher) {
bench_visual_sort(100, 512, b);
}
#[bench]
fn visual_sort_iou_00010x3x1024(b: &mut Bencher) {
bench_visual_sort(10, 1024, b);
}
#[bench]
fn visual_sort_iou_00050x3x1024(b: &mut Bencher) {
bench_visual_sort(50, 1024, b);
}
#[bench]
fn visual_sort_iou_00100x3x1024(b: &mut Bencher) {
bench_visual_sort(100, 1024, b);
}
#[bench]
fn visual_sort_iou_00010x3x2048(b: &mut Bencher) {
bench_visual_sort(10, 2048, b);
}
#[bench]
fn visual_sort_iou_00050x3x2048(b: &mut Bencher) {
bench_visual_sort(50, 2048, b);
}
#[bench]
fn visual_sort_iou_00100x3x2048(b: &mut Bencher) {
bench_visual_sort(100, 2048, b);
}
fn bench_visual_sort(objects: usize, len: usize, b: &mut Bencher) {
let pos_drift = 1.0;
let box_drift = 0.001;
let mut iterators = Vec::default();
for i in 0..objects {
iterators.push(BoxGen2::new(
1000.0 * i as f32,
1000.0 * i as f32,
20.0,
50.0,
pos_drift,
box_drift,
))
}
let mut iteration = 0;
//let ncores = num_cpus::get();
let opts = VisualSortOptions::default()
.positional_metric(PositionalMetricType::IoU(0.3))
.visual_metric(VisualSortMetricType::Euclidean(10.0))
.visual_max_observations(3)
.spatio_temporal_constraints(SpatioTemporalConstraints::default().constraints(&[(1, 1.0)]))
.visual_minimal_own_area_percentage_use(0.5)
.visual_minimal_own_area_percentage_collect(0.6)
.kalman_position_weight(1.0 / 20.0)
.kalman_velocity_weight(1.0 / 160.0)
.visual_min_votes(2);
let ncores = match objects {
10 => 1,
50 => 2,
_ => num_cpus::get(),
};
let mut tracker = VisualSort::new(ncores, &opts);
let mut count = 0;
b.iter(|| {
count += 1;
let mut observations = Vec::new();
let mut features = Vec::new();
let mut rng = rand::thread_rng();
let gen = Uniform::new(-0.01, 0.01);
for (index, _) in iterators.iter().enumerate() {
let f = (0..len)
.map(|_| rng.sample(&gen) + index as f32 * 10.0)
.collect::<Vec<f32>>();
features.push(f);
}
for (index, bi) in iterators.iter_mut().enumerate() {
iteration += 1;
let b = bi.next();
let f = &features[index];
observations.push(VisualSortObservation::new(
Some(f),
Some(1.0),
b.unwrap().into(),
Some(0),
));
}
let tracks = tracker.predict(&observations);
assert_eq!(tracks.len(), objects);
});
eprintln!("Store stats: {:?}", tracker.active_shard_stats());
assert_eq!(
tracker.active_shard_stats().into_iter().sum::<usize>(),
objects
);
let wasted = tracker.wasted();
assert!(wasted.is_empty());
tracker.skip_epochs(10);
let wasted = tracker.wasted();
assert_eq!(wasted.len(), objects);
for w in wasted {
assert_eq!(w.get_attributes().track_length, count);
}
}
================================================
FILE: benches/track_search.rs
================================================
#![feature(test)]
extern crate test;
use rand::{distributions::Uniform, Rng};
use similari::examples::{UnboundAttributeUpdate, UnboundAttrs, UnboundMetric};
use similari::track::Feature;
use similari::prelude::TrackStoreBuilder;
use similari::track::notify::NoopNotifier;
use similari::track::utils::FromVec;
use test::Bencher;
fn bench_capacity_len(vec_len: usize, track_len: usize, count: usize, b: &mut Bencher) {
const DEFAULT_FEATURE: u64 = 0;
let mut db = TrackStoreBuilder::new(num_cpus::get())
.metric(UnboundMetric::default())
.default_attributes(UnboundAttrs::default())
.notifier(NoopNotifier)
.build();
let mut rng = rand::thread_rng();
let gen = Uniform::new(0.0, 1.0);
for i in 0..count {
for _j in 0..track_len {
let res = db.add(
i as u64,
DEFAULT_FEATURE,
Some(1.0),
Some(Feature::from_vec(
(0..vec_len).map(|_| rng.sample(&gen)).collect::<Vec<_>>(),
)),
None,
);
assert!(res.is_ok());
}
}
let mut t = db.new_track(count as u64 + 1).build().unwrap();
for _j in 0..track_len {
let _ = t.add_observation(
DEFAULT_FEATURE,
Some(1.0),
Some(Feature::from_vec(
(0..vec_len).map(|_| rng.sample(&gen)).collect::<Vec<_>>(),
)),
Some(UnboundAttributeUpdate),
);
}
b.iter(move || {
let (dists, errs) = db.foreign_track_distances(vec![t.clone()], DEFAULT_FEATURE, true);
dists.all();
errs.all();
});
}
#[bench]
fn track_0256_030_100(b: &mut Bencher) {
bench_capacity_len(256, 30, 100, b);
}
#[bench]
fn track_0512_030_100(b: &mut Bencher) {
bench_capacity_len(512, 30, 100, b);
}
#[bench]
fn track_1024_030_100(b: &mut Bencher) {
bench_capacity_len(1024, 30, 100, b);
}
#[bench]
fn track_0256_030_01k(b: &mut Bencher) {
bench_capacity_len(256, 30, 1000, b);
}
================================================
FILE: build.rs
================================================
fn main() {
#[cfg(feature = "python")]
pyo3_build_config::add_extension_module_link_args();
}
================================================
FILE: docker/Dockerfile.manylinux_2_28_ARM64
================================================
FROM ghcr.io/insight-platform/manylinux_2_28_arm64:v0.0.7 AS builder
WORKDIR /opt
COPY . .
ARG PYTHON_INTERPRETER
RUN chmod +x /opt/docker/build-manylinux.sh
RUN bash /opt/docker/build-manylinux.sh
RUN rm -rf target
FROM alpine:3.18 AS dist
COPY --from=builder /opt/dist /opt/dist
================================================
FILE: docker/Dockerfile.manylinux_2_28_X64
================================================
FROM ghcr.io/insight-platform/manylinux_2_28_x64:v0.0.7 AS builder
WORKDIR /opt
COPY . .
ARG PYTHON_INTERPRETER
RUN chmod +x /opt/docker/build-manylinux.sh
RUN bash /opt/docker/build-manylinux.sh
RUN rm -rf target
FROM alpine:3.18 AS dist
COPY --from=builder /opt/dist /opt/dist
================================================
FILE: docker/build-manylinux.sh
================================================
#!/usr/bin/env bash
set -e
ARGS=-f
if [[ -z $PYTHON_INTERPRETER ]]; then
ARGS=-f
else
ARGS="-i $PYTHON_INTERPRETER"
fi
echo "Additional build args: $ARGS"
maturin build $ARGS --release --out /opt/dist
================================================
FILE: examples/batch_sort_iou_tracker.rs
================================================
use similari::examples::BoxGen2;
use similari::trackers::batch::PredictionBatchRequest;
use similari::trackers::sort::batch_api::BatchSort;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::PositionalMetricType::IoU;
use similari::trackers::sort::DEFAULT_SORT_IOU_THRESHOLD;
use similari::trackers::tracker_api::TrackerAPI;
use similari::utils::bbox::BoundingBox;
fn main() {
let mut tracker = BatchSort::new(
1,
1,
10,
1,
IoU(DEFAULT_SORT_IOU_THRESHOLD),
DEFAULT_MINIMAL_SORT_CONFIDENCE,
None,
1.0 / 20.0,
1.0 / 160.0,
);
let pos_drift = 1.0;
let box_drift = 0.01;
let mut b1 = BoxGen2::new_monotonous(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift);
let mut b2 = BoxGen2::new_monotonous(10.0, 10.0, 12.0, 18.0, pos_drift, box_drift);
for _ in 0..10 {
let obj1b = b1.next().unwrap();
let obj2b = b2.next().unwrap();
let (mut batch, res) = PredictionBatchRequest::new();
batch.add(0, (obj1b.into(), None));
batch.add(0, (obj2b.into(), None));
tracker.predict(batch);
for _ in 0..res.batch_size() {
let predictions = res.get();
//eprintln!("Scene Tracks: {:?}", &predictions);
drop(predictions);
}
}
tracker.skip_epochs(2);
let tracks = tracker.wasted();
for t in tracks {
eprintln!("Track id: {}", t.get_track_id());
eprintln!(
"Boxes: {:#?}",
t.get_attributes()
.predicted_boxes
.clone()
.into_iter()
.map(|x| BoundingBox::try_from(x).unwrap())
.collect::<Vec<_>>()
);
}
}
================================================
FILE: examples/incremental_track_build.rs
================================================
use similari::distance::euclidean;
use similari::examples::{BoxGen2, FeatGen2};
use similari::prelude::*;
use similari::track::{
MetricOutput, MetricQuery, NoopLookup, Observation, ObservationAttributes, ObservationMetric,
ObservationMetricOk, ObservationsDb, TrackAttributes, TrackAttributesUpdate, TrackStatus,
};
use similari::utils::bbox::BoundingBox;
use similari::voting::topn::TopNVoting;
use similari::voting::Voting;
use std::thread;
use std::time::Duration;
const FEAT0: u64 = 0;
const MAX_DIST: f32 = 0.1;
#[derive(Debug, Clone, Default)]
struct BBoxAttributes {
bboxes: Vec<BoundingBox>,
}
#[derive(Clone, Debug)]
struct BBoxAttributesUpdate {
bbox: BoundingBox,
}
impl TrackAttributesUpdate<BBoxAttributes> for BBoxAttributesUpdate {
fn apply(&self, attrs: &mut BBoxAttributes) -> anyhow::Result<()> {
attrs.bboxes.push(self.bbox);
Ok(())
}
}
impl TrackAttributes<BBoxAttributes, f32> for BBoxAttributes {
type Update = BBoxAttributesUpdate;
type Lookup = NoopLookup<BBoxAttributes, f32>;
fn compatible(&self, _other: &BBoxAttributes) -> bool {
true
}
fn merge(&mut self, other: &BBoxAttributes) -> anyhow::Result<()> {
self.bboxes.extend_from_slice(&other.bboxes);
Ok(())
}
fn baked(&self, _observations: &ObservationsDb<f32>) -> anyhow::Result<TrackStatus> {
Ok(TrackStatus::Ready)
}
}
#[derive(Clone, Default)]
pub struct TrackMetric;
impl ObservationMetric<BBoxAttributes, f32> for TrackMetric {
fn metric(&self, mq: &MetricQuery<BBoxAttributes, f32>) -> MetricOutput<f32> {
let (e1, e2) = (mq.candidate_observation, mq.track_observation);
Some((
f32::calculate_metric_object(&e1.attr().as_ref(), &e2.attr().as_ref()),
match (e1.feature().as_ref(), e2.feature().as_ref()) {
(Some(x), Some(y)) => Some(euclidean(x, y)),
_ => None,
},
))
}
fn optimize(
&mut self,
_feature_class: u64,
_merge_history: &[u64],
_attrs: &mut BBoxAttributes,
observations: &mut Vec<Observation<f32>>,
_prev_length: usize,
_is_merge: bool,
) -> anyhow::Result<()> {
observations.reverse();
observations.truncate(5);
observations.reverse();
Ok(())
}
fn postprocess_distances(
&self,
unfiltered: Vec<ObservationMetricOk<f32>>,
) -> Vec<ObservationMetricOk<f32>> {
unfiltered
.into_iter()
.filter(|r| r.feature_distance.unwrap() < MAX_DIST)
.collect()
}
}
fn main() {
let mut store = TrackStoreBuilder::default()
.default_attributes(BBoxAttributes::default())
.metric(TrackMetric::default())
.notifier(NoopNotifier)
.build();
let voting: TopNVoting<f32> = TopNVoting::new(1, MAX_DIST, 1);
let feature_drift = 0.01;
let pos_drift = 5.0;
let box_drift = 2.0;
let mut p1 = FeatGen2::new(0.0, 0.0, feature_drift);
let mut b1 = BoxGen2::new(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift);
let mut p2 = FeatGen2::new(1.0, 1.0, feature_drift);
let mut b2 = BoxGen2::new(10.0, 10.0, 12.0, 18.0, pos_drift, box_drift);
for _ in 0..10 {
let (obj1f, obj1b) = (p1.next().unwrap(), b1.next().unwrap());
let obj1t = store
.new_track_random_id()
.observation(
ObservationBuilder::new(FEAT0)
.observation_attributes(obj1f.attr().unwrap())
.observation(obj1f.feature().as_ref().unwrap().clone())
.track_attributes_update(BBoxAttributesUpdate { bbox: obj1b })
.build(),
)
.build()
.unwrap();
let (obj2f, obj2b) = (p2.next().unwrap(), b2.next().unwrap());
let obj2t = store
.new_track_random_id()
.observation(
ObservationBuilder::new(FEAT0)
.observation_attributes(obj2f.attr().unwrap())
.observation(obj2f.feature().as_ref().unwrap().clone())
.track_attributes_update(BBoxAttributesUpdate { bbox: obj2b })
.build(),
)
.build()
.unwrap();
thread::sleep(Duration::from_millis(2));
for t in [obj1t, obj2t] {
let search_track = t.clone();
let (dists, errs) = store.foreign_track_distances(vec![search_track], FEAT0, false);
assert!(errs.all().is_empty());
let winners = voting.winners(dists);
if winners.is_empty() {
store.add_track(t).unwrap();
} else {
store
.merge_external(
winners.get(&t.get_track_id()).unwrap()[0].winner_track,
&t,
None,
false,
)
.unwrap();
}
}
}
let tracks = store.find_usable();
for (t, _) in tracks {
let t = store.fetch_tracks(&[t]);
eprintln!("Track id: {}", t[0].get_track_id());
eprintln!("Boxes: {:#?}", t[0].get_attributes());
}
}
================================================
FILE: examples/middleware_sort_tracker.rs
================================================
use similari::examples::{current_time_ms, BoxGen2};
use similari::prelude::{NoopNotifier, ObservationBuilder, TrackStoreBuilder};
use similari::trackers::sort::metric::SortMetric;
use similari::trackers::sort::voting::SortVoting;
use similari::trackers::sort::{SortAttributes, SortAttributesOptions, DEFAULT_SORT_IOU_THRESHOLD};
use similari::trackers::spatio_temporal_constraints::SpatioTemporalConstraints;
use similari::voting::Voting;
use std::sync::Arc;
use std::thread;
use std::time::Duration;
const FEAT0: u64 = 0;
const BBOX_HISTORY: usize = 100;
fn main() {
let mut store = TrackStoreBuilder::default()
.default_attributes(SortAttributes::new(Arc::new(SortAttributesOptions::new(
None,
0,
BBOX_HISTORY,
SpatioTemporalConstraints::default(),
1.0 / 20.0,
1.0 / 160.0,
))))
.metric(SortMetric::default())
.notifier(NoopNotifier)
.build();
let pos_drift = 1.0;
let box_drift = 0.2;
let mut b1 = BoxGen2::new_monotonous(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift);
let mut b2 = BoxGen2::new_monotonous(10.0, 10.0, 12.0, 18.0, pos_drift, box_drift);
for _ in 0..10 {
let obj1b = b1.next().unwrap();
let obj2b = b2.next().unwrap();
let track_id = u64::try_from(current_time_ms()).unwrap();
let obj1t = store
.new_track(track_id)
.observation(
ObservationBuilder::new(FEAT0)
.observation_attributes(obj1b.into())
.build(),
)
.build()
.unwrap();
let obj2t = store
.new_track(track_id + 1)
.observation(
ObservationBuilder::new(FEAT0)
.observation_attributes(obj2b.into())
.build(),
)
.build()
.unwrap();
thread::sleep(Duration::from_millis(2));
for t in [obj1t, obj2t] {
let search_track = t.clone();
let (dists, errs) = store.foreign_track_distances(vec![search_track], FEAT0, false);
assert!(errs.all().is_empty());
let voting = SortVoting::new(
DEFAULT_SORT_IOU_THRESHOLD,
1,
store.shard_stats().iter().sum(),
);
let dists = dists.all();
let mut winners = voting.winners(dists);
if winners.is_empty() {
store.add_track(t).unwrap();
} else {
let winner = winners.get_mut(&t.get_track_id()).unwrap().pop().unwrap();
if winner == t.get_track_id() {
store.add_track(t).unwrap();
} else {
store.merge_external(winner, &t, None, false).unwrap();
}
}
}
}
let tracks = store.find_usable();
for (t, _) in tracks {
let t = store.fetch_tracks(&[t]);
eprintln!("Track id: {}", t[0].get_track_id());
eprintln!("Boxes: {:#?}", t[0].get_attributes().predicted_boxes);
}
}
================================================
FILE: examples/simple.rs
================================================
use similari::examples::{vec2, SimpleAttributeUpdate, SimpleAttrs, SimpleMetric};
use similari::store;
use similari::track::notify::NoopNotifier;
use similari::track::Track;
use similari::voting::topn::TopNVoting;
use similari::voting::Voting;
fn main() {
const DEFAULT_FEATURE: u64 = 0;
let mut db = store::TrackStore::new(
SimpleMetric::default(),
SimpleAttrs::default(),
NoopNotifier,
num_cpus::get(),
);
let res = db.add(
0,
DEFAULT_FEATURE,
Some(1.0),
Some(vec2(1.0, 0.0)),
Some(SimpleAttributeUpdate {}),
);
assert!(res.is_ok());
let res = db.add(
0,
DEFAULT_FEATURE,
Some(1.0),
Some(vec2(1.0, 0.0)),
Some(SimpleAttributeUpdate {}),
);
// attribute implementation prevents secondary observations to be added to the same track
assert!(res.is_err());
let baked = db.find_usable();
assert_eq!(
baked
.into_iter()
.filter(|(_b, r)| r.is_ok())
.map(|(x, _)| x)
.collect::<Vec<_>>(),
vec![0u64]
);
let res = db.add(
1,
DEFAULT_FEATURE,
Some(0.9),
Some(vec2(0.9, 0.1)),
Some(SimpleAttributeUpdate {}),
);
assert!(res.is_ok());
let mut ext_track = Track::new(
2,
SimpleMetric::default(),
SimpleAttrs::default(),
NoopNotifier,
);
let res = ext_track.add_observation(
DEFAULT_FEATURE,
Some(0.8),
Some(vec2(0.66, 0.33)),
Some(SimpleAttributeUpdate {}),
);
assert!(res.is_ok());
let (dists, errs) = db.foreign_track_distances(vec![ext_track], 0, true);
let dists = dists.all();
let errs = errs.all();
assert_eq!(errs.len(), 0);
eprintln!("Distances: {:?}", &dists);
eprintln!("Errs: {:?}", &errs);
let top1_voting_engine: TopNVoting<f32> = TopNVoting::new(2, 1.0, 1);
let results = top1_voting_engine.winners(dists.clone());
eprintln!(
"Voting results (the less distance, the better result): {:?}",
&results
);
// max distance filter set to 0.4
let top1_voting_engine_filter: TopNVoting<f32> = TopNVoting::new(2, 0.4, 1);
let results = top1_voting_engine_filter.winners(dists);
eprintln!(
"Voting results (the less distance, the better result): {:?}",
&results
);
}
================================================
FILE: examples/simple_sort_iou_tracker.rs
================================================
use similari::examples::BoxGen2;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::simple_api::Sort;
use similari::trackers::sort::PositionalMetricType::IoU;
use similari::trackers::sort::DEFAULT_SORT_IOU_THRESHOLD;
use similari::trackers::tracker_api::TrackerAPI;
use similari::utils::bbox::BoundingBox;
fn main() {
let mut tracker = Sort::new(
1,
10,
1,
IoU(DEFAULT_SORT_IOU_THRESHOLD),
DEFAULT_MINIMAL_SORT_CONFIDENCE,
None,
1.0 / 20.0,
1.0 / 160.0,
);
let pos_drift = 1.0;
let box_drift = 0.01;
let mut b1 = BoxGen2::new_monotonous(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift);
let mut b2 = BoxGen2::new_monotonous(10.0, 10.0, 12.0, 18.0, pos_drift, box_drift);
for _ in 0..100 {
let obj1b = b1.next().unwrap();
let obj2b = b2.next().unwrap();
let _tracks = tracker.predict(&[(obj1b.into(), None), (obj2b.into(), None)]);
}
tracker.skip_epochs(2);
let tracks = tracker.wasted();
for t in tracks {
eprintln!("Track id: {}", t.get_track_id());
eprintln!(
"Boxes: {:#?}",
t.get_attributes()
.predicted_boxes
.clone()
.into_iter()
.map(|x| BoundingBox::try_from(x).unwrap())
.collect::<Vec<_>>()
);
}
}
================================================
FILE: examples/simple_sort_iou_tracker_oriented.rs
================================================
use similari::examples::BoxGen2;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::simple_api::Sort;
use similari::trackers::sort::PositionalMetricType::IoU;
use similari::trackers::sort::DEFAULT_SORT_IOU_THRESHOLD;
use similari::trackers::tracker_api::TrackerAPI;
use similari::utils::bbox::Universal2DBox;
fn main() {
let mut tracker = Sort::new(
1,
10,
1,
IoU(DEFAULT_SORT_IOU_THRESHOLD),
DEFAULT_MINIMAL_SORT_CONFIDENCE,
None,
1.0 / 20.0,
1.0 / 160.0,
);
let pos_drift = 1.0;
let box_drift = 0.1;
let mut b1 = BoxGen2::new_monotonous(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift);
let mut b2 = BoxGen2::new_monotonous(10.0, 10.0, 12.0, 18.0, pos_drift, box_drift);
for i in 0..30 {
let obj1b = Universal2DBox::from(b1.next().unwrap()).rotate(0.35 + (i as f32 / 10.0));
let obj2b = Universal2DBox::from(b2.next().unwrap()).rotate(0.55 + (i as f32 / 10.0));
let _tracks = tracker.predict(&[(obj1b, None), (obj2b, None)]);
}
tracker.skip_epochs(2);
let tracks = tracker.wasted();
for t in tracks {
eprintln!("Track id: {}", t.get_track_id());
eprintln!("Boxes: {:#?}", t.get_attributes().predicted_boxes);
}
}
================================================
FILE: examples/simple_sort_maha_tracker.rs
================================================
use similari::examples::BoxGen2;
use similari::prelude::Sort;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::PositionalMetricType::Mahalanobis;
use similari::trackers::tracker_api::TrackerAPI;
use similari::utils::bbox::BoundingBox;
fn main() {
let mut tracker = Sort::new(
1,
10,
1,
Mahalanobis,
DEFAULT_MINIMAL_SORT_CONFIDENCE,
None,
1.0 / 20.0,
1.0 / 160.0,
);
let pos_drift = 1.0;
let box_drift = 0.2;
let mut b1 = BoxGen2::new_monotonous(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift);
let mut b2 = BoxGen2::new_monotonous(10.0, 10.0, 12.0, 18.0, pos_drift, box_drift);
for _ in 0..10 {
let obj1b = b1.next().unwrap();
let obj2b = b2.next().unwrap();
let _tracks = tracker.predict(&[(obj1b.into(), None), (obj2b.into(), None)]);
//eprintln!("Tracked objects: {:#?}", _tracks);
}
tracker.skip_epochs(2);
let tracks = tracker.wasted();
for t in tracks {
eprintln!("Track id: {}", t.get_track_id());
eprintln!(
"Boxes: {:#?}",
t.get_attributes()
.predicted_boxes
.iter()
.map(|x| BoundingBox::try_from(x))
.collect::<Vec<_>>()
);
}
}
================================================
FILE: examples/simple_sort_maha_tracker_oriented.rs
================================================
use similari::examples::BoxGen2;
use similari::prelude::Sort;
use similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;
use similari::trackers::sort::PositionalMetricType::Mahalanobis;
use similari::trackers::tracker_api::TrackerAPI;
use similari::utils::bbox::Universal2DBox;
fn main() {
let mut tracker = Sort::new(
1,
10,
1,
Mahalanobis,
DEFAULT_MINIMAL_SORT_CONFIDENCE,
None,
1.0 / 20.0,
1.0 / 160.0,
);
let pos_drift = 1.0;
let box_drift = 0.1;
let mut b1 = BoxGen2::new_monotonous(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift);
let mut b2 = BoxGen2::new_monotonous(10.0, 10.0, 12.0, 18.0, pos_drift, box_drift);
for i in 0..30 {
let obj1b = Universal2DBox::from(b1.next().unwrap()).rotate(0.35 + (i as f32 / 10.0));
let obj2b = Universal2DBox::from(b2.next().unwrap()).rotate(0.55 + (i as f32 / 10.0));
let _tracks = tracker.predict(&[(obj1b, None), (obj2b, None)]);
}
tracker.skip_epochs(2);
let tracks = tracker.wasted();
for t in tracks {
eprintln!("Track id: {}", t.get_track_id());
eprintln!("Boxes: {:#?}", t.get_attributes().predicted_boxes);
}
}
================================================
FILE: examples/track_merging.rs
================================================
use crate::Gender::{Female, Male};
use anyhow::Result;
use itertools::Itertools;
use once_cell::sync::OnceCell;
use similari::distance::euclidean;
use similari::examples::current_time_ms;
use similari::examples::FeatGen2;
use similari::store::TrackStore;
use similari::track::notify::NoopNotifier;
use similari::track::{
MetricOutput, MetricQuery, NoopLookup, Observation, ObservationAttributes, ObservationMetric,
ObservationsDb, TrackAttributes, TrackAttributesUpdate, TrackStatus,
};
use similari::voting::topn::TopNVoting;
use similari::voting::Voting;
use std::cmp::{max, min};
use std::thread;
use std::time::Duration;
use thiserror::Error;
const FEATURE0: u64 = 0;
#[derive(Debug, Error)]
enum AppErrors {
#[error("Cam id passed ({0}) != id set ({1})")]
WrongCamID(u64, u64),
#[error("Time passed {0} < time set {1}")]
WrongTime(u128, u128),
#[error("Incompatible attributes")]
IncompatibleAttributes,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
enum Gender {
Female,
Male,
#[default]
Unknown,
}
// person attributes
#[derive(Debug, Clone, Default)]
struct CamTrackingAttributes {
start_time: u128, // when the track observation first appeared
end_time: u128, // when the track observation last appeared
baked_period_ms: u128,
camera_id: OnceCell<u64>, // identifier of camera that detected the object
age: Vec<u8>, // age detected during the observations
gender: Vec<Gender>, // gender detected during the observations
screen_pos: Vec<(u16, u16)>, // person screen position
}
impl CamTrackingAttributes {
// calculate age as average over observations
pub fn get_age(&self) -> Option<u8> {
if self.age.is_empty() {
return None;
}
u8::try_from(self.age.iter().map(|e| *e as u32).sum::<u32>() / self.age.len() as u32).ok()
}
// calculate gender as most frequent gender
pub fn get_gender(&self) -> Gender {
if self.gender.is_empty() {
return Gender::Unknown;
}
let groups = self.gender.clone();
let mut groups = groups.into_iter().counts().into_iter().collect::<Vec<_>>();
groups.sort_by(|(_, l), (_, r)| r.partial_cmp(l).unwrap());
groups[0].0
}
}
#[test]
fn test_attributes_age_gender() {
use Gender::*;
let attrs = CamTrackingAttributes {
screen_pos: vec![(0, 0), (10, 15), (20, 25), (30, 35)],
start_time: 0,
end_time: 0,
baked_period_ms: 10,
camera_id: Default::default(),
age: vec![17, 24, 36],
gender: vec![Male, Female, Female, Unknown],
};
assert_eq!(attrs.get_age(), Some(25));
assert_eq!(attrs.get_gender(), Female);
}
// update
#[derive(Clone, Debug)]
enum CamTrackingAttributesUpdate {
DataUpdate {
time: u128,
gender: Option<Gender>,
age: Option<u8>,
camera_id: u64,
screen_pos: (u16, u16),
},
BakedPeriodUpdate(u128),
}
impl TrackAttributesUpdate<CamTrackingAttributes> for CamTrackingAttributesUpdate {
fn apply(&self, attrs: &mut CamTrackingAttributes) -> Result<()> {
match self {
CamTrackingAttributesUpdate::DataUpdate {
time,
gender,
age,
camera_id,
screen_pos,
} => {
// initially, track start time is set to end time
if attrs.start_time == 0 {
attrs.start_time = *time;
}
// if future track observation is submited with older timestamp
// then it's incorrect situation, timestamp should increase.
if attrs.end_time > *time {
return Err(AppErrors::WrongTime(*time, attrs.end_time).into());
}
attrs.end_time = *time;
// update may be without the gender, if observer cannot determine the
// gender within the observation
if let Some(gender) = gender {
attrs.gender.push(*gender);
}
// same for age
if let Some(age) = age {
attrs.age.push(*age);
}
// track with <id> always goes from the same camera. If camera id changed
// it's a wrong case.
if let Err(_r) = attrs.camera_id.set(*camera_id) {
if *camera_id != *attrs.camera_id.get().unwrap() {
return Err(AppErrors::WrongCamID(
*camera_id,
*attrs.camera_id.get().unwrap(),
)
.into());
}
}
attrs.screen_pos.push(*screen_pos);
}
CamTrackingAttributesUpdate::BakedPeriodUpdate(p) => {
attrs.baked_period_ms = *p;
}
}
Ok(())
}
}
#[test]
fn cam_tracking_attributes_update_test() {
use Gender::*;
let mut attrs = CamTrackingAttributes {
start_time: 0,
end_time: 0,
baked_period_ms: 10,
camera_id: Default::default(),
age: Vec::default(),
gender: Vec::default(),
screen_pos: Vec::default(),
};
let update = CamTrackingAttributesUpdate::DataUpdate {
time: 10,
gender: Some(Female),
age: Some(30),
camera_id: 10,
screen_pos: (10, 10),
};
assert!(update.apply(&mut attrs).is_ok());
// incorrect cam id
let update = CamTrackingAttributesUpdate::DataUpdate {
time: 20,
gender: Some(Female),
age: Some(10),
camera_id: 20,
screen_pos: (10, 15),
};
assert!(update.apply(&mut attrs).is_err());
// incorrect time
let update = CamTrackingAttributesUpdate::DataUpdate {
time: 5,
gender: Some(Female),
age: Some(10),
camera_id: 20,
screen_pos: (20, 25),
};
assert!(update.apply(&mut attrs).is_err());
}
#[test]
fn feat_gen() {
use similari::examples::FeatGen2;
use std::ops::Sub;
use ultraviolet::f32x8;
let drift = 0.01;
let mut gen = FeatGen2::new(0.0, 0.0, drift);
let v1 = gen.next().unwrap().feature().unwrap()[0];
let v2 = gen.next().unwrap().feature().unwrap()[0];
assert!(v1.sub(v2).abs().reduce_add() <= 2.0 * f32x8::splat(drift).reduce_add());
}
impl TrackAttributes<CamTrackingAttributes, f32> for CamTrackingAttributes {
type Update = CamTrackingAttributesUpdate;
type Lookup = NoopLookup<CamTrackingAttributes, f32>;
fn compatible(&self, other: &CamTrackingAttributes) -> bool {
(self.start_time >= other.end_time || self.end_time <= other.start_time)
&& self.camera_id.get().unwrap() == other.camera_id.get().unwrap()
}
fn merge(&mut self, other: &CamTrackingAttributes) -> Result<()> {
if self.compatible(other) {
self.start_time = min(self.start_time, other.start_time);
self.end_time = max(self.end_time, other.end_time);
self.screen_pos.extend_from_slice(&other.screen_pos);
self.age.extend_from_slice(&other.age);
self.gender.extend_from_slice(&other.gender);
Ok(())
} else {
Err(AppErrors::IncompatibleAttributes.into())
}
}
fn baked(&self, _observations: &ObservationsDb<f32>) -> Result<TrackStatus> {
let now = current_time_ms();
if now > self.end_time + self.baked_period_ms {
Ok(TrackStatus::Ready)
} else {
Ok(TrackStatus::Pending)
}
}
}
#[derive(Clone)]
pub struct CamTrackingAttributesMetric {
merge_extension: f32,
initial_capacity: u64,
max_capacity: u64,
}
impl Default for CamTrackingAttributesMetric {
fn default() -> Self {
Self {
merge_extension: 1.5,
initial_capacity: 4,
max_capacity: 12,
}
}
}
impl ObservationMetric<CamTrackingAttributes, f32> for CamTrackingAttributesMetric {
fn metric(&self, mq: &MetricQuery<CamTrackingAttributes, f32>) -> MetricOutput<f32> {
let (e1, e2) = (mq.candidate_observation, mq.track_observation);
Some((
f32::calculate_metric_object(&e1.attr().as_ref(), &e2.attr().as_ref()),
match (e1.feature().as_ref(), e2.feature().as_ref()) {
(Some(x), Some(y)) => Some(euclidean(x, y)),
_ => None,
},
))
}
fn optimize(
&mut self,
_feature_class: u64,
merge_history: &[u64],
_attrs: &mut CamTrackingAttributes,
features: &mut Vec<Observation<f32>>,
_prev_length: usize,
_is_merge: bool,
) -> Result<()> {
let merges = merge_history.len();
let mut current_capacity =
(self.initial_capacity as f32 * self.merge_extension.powf(merges as f32)) as u64;
if current_capacity > self.max_capacity {
current_capacity = self.max_capacity
}
features.sort_by(|l, r| r.attr().partial_cmp(l.attr()).unwrap());
features.truncate(current_capacity as usize);
Ok(())
}
}
struct TrackObservation {
pub track_id: u64,
pub age: Option<u8>,
pub gender: Option<Gender>,
pub camera_id: u64,
pub screen_pos: (u16, u16),
pub class: u64,
pub feature: Observation<f32>,
}
impl TrackObservation {
pub fn new(
track_id: u64,
age: Option<u8>,
gender: Option<Gender>,
camera_id: u64,
screen_pos: (u16, u16),
feature: Observation<f32>,
) -> Self {
Self {
track_id,
age,
gender,
camera_id,
screen_pos,
feature,
class: FEATURE0,
}
}
}
fn main() {
let drift = 0.01;
let mut p1 = FeatGen2::new(1.0, 0.0, drift);
let mut p2 = FeatGen2::new(1.0, 1.0, drift);
let m = Some(Male);
let f = Some(Female);
let observations = vec![
// track 1 (person 1)
TrackObservation::new(1, Some(13), f, 1, (30, 30), p1.next().unwrap()),
TrackObservation::new(1, Some(17), m, 1, (35, 30), p1.next().unwrap()),
TrackObservation::new(1, Some(23), m, 1, (35, 35), p1.next().unwrap()),
TrackObservation::new(1, None, None, 1, (40, 35), p1.next().unwrap()),
TrackObservation::new(1, Some(18), m, 1, (40, 40), p1.next().unwrap()),
// track 2 (person 2)
TrackObservation::new(2, Some(46), f, 1, (100, 100), p2.next().unwrap()),
TrackObservation::new(2, Some(30), f, 1, (135, 130), p2.next().unwrap()),
TrackObservation::new(2, Some(40), f, 1, (135, 135), p2.next().unwrap()),
TrackObservation::new(2, None, None, 1, (140, 135), p2.next().unwrap()),
TrackObservation::new(2, Some(54), m, 1, (140, 140), p2.next().unwrap()),
// track 3 (person 1)
TrackObservation::new(3, Some(18), f, 1, (50, 40), p1.next().unwrap()),
TrackObservation::new(3, Some(17), m, 1, (55, 50), p1.next().unwrap()),
TrackObservation::new(3, Some(20), m, 1, (65, 55), p1.next().unwrap()),
TrackObservation::new(3, Some(17), None, 1, (70, 50), p1.next().unwrap()),
TrackObservation::new(3, None, m, 1, (75, 55), p1.next().unwrap()),
// track 4 (person 2)
TrackObservation::new(4, Some(48), f, 1, (150, 140), p2.next().unwrap()),
TrackObservation::new(4, Some(47), f, 1, (155, 150), p2.next().unwrap()),
TrackObservation::new(4, Some(30), m, 1, (165, 155), p2.next().unwrap()),
TrackObservation::new(4, Some(57), None, 1, (170, 150), p2.next().unwrap()),
TrackObservation::new(4, None, f, 1, (175, 155), p2.next().unwrap()),
// track 5 (person 1)
TrackObservation::new(5, None, None, 1, (80, 55), p1.next().unwrap()),
TrackObservation::new(5, None, None, 1, (85, 60), p1.next().unwrap()),
TrackObservation::new(5, None, None, 1, (90, 65), p1.next().unwrap()),
TrackObservation::new(5, None, None, 1, (90, 50), p1.next().unwrap()),
TrackObservation::new(5, None, m, 1, (90, 50), p1.next().unwrap()),
];
// collect tracks here until they are initially ready
let mut temp_store = TrackStore::new(
CamTrackingAttributesMetric::default(),
CamTrackingAttributes {
baked_period_ms: 20,
..Default::default()
},
NoopNotifier,
1,
);
// merge tracks here until they are initially complete
let merge_store_baked_period_ms = 60;
let mut merge_store: TrackStore<CamTrackingAttributes, CamTrackingAttributesMetric, f32> =
TrackStore::new(
CamTrackingAttributesMetric::default(),
CamTrackingAttributes {
baked_period_ms: merge_store_baked_period_ms,
..Default::default()
},
NoopNotifier,
1,
);
let voting_machine: TopNVoting<f32> = TopNVoting::new(1, 0.1, 3);
let mut idx = 0;
loop {
if let Some(TrackObservation {
track_id,
age,
gender,
camera_id,
screen_pos,
class,
feature,
}) = observations.get(idx)
{
let update = CamTrackingAttributesUpdate::DataUpdate {
time: current_time_ms(),
gender: *gender,
age: *age,
camera_id: *camera_id,
screen_pos: *screen_pos,
};
temp_store
.add(
*track_id,
*class,
*feature.attr(),
feature.feature().clone(),
Some(update),
)
.unwrap();
}
idx += 1;
thread::sleep(Duration::from_millis(1));
let baked = temp_store.find_usable();
for (id, s) in baked {
let mut track = temp_store.fetch_tracks(&[id]).pop().unwrap();
if let Ok(TrackStatus::Ready) = s {
let search_track = track.clone();
track
.add_observation(
0,
None,
None,
Some(CamTrackingAttributesUpdate::BakedPeriodUpdate(0)),
)
.unwrap();
let (dists, _errs) =
merge_store.foreign_track_distances(vec![search_track], FEATURE0, false);
let dists = dists.all();
let mut winners = voting_machine.winners(dists);
if winners.is_empty() {
let _track_id = merge_store.add_track(track).unwrap();
} else {
let winner = winners
.get_mut(&track.get_track_id())
.unwrap()
.pop()
.unwrap();
merge_store
.merge_external(winner.winner_track, &track, Some(&[FEATURE0]), true)
.unwrap();
}
}
}
if idx > 100 {
break;
}
}
let baked = merge_store.find_usable();
for (id, s) in baked {
if let Ok(TrackStatus::Ready) = s {
let track = merge_store.fetch_tracks(&[id]).pop().unwrap();
eprintln!(
"Composite Track is ready: {}, age: {:?}, gender: {:?}\nCoordinates: {:?}",
track.get_track_id(),
track.get_attributes().get_age(),
track.get_attributes().get_gender(),
track.get_attributes().screen_pos
);
eprintln!("Merge history: {:?}", track.get_merge_history());
}
}
}
================================================
FILE: pyproject.toml
================================================
[build-system]
requires = ["maturin>=1.8,<1.9"]
build-backend = "maturin"
[project]
name = "similari-trackers-rs"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
[tool.black]
skip-string-normalization = true
[tool.pylint.messages_control]
max-line-length = 88
[tool.maturin]
python-source = "python"
================================================
FILE: python/bb.py
================================================
from similari import nms, BoundingBox, Universal2DBox
if __name__ == '__main__':
bb = BoundingBox(left=1.0, top=2.0, width=10.0, height=15.0)
print(bb)
bb = BoundingBox(1.0, 2.0, 10.0, 15.0)
print(bb.left, bb.top, bb.width, bb.height)
bb = BoundingBox.new_with_confidence(1.0, 2.0, 10.0, 15.0, 0.95)
universal_bb = bb.as_xyaah()
print(universal_bb)
ubb = Universal2DBox(xc=3.0, yc=4.0, angle=0.0, aspect=1.5, height=5.0)
print(ubb)
ubb = Universal2DBox.new_with_confidence(xc=3.0, yc=4.0, angle=0.0, aspect=1.5, height=5.0, confidence=0.85)
print(ubb)
ubb = Universal2DBox(3.0, 4.0, 0.0, 1.5, 5.0)
print(ubb)
ubb.rotate(0.5)
polygon = ubb.get_vertices()
points = polygon.get_points()
print("Points", points)
print(ubb)
print(ubb.area())
print(ubb.get_radius())
================================================
FILE: python/bugfixes/bug_vs_1/bug_visual_sort.py
================================================
import pathlib
import collections
import json
from similari import (
VisualSort,
SpatioTemporalConstraints,
PositionalMetricType,
VisualSortOptions,
VisualSortMetricType,
Universal2DBox, VisualSortObservation, VisualSortObservationSet
)
def main():
data_dir_path = pathlib.Path('.') / 'in'
out_dir_path = pathlib.Path('.') / 'out'
log_file_path = out_dir_path / 'log.txt'
constraints = SpatioTemporalConstraints()
constraints.add_constraints([(1, 1.0)])
opts = VisualSortOptions()
opts.spatio_temporal_constraints(constraints)
opts.max_idle_epochs(3)
opts.kept_history_length(10)
# opts.visual_metric(VisualSortMetricType.cosine(0.2))
opts.visual_metric(VisualSortMetricType.euclidean(1.0))
opts.positional_metric(PositionalMetricType.maha())
opts.visual_minimal_track_length(1)
opts.visual_minimal_area(5.0)
opts.visual_minimal_quality_use(0.45)
opts.visual_minimal_quality_collect(0.5)
opts.visual_max_observations(5)
opts.visual_min_votes(1)
tracker = VisualSort(shards=4, opts=opts)
with open(log_file_path, 'w', encoding='utf8') as log_file:
for filepath in sorted(data_dir_path.glob('*.json')):
with open(filepath, 'r', encoding='utf8') as objfile:
objs = json.load(objfile)
observation_set = VisualSortObservationSet()
for obj in objs:
bbox = Universal2DBox.new_with_confidence(
xc=obj['bbox']['xc'],
yc=obj['bbox']['yc'],
angle=obj['bbox']['angle'],
aspect=obj['bbox']['aspect'],
height=obj['bbox']['height'],
confidence=obj['bbox']['confidence']
)
observation = VisualSortObservation(
feature=obj['feature'],
feature_quality=obj['feature_quality'],
bounding_box=bbox,
custom_object_id=None,
)
observation_set.add(observation)
tracks = tracker.predict(observation_set)
log_file.write(f'===={filepath.name}====\n')
for track in tracks:
log_file.write(str(track) + '\n')
count = collections.Counter((track.id for track in tracks))
trk_id, id_count = count.most_common(1)[0]
assert id_count == 1, f'{filepath.name} trk id {trk_id} count {id_count}'
if __name__ == '__main__':
main()
================================================
FILE: python/bugfixes/bug_vs_1/in/fixed-1/bug_vs_1.json
================================================
[{"bbox": {"xc": 305.5, "yc": 933.5, "angle": null, "aspect": 0.467576801776886, "height": 293.0, "confidence": 0.92041015625}, "feature": [0.0, 0.04798045472202683, 0.0, 0.010914579055066775, 0.0, 0.02977623176387587, 0.0, 0.0, 0.0, 0.0, 0.016284260035054694, 0.001173857471064838, 0.024717401498412485, 0.040369157426764106, 0.04385612708360236, 0.0, 0.00763728408010481, 0.010529785203135526, 0.022386300025399663, 0.0, 0.07306464790025802, 0.032678640495372016, 0.045982797731782876, 0.10017310160950363, 0.033819562226336475, 0.05667408136239487, 0.06454582489371787, 0.0, 0.08559382983784407, 0.015917139647805265, 0.04438150921819147, 0.0, 0.13213185679705566, 0.0, 0.11380987411551315, 0.0, 0.0, 0.07089769856593077, 0.0, 0.04676114027745912, 0.035688762185164216, 0.0, 0.0, 0.0, 0.0, 0.0, 0.012307968708633292, 0.05840991314882036, 0.0, 0.05707684073613281, 0.04391609614657561, 0.0036140039119275363, 0.0, 0.0017013437054403237, 0.09755632474613003, 0.0, 0.02079875537650801, 0.0681918752031675, 0.07608407418645195, 0.04258694989790395, 0.08175267620640501, 0.05978065291336169, 0.08315479779534411, 0.03736043532052716, 0.018018025660486985, 0.0, 0.023677018428370816, 0.03757923535590306, 0.0, 0.0, 0.05291462126273113, 0.035643801422443104, 0.1332258592645793, 0.055302516965971556, 0.0, 0.04317316237765416, 0.08369497749092662, 0.0, 0.0, 0.05152964285436086, 0.0, 0.02019598153979461, 0.033465479040076816, 0.024514141192723767, 0.03393330874123572, 0.028203438863095284, 0.0, 0.0023781261060830186, 0.010773334502869502, 0.0, 0.06717414660343925, 0.0, 0.019005050466475992, 0.0, 0.05265358404048878, 0.05566288567968723, 0.01563373428576407, 0.0904854545360144, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.034273293012957555, 0.0, 0.09738356436685418, 0.0, 0.029846648454665038, 0.0, 0.07898508333439283, 0.0, 0.02090804658860042, 0.027124174399818016, 0.01718084792067523, 0.03770993721855356, 0.03183878270194381, 0.0, 0.030255938454779474, 0.05970738895193555, 0.0, 0.08853050889596904, 0.0, 0.004265377199541311, 0.051174954938054414, 0.05758486895089437, 0.050563921038656465, 0.08013234785891624, 0.014568835597064218, 0.06197623071785851, 0.0, 0.02126713941354314, 0.0, 0.0, 0.02587417677730811, 0.036736351621596795, 0.0, 0.0, 0.06412660495135786, 0.0, 0.03523902857252665, 0.019936962375019008, 0.10404500484756425, 0.016100485093544045, 0.0023240647574518094, 0.03967828541732531, 0.06631066539723629, 0.18366813335677828, 0.029498974490643697, 0.0, 0.0, 0.0, 0.051570004003695796, 0.0048893048483412286, 0.008482605059751165, 0.10117455289213914, 0.0, 0.01254778425845717, 0.021502819205414452, 0.01537549966659841, 0.030642212062810065, 0.024482248554688, 0.06710612821704018, 0.0, 0.04890353390685614, 0.0, 0.028633729488470937, 0.0, 0.0, 0.0, 0.09452611410743503, 0.07160461424676241, 0.012649880557379263, 0.05839732376875539, 0.0, 0.009919679014604808, 0.08434665657952996, 0.14412301224452886, 0.0, 0.08173372799827229, 0.01512453898782509, 0.0, 0.0, 0.0, 0.0, 0.041593896116599985, 0.0, 0.031920918328033634, 0.07112939263703916, 0.01776808546366762, 0.017306656967492624, 0.02312175484128033, 0.0, 0.03148485069819585, 0.1704454176812899, 0.11066558939981021, 0.0, 0.03368551373263158, 0.004243474919489686, 0.004622862851305701, 0.07495218446523934, 0.058133198758243826, 0.0, 0.01330028833849788, 0.004341696307557994, 0.03244069525646936, 0.005945561509450083, 0.018834998773868045, 0.0, 0.0, 0.019548191964901297, 0.01989655083151351, 0.0, 0.0, 0.028337345336864946, 0.02432021984309853, 0.013598565707466261, 0.0, 0.08048496045165301, 0.0, 0.0874426636798309, 0.005366505001920218, 0.0, 0.0724773450739083, 0.02828072519559021, 0.02372884196086534, 0.01797419074934919, 0.08768101894403044, 0.039205794255389066, 0.0, 0.0, 0.013598629845501527, 0.014610157671606075, 0.09186486209789305, 0.0, 0.058247030026975385, 0.0, 0.0, 0.09091549089989312, 0.0, 0.03150206947002052, 0.06254181365669438, 0.01225169789058634, 0.0038969863637986985, 0.0, 0.0, 0.07857200689955361, 0.01602740438364724, 0.027450364412669532, 0.0, 0.09409516148590967, 0.015817321394457153, 0.0030017662790463, 0.01590380466308033, 0.014643952689580702, 0.005670816500152819, 0.0, 0.006660354142737766, 0.0007245688160469242, 0.14461072702726419, 0.0, 0.043314957829761476, 0.0, 0.06667924377946595, 0.0007543604323493484, 0.12349680650803797, 0.04236547209955572, 0.03472676266614934, 0.04596606228586681, 0.025300778160746308, 0.10181186506084301, 0.07550152673728834, 0.024127136869219974, 0.03447111074822517, 0.106297422695171, 0.0, 0.0, 0.030828794188685636, 0.029723702712993426, 0.0, 0.04974285798020517, 0.0, 0.06767012144885912, 0.0, 0.0585409792238854, 0.00974117713585063, 0.03188282949766239, 0.02527041109169221, 0.031831777912235175, 0.02482376526732385, 0.02887667062219195, 0.01964763340729222, 0.016230579935503645, 0.04101439980539973, 0.04034218738293496, 0.029465799091902615, 0.0, 0.02656306279829779, 0.012862081247055169, 0.03662773614951879, 0.0, 0.0, 0.0, 0.0, 0.1689107044483041, 0.006577409346613747, 0.10716671297485374, 0.014843271942066767, 0.0, 0.00704429702037969, 0.0, 0.019127846170957967, 0.0, 0.02667560214374758, 0.0, 0.01873506942428028, 0.0008894500953878777, 0.0, 0.0, 0.07156702019552036, 0.028845815645941013, 0.0, 0.04190256499260344, 0.0, 0.03521943440275304, 0.0, 0.0, 0.01634890773863614, 0.0, 0.005429504014398726, 0.041520178607638764, 0.0, 0.04583373635653762, 0.0, 0.05030235696826729, 0.057548301108216564, 0.002820136812081385, 0.0, 0.01824311465928508, 0.04750592030553857, 0.0, 0.03953371828583687, 0.1457659171804311, 0.0, 0.1574744529567951, 0.04542473268693776, 0.04453916509016231, 0.04181505780606013, 0.007604693368274499, 0.0, 0.07679844362323908, 0.042031390817722426, 0.02403922652931214, 0.0, 0.050766643042977774, 0.0, 0.018818086948355003, 0.0, 0.0, 0.0, 0.0, 0.006879248094522451, 0.06746084362107603, 0.0, 0.0, 0.0, 0.0, 0.07956918842155575, 0.07032394719017501, 0.00333943327791365, 0.004845725916683467, 0.044120930124772445, 0.0119437814911752, 0.012848116335198164, 0.0357715941670655, 0.16278488070009622, 0.0, 0.03431682899503813, 0.03760851436900176, 0.021957654082499743, 0.0, 0.045737465165604105, 0.007419497082089485, 0.12490138366747008, 0.0, 0.010618052883525552, 0.0, 0.00033674182918343436, 0.04693589809840467, 0.03241089397651207, 0.0, 0.07803741637561568, 0.023464771925812575, 0.007252182709200904, 0.0, 0.051041066789437685, 0.0, 0.014054501239049591, 0.0, 0.0, 0.0625707628170403, 0.0, 0.0, 0.02199343165295731, 0.04421938659019322, 0.0, 0.015833099351132467, 0.026396647503224985, 0.027994110641141625, 0.04817055069597731, 0.0, 0.011087873154421805, 0.0, 0.09860018959522898, 0.1292100852508417, 0.0, 0.02441519911075027, 0.007966643199091676, 0.004957345568520429, 0.03505209826874535, 0.09908119737199082, 0.08407592993267428, 0.0, 0.02512772686966764, 0.0, 0.0, 0.07648374577192067, 0.049191362502686534, 0.0, 0.0, 0.0, 0.0, 0.05454482228636257, 0.0, 0.024788574101760143, 0.014086627522785257, 0.04567804127593062, 0.007425916612226326, 0.018995382802981776, 0.016798568050661978, 0.007535047479230574, 0.067286488953495, 0.03415200798827049, 0.012372275106241363, 0.0, 0.0012604419575249178, 0.006389362353825593, 0.03071875164532297, 0.0, 0.0, 0.0, 0.030321237846612104, 0.0034120109050963404, 0.029150214761311074, 0.045832723891838074, 0.02442711504144495, 0.043250187576719785, 0.0, 0.013013175568953927, 0.0, 0.0, 0.0, 0.0, 0.001317269402092209, 0.028104645672989363, 0.014031205388383516, 0.016918469526302597, 0.0, 0.059215825887084295, 0.0, 0.01990825602294946, 0.0, 0.023160982121777536, 0.013936473510296372, 0.0, 0.0, 0.003884981670644496, 0.027189757831521107, 0.0, 0.008177628129402684, 0.0, 0.0, 0.0, 0.016660475424769183, 0.0, 0.07348575991465835, 0.03219229551781843, 0.0, 0.0, 0.02837258918724334, 0.02280512368632749, 0.11993205115828735, 0.05257386962523023, 0.03774251704982432, 0.014440543492024402, 0.04558809226275899, 0.013454894217827425, 0.027534130977370393, 0.009872885736590392, 0.060455861498331, 0.0575815108666194, 0.08000787425761882, 0.018070400092891556, 0.12929152223047596, 0.019591276690090895, 0.007744143200806395, 0.12134473719789232, 0.0, 0.018444960492231783, 0.0, 0.046054467404903834, 0.0], "feature_quality": 0.92041015625}, {"bbox": {"xc": 323.0, "yc": 391.5, "angle": null, "aspect": 0.42487046122550964, "height": 193.0, "confidence": 0.8486328125}, "feature": [0.006122838423213256, 0.0, 0.0, 0.0766355041319142, 0.037614528851285516, 0.0, 0.0, 0.039276633052557394, 0.0, 0.025147595494320156, 0.09173169794424595, 0.0, 0.001453311857910955, 0.0, 0.10663431158003096, 0.009304692591093445, 0.10919504293094608, 0.0, 0.0, 0.0, 0.0466677063944322, 0.002153724353981306, 0.01592853446955818, 0.030088273415634262, 0.0, 0.0, 0.0, 0.0, 0.002997262982469633, 0.12451182134281802, 0.0, 0.029531433720088946, 0.0, 0.045573733483929735, 0.020243500363612315, 0.01942410344640321, 0.0, 0.0, 0.022742901656490292, 0.014439456076556095, 0.0, 0.00538509614457412, 0.004376631180414201, 0.0, 0.0, 0.1418337566970053, 0.003694078318656237, 0.061087093856550194, 0.09412000122589657, 0.0, 0.0, 0.034211491617683436, 0.0, 0.030053508566041665, 0.03153635214854327, 0.06191777946027778, 0.0, 0.0, 0.028456213234730687, 0.0, 0.018055020795125783, 0.054840828873331283, 0.0, 0.00609382990204634, 0.017521921954866175, 0.02337442236887714, 0.0, 0.007864673154286236, 0.0, 0.016214399149370017, 0.0, 0.03150120916721983, 0.0252247256412953, 0.09484052833031266, 0.01210262015935526, 0.08531960183611294, 0.014123806251176301, 0.011264079596095815, 0.0, 0.09660270363979939, 0.061230399965128524, 0.030126645060197983, 0.1108926217059823, 0.0493157599968215, 0.008777339171613436, 0.019197553091632565, 0.005210541811500034, 0.019535733750759367, 0.009381416246457934, 0.028007266156817423, 0.020924901014355814, 0.012563922691573826, 0.0585187591491395, 0.00296869785711595, 0.006380700994003344, 0.04708787764762829, 0.2033081214374626, 0.02364412191719543, 0.04965489180268665, 0.014681467656059797, 0.0, 0.03862288110310259, 0.04785603480660252, 0.07305416033498582, 0.03756743981597305, 0.013473109896977269, 0.0022408415417091467, 0.005786183743773326, 0.0, 0.07414027683160361, 0.0, 0.001965695805702106, 0.08738878520657688, 0.009574855350782016, 0.007276231099335698, 0.008894373123838622, 0.02670775828966233, 0.11022116446540715, 0.0, 0.0, 0.028223129927133318, 0.11746665709090734, 0.02184942000709214, 0.0, 0.013549834279518166, 0.04738478086527513, 0.0, 0.029277090683101324, 0.0328136142351023, 0.0, 0.11792582536037585, 0.0, 0.09496016920995146, 0.01589457533142284, 0.04368494803613422, 0.0, 0.025818534985294597, 0.020489251084192934, 0.04023727380605892, 0.047485215561692704, 0.0003331081492134138, 0.058882556778678125, 0.0, 0.00711767319282909, 0.0, 0.02346366436606176, 0.02686160554741432, 0.02658108706853548, 0.04859850227752439, 0.0, 0.0, 0.0, 0.06527205806154043, 0.0, 0.040024679420862005, 0.03766290644318847, 0.007704686346142883, 0.13639269705626636, 0.021551981587610878, 0.026941941087984766, 0.006301976876347411, 0.0, 0.0, 0.008979273877882598, 0.016729205139973682, 0.10538615109321875, 0.06440805614361994, 0.05571570935027757, 0.005156384257938219, 0.0, 0.01804480251227615, 0.0, 0.010500134242862055, 0.0, 0.0, 0.007670182552879847, 0.005105751328413706, 0.07162196604347784, 0.0, 0.05289296179694433, 0.0, 0.0, 0.008146443103758883, 0.012653154508288767, 0.025532425974210522, 0.0, 0.01950017627888481, 0.013634169290318687, 0.004383148498948205, 0.0, 0.028498531992823286, 0.012072547051930739, 0.0, 0.10095570376856511, 0.06517979973662594, 0.039803129131055354, 0.0, 0.0, 0.01955464470035996, 0.033317006464845735, 0.0, 0.06439793966546709, 0.0, 0.05999264682703137, 0.012047244221726084, 0.030211730517048948, 0.0, 0.030607564630306852, 0.0, 0.029405038825996176, 0.0, 0.0, 0.03481317191909551, 0.007878055381676057, 0.045651454098146124, 0.0, 0.028484962881097257, 0.0, 0.05252387614058515, 0.08002558889938208, 0.0, 0.05576299908627795, 0.0, 0.07722637277452978, 0.007894638639602748, 0.0, 0.019648387919494425, 0.03137901735275066, 0.0426434859882234, 0.1369906571231881, 0.0006864712972673514, 0.05210319004649398, 0.062000543770042486, 0.009257220333815297, 0.0, 0.030480826508950697, 0.0, 0.0, 0.042048891293706196, 0.15804175087659594, 0.0, 0.022383061320950227, 0.0856750514805168, 0.008828160803415168, 0.0, 0.060870459279244504, 0.07412556459856819, 0.008965863290612962, 0.0, 0.0, 0.031347204839364255, 0.04457227195573088, 0.018920596322787708, 0.0, 0.0019293540740742503, 0.037965935394874965, 0.018210259868517837, 0.0, 0.0, 0.027211121432349553, 0.0, 0.056602463163572335, 0.0, 0.0, 0.0, 0.02422280890066662, 0.022199148227537772, 0.029019242655839345, 0.17625386649930053, 0.0, 0.049900933393829464, 0.0468666007761501, 0.15612973068829292, 0.030382314466949178, 0.033407478844508405, 0.00039320391619932817, 0.0, 0.004249620004317794, 0.0797563009329093, 0.033634526587940396, 0.0, 0.019215091132179635, 0.05150022700590266, 0.03810090515314101, 0.0, 0.022705484067370545, 0.0, 0.0, 0.0, 0.03531701208950472, 0.019322042783543013, 0.009097302607430463, 0.0, 0.0, 0.00730188079268576, 0.019659289748165196, 0.06454205439420829, 0.0, 0.0031942027140096367, 0.0, 0.005243554893131861, 0.0029552100073532337, 0.03516702468411295, 0.020831086531933617, 0.018110467996042694, 0.0, 0.037913631050382486, 0.012332045042456722, 0.05223130107690366, 0.0, 0.05727062193197227, 0.05293023976819423, 0.0, 0.0, 0.0, 0.047517650538082185, 0.050112501005941855, 0.0, 0.011987177269105236, 0.0400181086548622, 0.0, 0.09876922975260485, 0.0, 0.04814474710921817, 0.0, 0.0, 0.0, 0.0, 0.03796412617997816, 0.01700946328969936, 0.01109961192694197, 0.02181775292898683, 0.14260634381464163, 0.026725783538401063, 0.11543592680876452, 0.041532348805846275, 0.009055375070244008, 0.06544085606618884, 0.0, 0.02517684834675931, 0.0, 0.03956634594990696, 0.0, 0.0, 0.11882121802936757, 0.04358581643983525, 0.13318591891708878, 0.045952519673537855, 0.08992479837711734, 0.015065725120942657, 0.0, 0.030726658673288727, 0.06644903088696298, 0.012261008633759394, 0.027072547787818008, 0.013693736672748978, 0.03350027237125733, 0.05905743397807624, 0.04984223571438011, 0.0, 0.003781601997994734, 0.023602988456643745, 0.0, 0.0, 0.0, 0.13446381801017898, 0.0, 0.028711484148811688, 0.007131178313031436, 0.016136157876847315, 0.016967282695123802, 0.006540976491179667, 0.0, 0.0061125975978950555, 0.0, 0.07988789659265397, 0.03140416020414611, 0.011771471296069327, 0.005856732580690788, 0.0, 0.0, 0.016149197604150164, 0.06125116812326868, 0.07181024655838154, 0.011767314028559269, 0.010851489884103123, 0.017958046004045422, 0.029658587786349028, 0.013482611183891111, 0.02204083319795059, 0.12465510418175138, 0.058131848944729496, 0.012989573946161528, 0.06757701529230198, 0.02249190217661501, 0.028816104472619133, 0.0, 0.01931606684784288, 0.011517928153127719, 0.0, 0.014607729059839751, 0.0, 0.09808923255232391, 0.029435652952666366, 0.042507134594786965, 0.025168634162083148, 0.0, 0.041378652800786626, 0.0, 0.0, 0.14086407568643097, 0.0, 0.0, 0.0, 0.0, 0.0, 0.04064179331430373, 0.07175818072775006, 0.0, 0.05758653644956366, 0.0, 0.001547650634521495, 0.005676133957334454, 0.003053225751458021, 0.006184783672489427, 0.0004504804657097696, 0.018689223334095995, 0.022595388105229926, 0.06940890645813369, 0.10455583198639952, 0.01954127338061622, 0.02152413363998709, 0.0, 0.068505590475028, 0.0, 0.020550774571153934, 0.04045142434876353, 0.0, 0.0, 0.0460969049119019, 0.0, 0.05863714928536089, 6.427390673123632e-05, 0.017681367016587454, 0.0, 0.0, 0.01155145753000743, 0.03570075762219813, 0.0, 0.0, 0.036403544531026434, 0.024167136275064012, 0.0162123485119066, 0.0, 0.0811006174101693, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0028311967977824697, 0.0, 0.019789228900058218, 0.0513420341419516, 0.0, 0.0, 0.010800786054879077, 0.0, 0.08412937113046591, 0.04235233909900225, 0.1300398163771834, 0.03862185723872369, 0.0, 0.012118559138986707, 0.02626082112733378, 0.0, 0.08237795803178011, 0.019777082145381285, 0.0, 0.018975649394092856, 0.0, 0.01821098268186487, 0.05686578246610906, 0.006293175860312036, 0.011901793669928032, 0.057512312099504755, 0.0, 0.09164707788029448, 0.0, 0.021504302085057173, 0.022878547688813426, 0.0, 0.007758600659197069, 0.07935199085146925, 0.03458069071356187, 0.055608628261514026, 0.1607466958522434, 0.0, 0.07377720637847045, 0.0, 0.02363828850807077, 0.1427361069898445, 0.06435634517507433, 0.05122164281626237, 0.03827805986904105, 0.016169526547741418, 0.055760084563244834, 0.05780365968941382, 0.015562142274604852, 0.0, 0.07432198367180187, 0.0374062568026427], "feature_quality": 0.8486328125}, {"bbox": {"xc": 332.0, "yc": 330.5, "angle": null, "aspect": 0.47058823704719543, "height": 187.0, "confidence": 0.6943359375}, "feature": [0.02620238825780028, 0.0, 0.011925813060074284, 0.08029330925475944, 0.014345740988649547, 0.0, 0.03616348150450254, 0.04287531038462128, 0.0, 0.03319846873014149, 0.018516378900507145, 0.006509543280545765, 0.026449856816343667, 0.03967817218427939, 0.0803840667635659, 0.055657843530713014, 0.01988912899497622, 0.00633838734744727, 0.0, 0.0, 0.01450586189115482, 0.0, 0.12937189608923877, 0.09965828965896847, 0.0, 0.04500444173149082, 0.0745727474674009, 0.0, 0.008108444329281261, 0.050308505064384064, 0.009031549308628865, 0.0, 0.04168193420940139, 0.04747916587356377, 0.09792524584575306, 0.040704624619986925, 0.03716849162930361, 0.0, 0.0, 0.005048225573880291, 0.0, 0.02659999395911804, 0.021308169949341677, 0.07404483960432375, 0.03788201115289556, 0.003611888954651547, 0.0159418713813989, 0.0, 0.03461916761998724, 0.01750875174382876, 0.05635315950108093, 0.0, 0.0, 0.02159459517209209, 0.0, 0.0, 0.0, 0.06242017678844223, 0.06289863094232374, 0.02101421654281155, 0.10138850919837153, 0.04994264111618612, 0.0, 0.011865715308703562, 0.08143637383556425, 0.0, 0.04784282245417457, 0.023448451394274178, 0.007386440537749995, 0.0, 0.008142748894004704, 0.06186874455594845, 0.053282012348291684, 0.04074661279994136, 0.0, 0.10116709769847411, 0.0039712314088181724, 0.013637469987551895, 0.0, 0.06740287053463194, 0.06718549784267779, 0.0, 0.09070357770754443, 0.04902457380271287, 0.015082361963523248, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06746555881019062, 0.0, 0.022794742857049813, 0.0784982760050686, 0.013272366328080746, 0.039556318746057646, 0.005487141099283725, 0.0, 0.0, 0.0, 0.039889961392937254, 0.07166300322536623, 0.0, 0.07029446905840118, 0.014203807975733694, 0.0032033220225575467, 0.02280556522368063, 0.07904838767267401, 0.0, 0.05753803875696431, 0.044495441080300846, 0.0, 0.0, 0.08702088852194098, 0.0180513039003852, 0.036440260338113976, 0.02186591101190436, 0.03125571053740851, 0.0072162430986010455, 0.05439955725360765, 0.05666474534061877, 0.02346498737285816, 0.03883987855705564, 0.055028141320893724, 0.028996585481892188, 0.03493873950339383, 0.005408936788734137, 0.025185189415471126, 0.09693303893491537, 0.0, 0.01517822822700735, 0.02914390076064414, 0.02259708706640346, 0.01724551592969298, 0.0, 0.0, 0.0766418027510092, 0.03629416200328288, 0.01564509972553127, 0.0652106508870733, 0.06557410986490883, 0.06349444668597459, 0.0, 0.01558965045895922, 0.0349392792963409, 0.030253594570328137, 0.012225601772949658, 0.0, 0.0, 0.006771907353169921, 0.13893317144745623, 0.0, 0.06804635674292112, 0.002938057165290362, 0.0, 0.05789892889872137, 0.0, 0.03291868729826196, 0.0008130833085187575, 0.0, 0.04236155762766512, 0.05327017064051528, 0.06258203273970595, 0.03834744039213902, 0.05316237591681685, 0.0, 0.0, 0.013907367665983128, 0.0, 0.0, 0.0, 0.04238466751321166, 0.0, 0.036237035522911, 0.005745767587707392, 0.1220524965101307, 0.005927879028331014, 0.014132539643085496, 0.03371738325715403, 0.0, 0.0014856123051923931, 0.0, 1.7087573383163114e-05, 0.0, 0.015658099337374942, 0.032836612262617575, 0.010981750137598601, 0.0, 0.026385638324171633, 0.056312636473411413, 0.05487354847651606, 0.08851256777453682, 0.0, 0.029952004539470903, 0.0, 0.0, 0.06930526956541147, 0.11076847196133126, 0.0, 0.07216310211250938, 0.0, 0.0, 0.028859894966995783, 0.03598153031491008, 0.043072050455089564, 0.08976211133373156, 0.0, 0.022566755040399882, 0.024309168116910918, 0.04340668352563545, 0.0, 0.03575395698213023, 0.0482330011828902, 0.028011619989831076, 0.15754280319425507, 0.0, 0.00628414779542625, 0.10621486541226537, 0.0, 0.06099494990329492, 0.095883238044457, 0.08636769086018438, 0.014513485261637248, 0.0, 0.07693373434377775, 0.06843423171245192, 0.0, 0.035773109992591534, 0.0, 0.0890065072385875, 0.0, 0.025045990309244797, 0.0, 0.03743286004471226, 0.0, 0.0, 0.07604544721441128, 0.026408697604129387, 0.01860927750767732, 0.03282493924013713, 0.032852789182500154, 0.0, 0.0, 0.06389254880402045, 0.043661562188251374, 0.0, 0.03750141133920053, 0.0, 0.05578236701619081, 0.024635868158966793, 0.00749882229660357, 0.0, 0.004344859097762681, 0.0, 0.056223609193783525, 0.08456778019565035, 0.012994466942146144, 0.09017742417154526, 0.055863499823967766, 0.11545813525053875, 0.025160949338441648, 0.009320927728953555, 0.007906067760137967, 0.15922140503309432, 0.008454655838052359, 0.030588458980708486, 0.13912104831051678, 0.016554754462315992, 0.07436697550422892, 0.010888946717131146, 0.010111943687299552, 0.0, 0.04469895748008684, 0.03549186581821703, 0.033891174898001905, 0.03577534627765797, 0.015570729993227346, 0.05513339130641309, 0.005958382751867982, 0.0, 0.05352500592691224, 0.0719052112124656, 0.07378286170053784, 0.034976291260064504, 0.0, 0.011441142853036627, 0.017075091970289454, 0.05917751042672068, 0.015403100185261904, 0.001610603591142733, 0.029811118580284974, 0.0, 0.013592835858240835, 0.0, 0.047576362341096017, 0.006766425081051216, 0.00035464648897549477, 0.0, 0.06497129127168572, 0.008581544532358508, 0.0, 0.0035233047751492956, 0.15406953439379623, 0.0, 0.06088998427298873, 0.0, 0.0828918676823867, 0.03820624116026059, 0.0, 0.041354024452794486, 0.11455369288939919, 0.0, 0.04163536742855661, 0.013280640341847592, 0.08968832356569871, 0.0, 0.0012980167851076093, 0.04350507524897907, 0.048795754608532846, 0.07794047710754731, 0.006503275416905874, 0.02146597745350235, 0.0500272970368587, 0.06429215463099032, 0.04242418806826519, 0.023996488232739272, 0.0, 0.0, 0.0, 0.05995552556832804, 0.04097387526981865, 0.0, 0.09682692142501677, 0.02046071430075735, 0.07199104311063001, 0.08187911008292117, 0.0, 0.0023684198734538276, 0.03363727701989249, 0.0, 0.06441775770236226, 0.0008948709767125285, 0.05356390475616065, 0.0, 0.05256255510228193, 0.04477070656582853, 0.029137734108181827, 0.03975518425125503, 0.09948765725273494, 0.03517800754676361, 0.04621437798319411, 0.09946081219277786, 0.00942118161747508, 0.03811179908263238, 0.04812793434140644, 0.0004954388805363209, 0.0049624349433686375, 0.0, 0.018456463088277066, 0.0559592600566944, 0.05554877161834517, 0.00040166864481342595, 0.05643896248176604, 0.0, 0.07517634683256533, 0.1005017739737279, 0.03174270739663545, 0.03286329827643847, 0.01534731836767782, 0.0416419943508979, 0.023217318801749563, 0.01299904433814152, 0.0, 0.021536152946411723, 0.0, 0.029390631923465187, 0.06918574398427399, 0.007325416824593949, 0.0, 0.004526682869711942, 0.03181860855044769, 0.0037175624607532778, 0.03507288768990112, 0.0, 0.0, 0.05096299437354973, 0.0, 0.0, 0.04947272243828018, 0.09350823582977581, 0.016134088276145507, 0.06570406019733666, 0.018348643061784242, 0.0, 0.0, 0.017502387488591176, 0.051099383664703346, 0.011919499410425489, 0.06906048792265373, 0.029193525564925677, 0.07203458801488716, 0.0, 0.02939549969914861, 0.0031083187650965253, 0.037847534288191244, 0.04498808889694245, 0.0, 0.0, 0.030973791621850173, 0.007556573515017989, 0.0, 0.0, 0.03062113332253597, 0.0, 0.02090850869720314, 0.04541953286862982, 0.0, 0.06973343140319745, 0.0, 0.002299393699735057, 0.0, 0.012446203583426477, 0.0057886684756024605, 0.013838201875059577, 0.011145952019371137, 0.0, 0.04618015896601362, 0.12849970635668678, 0.015996401313107964, 0.056402068597749606, 0.0, 0.05335430604656032, 0.0, 0.019794461601988403, 0.005606908864310413, 0.011177513038245285, 0.0, 0.025488102421006676, 0.03178286172644379, 0.039960748972491966, 0.028475299721576433, 0.025303811325380256, 0.008204634709512604, 0.03874779566378093, 0.004696803496806482, 0.04032420554053757, 0.002941390507228032, 0.07803061771012854, 0.035799285130944665, 0.06516261413436372, 0.0067663329065859226, 0.0006650362066837052, 0.04166888278707395, 0.058864276290862314, 0.013864234835806115, 0.008893782822523228, 0.0, 0.05444731447068392, 0.0, 0.004418592946745583, 0.02233682734284641, 0.0, 0.01925968342778578, 0.046740560436672594, 0.0, 0.008852680240372592, 0.06969517357807369, 0.09906027618689027, 0.06466640464818743, 0.0218233565313135, 0.0010660025859937936, 0.049041905011977804, 0.0, 0.05759821603140313, 0.01062617840224417, 0.043018109717021386, 0.0, 0.014750719442295739, 0.0, 0.012654638364484681, 0.05887603606578068, 0.0, 0.014227335959835224, 0.09028956615629957, 0.0, 0.09112075090319358, 0.0, 0.028484468972306838, 0.020352343637262713, 0.0, 0.012015894622801926, 0.1090521906469544, 0.02196328821368228, 0.01085401801681265, 0.05960093461748012, 0.04414677821271096, 0.04015888190154689, 0.0, 0.06598464649905691, 0.09929991533791116, 0.055836804170987096, 0.0, 0.04906916937538485, 0.0, 0.0808957133641125, 0.06626327605134402, 0.04517822132338898, 0.026661366489368232, 0.08979742921512573, 0.0], "feature_quality": 0.6943359375}]
================================================
FILE: python/bugfixes/bug_vs_1/in/fixed-1/bug_vs_2.json
================================================
[{"bbox": {"xc": 293.0, "yc": 936.5, "angle": null, "aspect": 0.4320557415485382, "height": 287.0, "confidence": 0.9208984375}, "feature": [0.0, 0.04753167844180798, 0.0, 0.006542685751840367, 0.0016779792149485143, 0.011839572191505584, 0.0, 0.0, 0.0, 0.0, 0.006708212091246266, 0.0, 0.04389686354756224, 0.03970039272597332, 0.004767956936242561, 0.0, 0.0011268489905920435, 0.008954652189128838, 0.008568849585413625, 0.0, 0.044796127548754255, 0.022998480319707453, 0.042199042961223246, 0.10684276377335718, 0.02716946400710874, 0.019249891379068063, 0.08522185538664392, 0.04911326598230316, 0.04527778929549651, 0.0, 0.0, 0.0, 0.11484148457462652, 0.0025471469106063925, 0.09798997528782201, 0.0, 0.0, 0.07307906044016045, 0.0, 0.0510372354953907, 0.036777248994903367, 0.0, 0.0, 0.026654113038220798, 0.0031241567677631056, 0.0, 0.00015581804528503698, 0.02513689875648859, 0.0, 0.06745624443088763, 0.021825509691625798, 0.014388911981111249, 0.02058183701886171, 0.0, 0.10164523845915902, 0.0, 0.06572968748424443, 0.030589878785778516, 0.05263353519705747, 0.03134512862541044, 0.08208861595113383, 0.04820384524425177, 0.08225596736550972, 0.055507301382457526, 0.0434418138459092, 0.03402714166181525, 0.010380763795106945, 0.041400212120939105, 0.0, 0.0, 0.016709026770459587, 0.031002818702896496, 0.09067680865840379, 0.07218759179261292, 0.0, 0.05594868481117391, 0.09866344364006929, 0.007827166078287005, 0.0, 0.062162748412250696, 0.00858363031036951, 0.0662378357694877, 0.005175788270381841, 0.01798757284327094, 0.04580312733493015, 0.04283190760799379, 0.0, 0.03551958466175176, 0.025975796412955523, 0.005720358451309114, 0.05961205013003764, 0.0, 0.025765886644201593, 0.0, 0.03327250308575175, 0.060519574324089664, 0.005431849600649877, 0.09562483617205723, 0.0, 0.0, 0.010046739631609859, 0.0, 0.029396648140487897, 0.0, 0.0337570886711597, 0.0032545615991904538, 0.03235784360974131, 0.0, 0.029735158002414868, 0.01584444907153058, 0.09520689923337228, 0.0067985140814516174, 0.01254984418864262, 0.05386172407555219, 0.015748653843895677, 0.018478552292088533, 0.0328393659047189, 0.0, 0.04468438949812464, 0.043540322572464776, 0.0, 0.12787408869265807, 0.0, 0.006721372851536019, 0.0, 0.03642322512415801, 0.06374314596435411, 0.05772339910054623, 0.020095505962199438, 0.01968378624802223, 0.0, 0.025670424938703834, 0.0, 0.0, 0.04272004869916814, 0.043067911126111615, 0.003413245795868229, 0.005364415375652629, 0.05212157058185468, 0.0, 0.02586864400118713, 0.031935202498195175, 0.12768335586574092, 0.007300887320490922, 0.0050308380388514725, 0.0464493096252257, 0.04849026057529405, 0.18396757556786242, 0.0, 0.0035886296318885062, 0.0, 0.0, 0.05174802578825305, 0.0, 0.011497957203618858, 0.07979587089479603, 0.0, 0.03391664938028326, 0.021607469884992216, 0.005064441265742291, 0.07304439737985823, 0.028302040107360652, 0.06641291746001789, 0.0, 0.04107068295265621, 0.0, 0.0183835403185318, 0.0, 0.02418543331139231, 0.0, 0.07393247734952454, 0.07679052732104745, 0.012761562181944967, 0.043210012474299786, 0.0, 0.011496456935050726, 0.06314345224400394, 0.12253173807246873, 0.0, 0.08702529209114399, 0.019462885356017045, 0.0, 0.0, 0.0, 0.0, 0.05325936217810486, 0.0, 0.028175668918226083, 0.07838011009604978, 0.05825631866758522, 0.010936176931785526, 0.008015106964665864, 0.0, 0.029340472321290837, 0.16639544463878705, 0.14628252115118162, 0.0, 0.030169273669996412, 0.0026955244597777813, 0.0, 0.11780561550352601, 0.056554240154031946, 0.0, 0.023457311488378842, 0.0, 0.05094195275299092, 0.0, 0.015789328437352777, 0.0, 0.0, 0.012461406203691551, 0.004181152045241056, 0.017044758055975717, 0.011767152565921753, 0.0187546900280754, 0.050894697198339924, 0.014680349899877359, 0.0, 0.08162573835709123, 0.013428851658919784, 0.08067726182815084, 0.03771620794090575, 0.0, 0.0643752575715955, 0.05058384062134496, 0.038843796316374996, 0.0, 0.06427691153876537, 0.033601860263524894, 0.0027837143367975587, 0.0, 0.02576397383082968, 0.01779787195941227, 0.11463413839414625, 0.011406168890021842, 0.06880251176691182, 0.0, 0.0, 0.07216798487450177, 0.0, 0.02187205404227703, 0.06486536079849181, 0.01556252989780053, 0.00805056954841881, 0.0, 0.0, 0.06899587558378888, 0.02770084495634431, 0.025816126466616306, 0.0, 0.07482999820365831, 0.0, 0.035202099477543304, 0.026593170292868458, 0.010072432457150358, 0.006250655163074454, 0.019221902247802833, 0.011177607447744688, 0.03125982598096814, 0.13980041266486037, 0.0, 0.03978614626445469, 0.005979746868262322, 0.06415150256680695, 0.04385206234396925, 0.1210261145565758, 0.03953425919034213, 0.06729899862105741, 0.055579067908943534, 0.013325047251601262, 0.08844381403483048, 0.09683541694106759, 0.017853995484197582, 0.0, 0.08641876988271764, 0.0, 0.003514205387187694, 0.043058730551604855, 0.04483185509086005, 0.0013767873715557371, 0.05049243928639487, 0.008726786843576943, 0.04858600815690936, 0.0, 0.03236215034507321, 0.05202797985419944, 0.021802400210025618, 0.0, 0.040068954443184444, 0.008089236036464813, 0.028026801835255837, 0.029653185930951852, 0.0487605320403809, 0.05342706222189239, 0.03177870972789412, 0.052833769337540096, 0.0, 0.020686839549258262, 0.024258173676034857, 0.08447231144838266, 0.0, 0.0, 0.0, 0.0, 0.13337829632769574, 0.003615535397257036, 0.09911579727427224, 0.029171989023425132, 0.0, 0.01695433055918217, 0.0, 0.02819823686214017, 0.009732813372645324, 0.032197629801519925, 0.0, 0.037750385244227753, 0.02031960727220356, 0.0, 0.00779863657143372, 0.0709829051848555, 0.04710787058383086, 0.0, 0.052790511400142674, 0.0, 0.029704429806072116, 0.00020612812015775457, 0.013694517729478753, 0.040117111785913574, 0.0, 0.0, 0.05112345852147975, 0.0, 0.028821277132090442, 0.0, 0.0813170014469191, 0.05510876218423673, 0.00486153023242722, 0.0, 0.04170871196311132, 0.04375720725364776, 0.0, 0.03633847563838219, 0.1356867436527342, 0.007837446578587518, 0.16741044895625443, 0.04498551234194636, 0.07054439911088325, 0.02709492006630993, 0.0, 0.00236058557986188, 0.07879044226516863, 0.0340647262365871, 0.023020223174013966, 0.0, 0.039051890887992276, 0.0, 0.010021833546441646, 0.0, 0.0, 0.03347513347239044, 0.0, 0.013454833846871952, 0.09406699261869143, 0.0, 0.017830499023950473, 0.004155908661117073, 0.0, 0.07165159498996711, 0.1064840287571624, 0.0057542266365527865, 0.0, 0.050925004715192616, 0.04709654245214834, 0.009846103405205798, 0.028284848028974196, 0.11229365435037329, 0.0, 0.011222829330827732, 0.032675400844028174, 0.011569928259359699, 0.022979500934537274, 0.0599063956180969, 0.04078811184192638, 0.1309041803062416, 0.0, 0.004141233687082724, 0.01440923823790843, 0.0071292785599497855, 0.039328981544370985, 0.0189319599492127, 0.0, 0.08576610773375758, 0.0, 0.015883121370066776, 0.0, 0.07016968292245848, 0.0, 0.02091899652286756, 0.0, 0.004820688587377037, 0.08713368329942177, 0.0, 0.0, 0.05282070270719149, 0.03882057294916701, 0.0, 0.02081717581690132, 0.009341848729441627, 0.03963868067171927, 0.08192168289205193, 0.0, 0.017575502175486004, 0.0, 0.08623317817752428, 0.12230099188587856, 0.0, 0.03363303935390671, 0.025099662811128385, 0.014602084921158212, 0.04578494747321069, 0.07835151318751024, 0.08994998606099773, 0.0, 0.027297157663811498, 0.0, 0.0, 0.06414198265967284, 0.03804088651197456, 0.02103945263298448, 0.0, 0.0, 0.023771524204509946, 0.06096524357037326, 0.0, 0.0, 0.015557744378076626, 0.045957611999820104, 0.012773264509195989, 0.021644350228352534, 0.030253593179497867, 0.02062859054715993, 0.07957066559165502, 0.03319295979918989, 0.0, 0.0, 0.005858223371096734, 0.007226069124554946, 0.0, 0.025790186114193536, 0.0, 0.0, 0.007995687144338971, 0.011828890186332656, 0.030992527162664613, 0.0, 0.03155200066989087, 0.059539386463865654, 0.007038235732244679, 0.03507511005225208, 0.0, 0.0, 0.0, 0.0, 0.0037664329560256286, 0.013134073870390076, 0.026838949379688923, 0.0157975142559383, 0.0, 0.06268450718972475, 0.0, 0.009300627949906276, 0.0, 0.028403586558189725, 0.020816201978744783, 0.0, 0.0, 0.008366608501617941, 0.059686735846797186, 0.0, 0.013810897199675458, 0.0, 0.0, 0.0, 0.012374366222681198, 0.001938268257881815, 0.07373014213578771, 0.034029073068755786, 0.0, 0.013741908087502254, 0.059264791994074355, 0.013129187248136795, 0.08700322152519051, 0.0, 0.02003645976084647, 0.031786477191185665, 0.04000540162563689, 0.01271099697207938, 0.02401430507839023, 0.004790700938009529, 0.08209760594156222, 0.0037517640830059826, 0.05447154199401665, 0.00485001471243594, 0.11132751393124267, 0.0, 0.017348445650169138, 0.10768741381511632, 0.0, 0.04964533489357772, 0.0, 0.05393462945811625, 0.0], "feature_quality": 0.9208984375}, {"bbox": {"xc": 315.0, "yc": 391.0, "angle": null, "aspect": 0.4444444477558136, "height": 198.0, "confidence": 0.890625}, "feature": [0.023307214626985415, 0.0, 0.0, 0.08409643227383341, 0.03243969678776673, 0.026487125361806665, 0.020346978537585526, 0.05291739726568768, 0.0, 0.026720866897089524, 0.02726928385309465, 0.005625723298529271, 0.0, 0.024297508226820492, 0.12724321604962516, 0.013190750590899837, 0.051586614090751784, 0.0, 0.0, 0.02811360617307387, 0.06300243051151476, 0.0, 0.0556653250514604, 0.043554145672820295, 0.0, 0.032688890063862996, 0.0, 0.0, 0.025831499636724577, 0.10766655819086371, 0.04286413303333236, 0.028385218055541603, 0.0, 0.0849838713955653, 0.010591878041525877, 0.03316241055194405, 0.0007115094544445379, 0.0, 0.0, 0.02930222108192184, 0.0238827586825985, 0.0077372987560255955, 0.012888323111577235, 0.03550841198067447, 0.0, 0.07601850612340554, 0.020556859357284497, 0.06339801851227717, 0.12215279157330032, 0.0, 0.0, 0.02189702889218193, 0.0, 0.024044764938572508, 0.025489127196964143, 0.0972122224806114, 0.0, 0.02680813647563391, 0.04888517468616466, 0.0, 0.06769680892099308, 0.02738905748138527, 0.0, 0.01525293480656137, 0.0015218395092495207, 0.027488593643553678, 0.0, 0.019515155829034733, 0.0, 0.04925530806116104, 0.0, 0.020677000503712354, 0.034928300580094995, 0.06108031065376421, 0.0, 0.04805752384110649, 0.03468404749345217, 0.0006132390909872507, 0.0063607695599095715, 0.09221497716795073, 0.07782558747785102, 0.0029232399293784043, 0.10794996261182192, 0.05813386981038525, 0.000630242880202229, 0.048926230190538926, 0.00929947055121356, 0.0074611195285914705, 0.022648302544067453, 0.01412482723161216, 0.03280863173405473, 0.003575661189253023, 0.015330322674611423, 0.024973368754849887, 0.05559958724204327, 0.003327498228949102, 0.1379472723446054, 0.02110701802967914, 0.03375380049825685, 0.013609662677502278, 0.005399875746569154, 0.020248162764229603, 0.03820743854879538, 0.09492212641953955, 0.0038353234059107337, 0.07814950411550237, 0.017483009563155072, 0.0, 0.0, 0.12864907412520393, 0.0, 0.0, 0.07005264279148204, 0.0, 0.007357073279717185, 0.0, 0.018247330108912514, 0.08886417582566399, 0.015746710071401538, 0.0033138617747320307, 0.05523803461659891, 0.1187237940893791, 0.03483696965981664, 0.015027779347180345, 0.06885255758830741, 0.015301154251436855, 0.0, 0.0, 0.008087642744077951, 0.0, 0.17550378034568065, 0.0, 0.08594906457189705, 0.014583339397501909, 0.05710690695524859, 0.0, 0.032718802844424216, 0.023531403353875015, 0.0, 0.0, 0.003870989310065914, 0.0, 0.0, 0.019754133166185767, 0.0002325162667648613, 0.0228486958031584, 0.05653711003108592, 0.04828367000155311, 0.06480491522606988, 0.0, 0.0, 0.0009018210984746485, 0.12254178555299172, 0.03491157051532598, 0.04870936253147009, 0.06636361290959099, 0.01440186932771632, 0.08718356864757643, 0.028788553232109985, 0.03993322382601404, 0.02702452210004449, 0.005813255420198094, 0.0, 0.0, 0.031105728455641447, 0.07113630996674954, 0.06732442782637477, 0.033799761570810764, 0.02045872668829235, 0.0, 0.0, 0.0, 0.006609320345059399, 0.004192521740381308, 0.0, 0.0, 0.013824849873204472, 0.09366904936205515, 0.04848328561357106, 0.04848070766026059, 0.0017622617852363143, 0.01832584316836099, 0.0, 0.0, 0.010315698148298027, 0.0, 0.019371096708762473, 0.0, 0.027205511466759272, 0.0, 0.0, 0.051591690102125505, 0.0, 0.12776220492290224, 0.06671188161859666, 0.03819307338334424, 0.0, 0.0, 0.06686657479627463, 0.03335084881887516, 0.0, 0.0, 0.0, 0.027743478124427304, 0.031786065780690376, 0.00576364313484598, 0.0, 0.025789338914763694, 0.0, 0.04183055218855052, 0.00165027145206134, 0.0, 0.05524354738865747, 0.0, 0.0489309333574256, 0.0, 0.0, 0.0, 0.04340955391756653, 0.06400797078769536, 0.004400891208320262, 0.04552012535812272, 0.006693876814166757, 0.09672742877314683, 0.0, 0.0, 0.02345392893264047, 0.02915754410507104, 0.04053308533170765, 0.09927227349317201, 0.06179870208506663, 0.03283272015109321, 0.02826326861335154, 0.0, 0.04367718169037262, 0.0071976529665783735, 0.0, 0.0, 0.0514989210673971, 0.12703408225048773, 0.0, 0.08281977013936805, 0.06955682886625018, 0.0, 0.012718865292211997, 0.05730200049627357, 0.05860394148696107, 0.021016189117870853, 0.011953091984542506, 0.0, 0.03944619837797697, 0.02170383952121582, 0.029476517890094037, 0.0, 0.0, 0.019529462404637907, 0.013133230007659855, 0.00026081990711242963, 0.005152158202268515, 0.024647987370999404, 0.0, 0.04297163741482406, 0.015268628896291363, 0.009717068360999141, 0.007340780641426729, 0.013162788585958374, 0.023389221771912553, 0.021424605632162773, 0.1123274019019066, 0.0, 0.04362924720521224, 0.004481427614904725, 0.104679104453909, 0.01747173767535901, 0.10620149241074105, 0.0, 0.0, 0.0, 0.02950214828540397, 0.0511827809004757, 0.0, 0.01076917092146903, 0.04576805096296301, 0.03211381739020854, 0.04583244653222675, 0.0, 0.04455730507063358, 0.0, 0.0, 0.041044300397429685, 0.05268459316797226, 0.0142625546535418, 0.0, 0.0, 0.004981934054323639, 0.0, 0.05214039468102064, 0.041826493509991465, 0.0096077670022386, 0.0, 0.02695678690944673, 0.016513458101087182, 0.04944420705735115, 0.0, 0.02121406035032438, 0.0, 0.02598909567505174, 0.00783021826013628, 0.0184017463164001, 0.006850560715088095, 0.10343110873414815, 0.010259063070714792, 0.0, 0.010160628131370643, 0.0, 0.0779481095026462, 0.04050233365105056, 0.0, 0.0, 0.0, 0.0, 0.027068270074250254, 0.0, 0.07840162155764709, 0.0, 0.0, 0.0, 0.0, 0.039986489987339266, 0.041560056176369035, 0.009538339363987113, 0.0, 0.1549433350233832, 0.0, 0.12181647519327957, 0.0, 0.024685873697233726, 0.07452168464568565, 0.0, 0.045325159649493296, 0.0, 0.020080543867138003, 0.03283173211320252, 0.0, 0.13895190714131747, 0.004707965594959616, 0.14573063537121259, 0.041054244692534346, 0.061144178914396254, 0.006792287784936739, 0.0, 0.050089643475237075, 0.02524169960583156, 0.10777596141606446, 0.037296313149436024, 0.0, 0.049000516791409175, 0.10157112607333976, 0.05221328045188954, 0.0, 0.0, 0.08461075526467252, 0.0, 0.0, 0.0, 0.15409077816658995, 0.0, 0.0, 0.017077216276147052, 0.009614926282183729, 0.03171721738298127, 0.04536173569367312, 0.0, 0.02477753485120061, 0.0, 0.08334032495949074, 0.0, 0.04056592227831732, 0.0, 0.025394856131587894, 0.0, 0.0012573632710496114, 0.05792616879934808, 0.08571839101410765, 0.004484944004473235, 0.0, 0.0, 0.006008349627016808, 0.053378291641532204, 0.0325693374790897, 0.10801296267743411, 0.04557301601178599, 0.04496171616986459, 0.07657223345017625, 0.0121211170158075, 0.049212952927431906, 0.010588990494132403, 0.010939007577464861, 0.030164077745492148, 0.0, 0.03733679340803027, 0.0, 0.07419810356807265, 0.024107746361960353, 0.006093824891467258, 0.02839335938123388, 0.0, 0.05590791898013584, 0.0, 0.0, 0.17038338982529644, 5.107538267147133e-05, 0.0, 0.0, 0.0, 0.0, 0.0708353232650519, 0.043429730130665874, 0.0, 0.027313745558175628, 0.0, 0.0, 0.031088846589902703, 0.0, 0.016223699344799634, 0.025190705132702447, 0.0, 0.023965993551158003, 0.04721720693618817, 0.10392413697842676, 0.009816027945800072, 0.04809219837840235, 0.0, 0.10977208557814506, 0.0, 0.014099476469667516, 0.06607580359733574, 0.0, 0.0, 0.02944430146323782, 0.0, 0.03849775923498841, 0.03645820135334114, 0.0369276498469886, 0.0, 0.0, 0.0, 0.03001879356476243, 0.0, 0.04453838054974077, 0.03311589287583447, 0.0, 0.0, 0.0, 0.0897593061965288, 0.009486353523998675, 0.0, 0.0023473090476100046, 0.0, 0.0, 0.023901211821532677, 0.0, 0.0, 0.02535153692854224, 0.016552071474071256, 0.0, 0.01761212294584635, 0.031378892969080266, 0.12032277495655129, 0.0162291801587593, 0.10663481227359314, 0.03744779453817553, 0.010838667802268111, 0.007950492565309514, 0.0, 0.003910026460757146, 0.05148540279156655, 0.017291098516144566, 0.024319229081366193, 0.01362484277447512, 0.009360252192127796, 0.0046705007161544085, 0.042712997857330834, 0.009480287477353081, 0.0, 0.04471102618947031, 0.0, 0.05047806220914846, 0.0, 0.0, 0.03750164926115532, 0.0, 0.032037999463766474, 0.06403070897505574, 0.0002202358055028483, 0.0061725909525319495, 0.10220697506155864, 0.0, 0.026520335152903387, 0.0, 0.032999384299980464, 0.1272856883630502, 0.05041134435136537, 0.023840177179002227, 0.028373212463058524, 0.0038459761055407975, 0.045742836022938646, 0.09845931272090369, 0.0, 0.0, 0.10160680196440085, 0.0], "feature_quality": 0.890625}, {"bbox": {"xc": 335.0, "yc": 327.5, "angle": null, "aspect": 0.5027322173118591, "height": 183.0, "confidence": 0.79541015625}, "feature": [0.03164942942101613, 0.0, 0.007107999888776774, 0.07363514221037072, 0.03159357210051089, 0.0, 0.015270417364568299, 0.06980842211999445, 0.0379726509906046, 0.026754924179743525, 0.007430819719777799, 0.0, 0.0, 0.014997856259681567, 0.07307223057265774, 0.05309880967536088, 0.0, 0.017120371865332613, 0.0, 0.0, 0.006234411164680942, 0.0, 0.12309932795260528, 0.03476719121267206, 0.0187646077156958, 0.03661468216967664, 0.11278229406165943, 0.0, 0.01866303114822902, 0.06592861185045738, 0.05054792251279059, 0.0, 0.0, 0.12001299662235056, 0.10514186917888871, 0.03175999456277465, 0.05149713079024695, 0.0, 0.0, 0.006358989304880876, 0.0, 0.01886787956280533, 0.0025006797120022653, 0.08056465742673936, 0.066632958246937, 0.0, 0.0, 0.0, 0.009204688841879883, 0.013330805398459787, 0.0268073005569495, 0.0, 0.0, 0.028768802835929648, 0.0, 0.0, 0.028898487672907164, 0.07097222058643356, 0.0, 0.008164977197412056, 0.14294901081752243, 0.036490925596986426, 0.0, 0.029743012722116012, 0.08269013716453405, 0.0, 0.06490800020212863, 0.061188990045691526, 0.0057050053443774935, 0.0, 0.0, 0.0954120996235178, 0.033986036944804815, 0.012328462908605134, 0.0022436742173302967, 0.0642689017934303, 0.05254688317162827, 0.03691679421198609, 0.0, 0.03416176896048611, 0.03420576279980032, 0.0, 0.0929803061455431, 0.060926032821651765, 0.009860361708794277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.02898140921168724, 0.0, 0.044272055213797235, 0.0, 0.04528949183395023, 0.04457420665426653, 0.04612854749155704, 0.005220074832076944, 0.0, 0.0, 0.0, 0.0, 0.011669298090082107, 0.02302121387460653, 0.0, 0.06619162933050632, 0.0, 0.0, 0.037951162770717264, 0.05518819606365974, 0.0, 0.05395776835630596, 0.09591291049115948, 0.0, 0.0, 0.05374562548831125, 0.007503865646284913, 0.018463720492649778, 0.0015933679012330522, 0.04968032868222297, 0.011753050466527155, 0.0, 0.04435596402411226, 0.027072009840332964, 0.033293447422730764, 0.04674818784436948, 0.0420040004881392, 0.08112876491448058, 0.012860391369908082, 0.00045085012632276294, 0.07110886731000961, 0.0, 0.0075940741064822416, 0.0458304053932367, 0.04812520915189081, 0.020235515996897654, 0.0, 0.0, 0.04958439184546109, 0.03576721384617348, 0.01550862559160883, 0.0364403731228274, 0.07467674612528052, 0.0613936240879275, 0.0, 0.018394152612518408, 0.0324561345543124, 0.02944377906301408, 0.024077650037928642, 0.0, 0.0, 0.0, 0.16886372057025195, 0.03858922292202674, 0.08082647442168242, 0.0, 0.0, 0.03402050569959174, 0.0, 0.02530646242072877, 0.02709616091231807, 0.0, 0.042423442568006474, 0.026208001242311256, 0.049460171765007985, 0.049370334690405665, 0.016692619091276818, 0.0, 0.0, 0.041389713649988086, 0.0, 0.0, 0.0, 0.080416937502708, 0.0, 0.017905880788632166, 0.005034031506825571, 0.0941965319750421, 0.0, 0.035094441598501565, 0.0578525638318171, 0.0, 0.05070319297827934, 0.0, 0.0, 0.0, 0.031049328237948096, 0.03062574008114182, 0.022160000228395017, 0.0, 0.018553736017740803, 0.039159087176182994, 0.04552817515644772, 0.0969273621213195, 0.0, 0.038990240568319345, 0.0, 0.0, 0.07401992317972947, 0.0971321305808067, 0.0, 0.06129256085530811, 0.0, 0.0, 0.04308227250217082, 0.03534544263979771, 0.0274140484413373, 0.029519293747743258, 0.0, 0.012344732031082387, 0.033376225274104346, 0.04217301395879749, 0.0, 0.015215240241705095, 0.04293694891327357, 0.06306657192666258, 0.12337701545334952, 0.0, 0.0, 0.10571422710480928, 0.0, 0.051438163332652755, 0.07577979262923833, 0.08457932991496538, 0.07025720424125233, 0.0, 0.04230147050020336, 0.0631495954371505, 0.02416853927515271, 0.0, 0.0, 0.07935646882184878, 0.0, 0.04543930681306983, 0.0, 0.05381882263422601, 0.0, 0.010079948511460914, 0.08163212507481812, 0.0, 0.023403533617744363, 0.04508324014962179, 0.02964168297253297, 0.04739114727273265, 0.0, 0.04987651297794155, 0.0, 0.0, 0.029318307511601187, 0.0, 0.0, 0.04843366429793534, 0.0, 0.0, 0.0, 0.0, 0.06128228025312733, 0.11209754477339456, 0.00569627691381767, 0.11240864191368753, 0.016026118103636734, 0.09190827758107756, 0.0, 0.012666418006218455, 0.041273674481549893, 0.15434446968006166, 0.02091572754416387, 0.02015819131435441, 0.11099638938110934, 0.015599060591225266, 0.09516169418969696, 0.0, 0.0035432535169059045, 0.0, 0.04335726238773507, 0.035415786895431914, 0.0022217794142272056, 0.0016950197887113006, 0.008831707621394768, 0.05554758607776766, 0.01635961193903229, 0.01199403278752855, 0.09611339613891764, 0.05468069677899963, 0.081427755232007, 0.01493295937903067, 0.0, 0.0, 0.04291342589430717, 0.06470210078369998, 0.029572754733114385, 0.0045675526591807585, 0.04795019325570317, 0.0, 0.009681475522786547, 0.0, 0.06281689420002946, 0.0, 0.020554794049205537, 0.00844537332164565, 0.07399737352706513, 0.010308058063117593, 0.0, 0.005715601711221742, 0.14582599423159265, 0.0, 0.09684774075781116, 0.0, 0.06441840158727113, 0.08599825695932911, 0.0, 0.07847661057587524, 0.08960737869534151, 0.0, 0.056153965473483974, 0.0035716671221554417, 0.051404192848710936, 0.0, 0.014905708598881271, 0.031719201244563164, 0.028693858265748818, 0.05254928877691764, 0.017075548347122844, 0.01316392058720255, 0.015394328053589678, 0.09515551099614007, 0.03540120030613393, 0.036060190150476464, 0.005998960229444872, 0.007255563958322864, 0.006283446230301221, 0.020753998097999316, 0.022349306068912392, 0.0, 0.05254687853655064, 0.01712483312755038, 0.06910977223392069, 0.058044752690619615, 0.0, 0.0, 0.02774274033630937, 0.0, 0.10342246859215733, 0.0030524857037165258, 0.04321618452994584, 0.0, 0.028861671251301232, 0.036897248089625245, 0.0, 0.008467435132389555, 0.07610936518895987, 0.06864533282043257, 0.030010943384451528, 0.08191281610586586, 0.01745748106127867, 0.026408415046366165, 0.06144227386271988, 0.0, 0.009753819814417595, 0.0, 0.011143343085073334, 0.0470097730854311, 0.07994216650118519, 0.003660396413204464, 0.056315215189113935, 0.0, 0.08079913673382748, 0.11008404851111282, 0.02047541834481153, 0.02046476230134281, 0.003493497407021989, 0.04963811239517943, 0.03718823826316427, 0.0, 0.0, 0.015781844877518856, 0.04526203363407694, 0.04241410288658435, 0.10260718624770887, 0.0, 0.0, 0.01009810758684133, 0.0, 0.0, 0.022623704982078965, 0.0, 0.0, 0.04206900281680616, 0.0, 0.0, 0.02490426282964081, 0.08106193636522786, 0.022140071712129786, 0.05741123955046404, 0.009457916458591988, 0.0, 0.0, 0.021754620974053666, 0.05402819372579866, 0.0, 0.10929764270029209, 0.005278933944731563, 0.0, 0.011055200131344362, 0.01628906837506005, 0.0, 0.07865427310138895, 0.038581102266021, 0.0, 0.0, 0.006485999122681844, 0.009326120343754532, 0.0, 0.0, 0.10192428172034029, 0.0, 0.028249465563005463, 0.05406118157328317, 0.0, 0.10392114732408973, 0.0064079913455730485, 0.02100737461658025, 0.0, 0.0, 0.0, 0.0005190397588788842, 0.0004573933350498482, 0.003144912627943961, 0.06483978112958726, 0.08784526123318266, 0.017229158296051063, 0.05931299336126953, 0.0, 0.0, 0.007681505575795186, 0.02352601090900902, 0.010820651298091805, 0.03837023172683541, 0.0, 0.03187109042092168, 0.04151285375735367, 0.07181162387486253, 0.05892093068495586, 0.011506970718903433, 0.02493169321904833, 0.052100469575038735, 0.0, 0.08121012906717737, 0.029140835024270256, 0.10589717361881988, 0.025300077601295035, 0.10690092748981252, 0.006491424481046409, 0.0, 0.053607198894925726, 0.0625834346100197, 0.03553195584604371, 0.024352704814579695, 0.0176956892883192, 0.022735980467482528, 0.018827560181281396, 0.03193483896109003, 0.02504528043142086, 0.0, 0.01887247292473552, 0.04701085769359625, 0.0, 0.021505791466626633, 0.004288958131683027, 0.05191179410507888, 0.06497699796771166, 0.008928587696454118, 0.012577409451742296, 0.027339667033088374, 0.0, 0.04444864240130106, 0.0015103084688935175, 0.03505701566418744, 0.04946824143515981, 0.0074103060249619285, 0.014582758406321934, 0.004708873279160792, 0.06580236160600285, 0.0, 0.0, 0.07707390166813484, 0.00021000493843840225, 0.04737699638073178, 0.0, 0.011399417218834257, 0.012140640292928986, 0.0, 0.028126302280251734, 0.07513713911599866, 0.016486442726959843, 0.026567546531519746, 0.08787482375829946, 0.028340493852558393, 0.041252065749644205, 0.0, 0.044280259301200296, 0.06750227632638256, 0.039785740401447875, 0.0, 0.04710499148516051, 0.0, 0.13303381034653186, 0.05935844956757564, 0.047036888289559854, 0.0376373031241575, 0.07865537624986461, 0.0], "feature_quality": 0.79541015625}]
================================================
FILE: python/bugfixes/bug_vs_1/in/in-1.json
================================================
[{"bbox": {"xc": 316.0, "yc": 932.0, "angle": null, "aspect": 0.5, "height": 296.0, "confidence": 0.9267578125}, "feature": [0.0, 0.04258357828024642, 0.0, 0.0014462762972122971, 0.0, 0.024944440668679246, 0.0, 0.0, 0.0, 0.0, 0.0197188836599551, 0.0, 0.03178173198631047, 0.03466449768163708, 0.05894796066843041, 0.0, 0.010570168667088407, 0.010946645655506262, 0.03100957310317401, 0.0, 0.0664711566225772, 0.01816009632028984, 0.02718766608837893, 0.10607468312203099, 0.03811870451915187, 0.03395282129989212, 0.04953707899277783, 0.023830781380729086, 0.09917198248423059, 0.0, 0.0, 0.0, 0.1448656111755325, 0.0, 0.09213059201047719, 0.0, 0.0, 0.06854326801671841, 0.0, 0.05198110100054844, 0.06363063721556238, 0.0, 0.0, 0.0, 0.0, 0.0, 0.013905147391293267, 0.02990821396635606, 0.0, 0.056842783043827914, 0.029073139584900855, 0.006850207602707511, 0.0, 0.0, 0.09438037525800579, 0.0, 0.042260223977515124, 0.03138657273537624, 0.07290300477170669, 0.037673975208599844, 0.08530933369204156, 0.050893087302431445, 0.10352836260456924, 0.04043851302268662, 0.05489051026500338, 0.0011089131839616055, 0.022928385073186893, 0.0469887580111759, 0.0, 0.0, 0.045647005261296024, 0.0, 0.12134046827546444, 0.06721484268334003, 0.0, 0.06050428572509429, 0.08081337163687659, 0.0005084766108150381, 0.0, 0.06540399460923671, 0.0, 0.021025020038149947, 0.035250448947166384, 0.015826525614691594, 0.04376133352058002, 0.038913573626384264, 8.076353231785493e-06, 0.03608482496839247, 0.023932879393451224, 0.0, 0.06560250012520115, 0.0, 0.01403728277857975, 0.0, 0.07827641365203489, 0.0415220256764882, 0.020970752942797603, 0.10813580998560066, 0.0, 0.0, 0.002214588567151275, 0.0, 0.005795206068453409, 0.0, 0.026887783447670805, 0.0, 0.05249997814523335, 0.0, 0.04129303110458543, 0.0, 0.08375052157185203, 0.004444638773455853, 0.040595450335593995, 0.020734342235816584, 0.018105571282207706, 0.0206044810248246, 0.0323058288105143, 0.0, 0.033999769129488315, 0.05723638337450876, 0.0, 0.12014002759155916, 0.0, 0.011683971006246787, 0.016363037481549204, 0.06315253079160837, 0.047285858474842214, 0.07638909288006819, 0.018380684662531465, 0.07032879490057888, 0.0, 0.018429732078364885, 0.0, 0.0, 0.026030562035852824, 0.01094964522532907, 0.010531757728099443, 0.0, 0.06772971889974458, 0.0, 0.026092123616437052, 0.02236679756855408, 0.1135614922554658, 0.013953521227421828, 0.000890634499219668, 0.04095666927939308, 0.060400117412209055, 0.17859069720470921, 0.03378391499376763, 0.0032180154944928363, 0.0, 0.0, 0.05130533610400468, 0.0, 0.005473836460437772, 0.09301394110596392, 0.0, 0.028592577636270274, 0.006051747572232489, 0.006566878915398152, 0.048658924796285766, 0.031057397262219007, 0.06639713043829068, 0.0, 0.05569476443260515, 0.0, 0.020693409315290533, 0.0, 0.009103662310182576, 0.0, 0.08216281986592636, 0.09142915899635093, 0.0110111031782664, 0.03696570051700317, 0.0, 0.0, 0.08125800633088144, 0.12431912333579884, 0.0, 0.06427006935799254, 0.025449762866594464, 0.0, 0.0, 0.0, 0.0, 0.02468020368573027, 0.0, 0.037952976878457334, 0.07060538610125844, 0.02077023119326846, 0.012382914704072476, 0.0008400878616685772, 0.0, 0.0343782082848725, 0.14409173793067231, 0.11353034989479699, 0.0, 0.05133434733958721, 0.0023805925951703544, 0.01401416367583354, 0.07461377557220246, 0.049147997728611864, 0.0, 0.005224198022246032, 0.0, 0.030949288845976586, 0.0, 0.011047210654886739, 0.0, 0.0, 0.021344765395439152, 0.017070411063172825, 0.0, 0.0, 0.022101265240018837, 0.01577350205110207, 0.013167710528193575, 0.0, 0.06221572785251998, 0.0, 0.09161353510793785, 0.028692312488088074, 0.0, 0.07114291171683573, 0.03180532980372987, 0.035801105987826036, 0.02464304641599132, 0.06645903218788973, 0.040701601090419946, 0.015260441571293233, 0.0, 0.027524730779350262, 0.0237730810563794, 0.11288029817133437, 0.0, 0.052336115802183045, 0.0, 0.0, 0.07173528789647293, 0.0, 0.029864710629631867, 0.0781947911106755, 0.03254259996148454, 0.0, 0.0, 0.0, 0.07966382564424948, 0.00910820446764051, 0.03659893073577005, 0.0, 0.07544265256981797, 0.0, 0.018432771071749014, 0.03468828698492575, 0.007064982096041728, 0.001218623252781915, 0.010446679429993392, 0.00695313632618606, 0.011171696744889445, 0.15538826881929155, 0.0, 0.03209989589559696, 0.013040523361046634, 0.08209062293488513, 0.024818030708884064, 0.11147282747111956, 0.05417107307361547, 0.05562656842984429, 0.049266592812165715, 0.031085309143634405, 0.11466146818847511, 0.09474818131570792, 0.007561891869164739, 0.04223425849364153, 0.07826097763819644, 0.001776938461026637, 0.0, 0.021181892020584275, 0.03603628893246876, 0.0, 0.05667255435881797, 0.0, 0.053730416780141656, 0.0, 0.04882684663976469, 0.039510680633379994, 0.031178700181241893, 0.004781854400347673, 0.044337760053694136, 0.015489108364443303, 0.02853312014747313, 0.025649994008157297, 0.0218338631082895, 0.04696076502986292, 0.03950083600692436, 0.030620241780990515, 0.0, 0.02204001454237531, 0.018499832802331282, 0.08131371294941574, 0.0, 0.0, 0.0, 0.0, 0.14457479595392825, 0.0024123524977675676, 0.10938783921546337, 0.013843308719392322, 0.0, 0.02513219368989019, 0.0, 0.02405653646227872, 0.004032656362518405, 0.02030251682007872, 0.0, 0.028298421549440917, 0.0, 0.0, 0.0, 0.07971117897333356, 0.03526245398478242, 0.0, 0.04239689082157861, 0.0009508524403550118, 0.05707654448748815, 0.0, 0.0, 0.0156515863772975, 0.0, 0.014240037028067138, 0.03935111658490117, 0.0, 0.03774708226071385, 0.00881512971277882, 0.04390183909312873, 0.057149088345868994, 0.0064124579520905365, 0.0, 0.029015067552687283, 0.04241158792523915, 0.0, 0.03712453016085396, 0.15106681572150854, 0.010115509124633309, 0.16731543251145406, 0.05609066259371728, 0.09700351540067054, 0.04244058564417208, 0.027965251906328117, 0.0, 0.08626918702424072, 0.034386550310448065, 0.028695439339694578, 0.0, 0.054225572204785875, 0.0, 0.028422817528446317, 0.0, 0.0, 0.028127656703997004, 0.0, 0.0, 0.09604671683128004, 0.0, 0.0, 0.0, 0.0, 0.09043899232465819, 0.0568464055059196, 0.011713786482480268, 0.0, 0.013973775926841186, 0.022922198953221864, 0.013049615560674766, 0.028825009942720248, 0.10754795287247833, 0.0, 0.03459610118190722, 0.052606255055455534, 0.016685630346353262, 0.011131297732022427, 0.03588141741417462, 0.0026561934196701617, 0.11170234919235655, 0.0, 0.01665326022334617, 0.0, 0.00235503514515643, 0.07106906575454383, 0.02430234574627871, 0.0, 0.0837396271522778, 0.0, 0.0, 0.0, 0.056223008615459966, 0.0, 0.015533370886319797, 0.0, 0.0, 0.04689598873944981, 0.0, 0.0, 0.04999573045241357, 0.034117197275627065, 0.0, 0.02008228779543885, 0.042912659136856476, 0.05334311520817247, 0.053100608492223735, 0.0, 0.01258394107518653, 0.0, 0.08697504448833467, 0.1351951332332922, 0.013517044957835527, 0.020653192777193057, 0.027426681003182077, 0.028323530978840113, 0.04528356508141335, 0.08318052445839569, 0.10051885353875742, 0.0, 0.04913570658857938, 0.0, 0.01102759912271065, 0.06764294651488918, 0.05834338796530791, 0.0, 0.0, 0.0, 0.0045447751824053955, 0.04410557104693688, 0.0, 0.028118222082579112, 0.009187075807613406, 0.03919071900969726, 0.0029559183661330016, 0.03356595676625986, 0.01658881847001056, 0.027523906263724918, 0.06661103141814477, 0.02537005067837796, 0.0, 0.0, 0.003745317454232082, 0.021943264617343257, 0.0, 0.00047375617476064555, 0.0, 0.0, 0.039852935717796134, 0.0, 0.023370971994777976, 0.014344498201693614, 0.025941210223699558, 0.04636201800271623, 0.0, 0.017130173802973343, 0.0, 0.0, 0.0, 0.0, 0.00035525215259352085, 0.028617367171629035, 0.040227883072034724, 0.020686394174150295, 0.0, 0.05317415708822453, 0.0, 0.003075765147758804, 0.0, 0.048869446613740895, 0.017751120800693732, 0.0, 0.0, 0.0, 0.03588927959868953, 0.0, 0.004563933906820025, 0.0, 0.0, 0.0, 0.02071745994047139, 0.0, 0.08804108461975871, 0.03484170546338834, 0.0, 0.0, 0.04666583624123167, 0.018170797001219874, 0.08917856474984659, 0.011761621905399927, 0.01992403035642095, 0.027733461640733943, 0.03758859729142775, 0.022319045498306926, 0.027459292173106963, 0.014287083979760373, 0.08230150970187936, 0.02640687682447553, 0.04921642801996571, 0.010669490134706068, 0.11379328477383491, 0.005413677795442844, 0.01636956264414159, 0.12320075574823947, 0.0, 0.03533035937957696, 0.0, 0.0730790005605442, 0.0], "feature_quality": 0.9267578125}, {"bbox": {"xc": 331.5, "yc": 387.0, "angle": null, "aspect": 0.45876288414001465, "height": 194.0, "confidence": 0.86328125}, "feature": [0.009234536144390015, 0.0, 0.014517390951002759, 0.06924937635613279, 0.0162199631554995, 0.0, 0.0, 0.0, 0.0, 0.0, 0.08129763967236317, 0.0021192182550187136, 0.056082567978569295, 0.013102758266628644, 0.13436325585278586, 0.0018991826605241407, 0.08665264601578322, 0.0, 0.0, 0.0, 0.040739089298463135, 0.0, 0.053729497887817744, 0.05949632463124769, 0.0, 0.0051716339249422965, 0.0, 0.0, 0.011101729085942768, 0.1823419891603576, 0.0, 0.02547818559971576, 0.01573327934805632, 0.0, 0.011132701606895723, 0.036647524085701016, 0.026945078167677758, 0.0, 0.06002550295833251, 0.01601433433261647, 0.028586019578549608, 0.030833360243470415, 0.03126244457624106, 0.0, 0.00907539174244052, 0.13155160942531668, 0.029999955394350748, 0.07133340258386033, 0.07671393272490046, 0.0, 0.0, 0.0311081605038765, 0.007143426839299023, 0.006148442492763528, 0.07382910194880497, 0.058563456914068626, 0.0, 0.061119891662264204, 0.03750302361312318, 0.006669909903346032, 0.026122439280587415, 0.05772278096455543, 0.0, 0.025874027986709004, 0.0, 0.0, 0.0, 0.0, 0.0, 0.008237312614496443, 0.037637345687987836, 0.014795174597809005, 0.0444455938644177, 0.058947818062610464, 0.001580673455503364, 0.05390592397295391, 0.03243087490862847, 0.0, 0.0, 0.06870781743568351, 0.0987938005979452, 0.02172205215774789, 0.11444890838511614, 0.06273103076544716, 0.0029945192043285603, 0.0, 0.0, 0.0697461516094205, 0.020057757760603093, 0.05928032167055184, 0.0515767051952473, 0.0, 0.07064391818806331, 0.009008035450323118, 0.0, 0.08894094151525331, 0.18823422594999628, 0.016240576001949638, 0.01911618050110817, 0.010534622043215671, 0.0, 0.011181402201375961, 0.05234504355719266, 0.08177771637682671, 0.038211688987679814, 0.05715470422263481, 0.0, 0.005270085347436106, 0.0, 0.0746774776386264, 0.0, 0.009701802958151214, 0.06743969019258389, 0.03528635831387704, 0.010071226794573594, 0.0012211047212915738, 0.030432226914707997, 0.08641581588867989, 0.030213980826114976, 0.016352021064925164, 0.02010534073567384, 0.13587162656415003, 0.005013854990941927, 0.018765919893019498, 0.0005251550204774953, 0.08237284739753524, 0.0, 0.0, 0.03694781658741445, 0.009285040708081812, 0.14926289499422332, 0.0, 0.057887973002356645, 0.01991124705994314, 0.057833512065955245, 0.005770213787663892, 0.029235774576608697, 0.0, 0.021913750183403184, 0.03476864544708725, 0.0, 0.016361313084180325, 0.0, 0.0, 0.0, 0.03378772272499272, 0.059030127445003695, 0.06349803324348659, 0.1022944685952912, 5.898799865809602e-05, 0.0001847839882275225, 0.0, 0.06371689205048528, 0.009262810600603818, 0.05333744751773859, 0.02803676354748484, 0.0, 0.09275086137743778, 0.0128579272993997, 0.012336222559048473, 0.0, 0.0, 0.0, 0.030200140753286364, 0.02395733699635618, 0.09146021870519916, 0.10143419091618187, 0.05411498454484726, 0.015621885564088993, 0.0, 0.0, 0.0, 0.0041298311864967855, 0.004042035607649308, 0.026630301318417298, 0.01915268458071493, 0.0699226092508694, 0.07866035239154578, 0.0, 0.032858749582744144, 0.0, 0.0, 0.00649066215791249, 0.015436216109013141, 0.024117395873951914, 0.0, 0.013311613722489197, 0.019897504285745472, 0.02518307096298419, 0.015478128151715485, 0.0, 0.025269235474916992, 0.0, 0.051545001619715904, 0.0490014260689613, 0.03557191664723426, 0.0, 0.0, 0.0, 0.04163900696575763, 0.02502476083105272, 0.03983617904084393, 0.005660335364131201, 0.05047084577163512, 0.0316357899419444, 0.03526434515604912, 0.0, 0.03652156443371209, 0.0, 0.03731963673133542, 0.0, 0.0, 0.0, 0.008795211130712502, 0.0286092792107307, 0.018401285384478386, 0.023074746374447917, 0.0, 0.08668667949907183, 0.05279903370979227, 0.0, 0.0831922543922626, 0.006433893666142077, 0.08815402174449034, 0.02818247219186269, 0.0, 0.02613965324918633, 0.006910683912118517, 0.06386399706170182, 0.12904721629621252, 0.0, 0.05405995559481657, 0.05312436877535652, 0.0, 0.0, 0.029021770182386292, 0.0, 0.0, 0.03201572531762465, 0.1523664373145247, 0.0011584757127426337, 0.020208123590802617, 0.07809438992257865, 0.018356405733532248, 0.006523399202686079, 0.05208227414101818, 0.07682085077184436, 0.02382438236171019, 0.0, 0.003542228318645955, 0.03918661075096855, 0.011041824685593955, 0.012559566306995146, 0.0, 0.019668494864815856, 0.008678206897309521, 0.007637978029961849, 0.0, 0.0, 0.024208322759415517, 0.0, 0.05189973664998163, 0.00779298000844122, 0.0, 0.017119349624862893, 0.007329559777718223, 0.010926020906921406, 0.019266535812536775, 0.16415193121458063, 0.0, 0.0604541902075012, 0.08166612273621203, 0.16830133388920718, 0.04072819974087558, 0.07839003049785587, 0.017239274132040558, 0.0, 0.008349609697915913, 0.0913632566749243, 0.04663252522798588, 0.0, 0.01907518227662888, 0.053177825169135745, 0.011403181282149342, 0.023102586931361562, 0.01875617425176872, 0.0, 0.0, 0.0, 0.0, 0.021505332605783602, 0.002018887424003206, 0.0, 0.0, 0.010726335847027332, 0.0005855333818516203, 0.035564327354020625, 0.013452890019773631, 0.02330561761782911, 0.0, 0.018605364003498128, 0.012897634344749432, 0.04324266985251426, 0.011862108682846179, 0.0, 0.0, 0.016290437605769384, 0.011907963949794485, 0.05029815385017303, 0.0, 0.04003686667109064, 0.006766553740800783, 0.0, 0.0, 0.0, 0.08411625478556212, 0.0029207612539759024, 0.005502695146422245, 0.022613874315978565, 0.020548050821315753, 0.0, 0.07864083481211695, 0.0, 0.06611410942275817, 0.0, 0.0, 0.0, 0.0, 0.022865683172861834, 0.029378990272280192, 0.009854343544236971, 0.016900227848591375, 0.1120308848839776, 0.05130379568391281, 0.09316363898560075, 0.008162942274449702, 0.023827606364994987, 0.05402376050410537, 0.0, 0.009800225782736604, 0.0, 0.03973317660637235, 0.020052788956193127, 0.0, 0.13183363871103262, 0.0, 0.12120601955675307, 0.06092445815808848, 0.07131243867343097, 0.0, 0.0, 0.0029290250633743284, 0.045794531565055474, 0.0, 0.009610815589754861, 0.0, 0.03522367958769995, 0.034660551927493836, 0.002152702954306095, 0.0, 0.0, 0.05399956207162031, 0.0, 0.0005916816445391436, 0.01294109001708324, 0.1565285992582686, 0.0, 0.003675551438985485, 0.018567846177344638, 0.0287258613784508, 0.024240436567012517, 0.02121417302691527, 0.008745095761544482, 0.028557908163284955, 0.0079390831067283, 0.02620278165281994, 0.0022739285019610475, 0.006904428530541268, 0.0, 0.03632419284599567, 0.0, 0.0, 0.10046717926861962, 0.031864128791228324, 0.018143258619139242, 0.016451330095959966, 0.0, 0.010299046936966873, 0.025441701242804458, 0.05778374250138099, 0.14214301245134323, 0.02025651256669456, 0.0, 0.10792073826239788, 0.019227484875522734, 0.06432292051785955, 0.0, 0.00450180056548008, 0.01682216936449331, 0.0, 0.0, 0.0, 0.07674748760411253, 0.024869069873078558, 0.04300752272875698, 0.025795400174135275, 0.0, 0.016836648452654878, 0.0, 0.0, 0.13227039911687694, 0.0, 0.0, 0.0, 0.0034516196260024655, 0.0, 0.06553297888613466, 8.626106069042748e-05, 0.0, 0.05502748792153901, 0.0, 0.008500214830153702, 0.0, 0.05230037559651115, 0.006865957440773798, 0.0, 0.003590040076984056, 0.0, 0.017897594039315453, 0.1009977986673195, 0.013829392331597192, 0.026020141603766995, 0.03529402649787252, 0.10900875785054183, 0.0, 0.013133847808908004, 0.050682883155696815, 0.0, 0.0, 0.024498969548201844, 0.0, 0.05045490457431666, 0.02553614665713842, 0.015606964687549083, 0.0, 0.0, 0.0008994332285872168, 0.06611855886285431, 0.0, 0.0, 0.04652317208557565, 0.025466430873220623, 0.014223041554855102, 0.0, 0.06308288891186822, 0.021642727476601186, 0.012924893739570143, 0.0, 0.0, 0.0, 0.0, 0.0, 0.049049496852033136, 0.05620224529463051, 0.0, 0.0, 0.01611916966291962, 0.0, 0.11450769779574818, 0.04498103086019569, 0.08614802901877996, 0.03216763740714836, 0.0, 0.015016430369729472, 0.012847334897090437, 0.045068236730448866, 0.08003336229941767, 0.02490882556774376, 0.008706476094137869, 0.022075465767417694, 0.0, 0.0, 0.013347536640003021, 0.004951337662156038, 0.0, 0.0, 0.0, 0.08600207055359294, 0.0, 0.0, 0.023410187349166712, 0.0, 0.0, 0.09341111410886792, 0.0209056574760407, 0.04239175913890284, 0.10698423105048296, 0.0, 0.04103982095886218, 0.0, 0.016354925560543482, 0.14079959710543472, 0.04453205290193606, 0.0, 0.04699254594063533, 0.05721407216566706, 0.031198230109510703, 0.03150848651697135, 0.0, 0.0, 0.05182151906947351, 0.03127070707079313], "feature_quality": 0.86328125}, {"bbox": {"xc": 686.5, "yc": 1038.5, "angle": null, "aspect": 1.7228915691375732, "height": 83.0, "confidence": 0.5986328125}, "feature": [0.006430684021418562, 0.033046188678213885, 0.05034406748365619, 0.0, 0.08189372846530255, 0.004664766851065584, 0.0, 0.00497593795740513, 0.10034924313054516, 0.0, 0.030048575345329284, 0.003260800930602242, 0.038869911201783514, 0.01271640317328567, 0.04987390117844973, 0.0, 0.0, 0.0, 0.0017954545216625284, 0.029573318408006005, 0.13677300610901458, 0.043836328578581725, 0.0, 0.045915362633327864, 0.008553721160254296, 0.06593103167839942, 0.0, 0.03258749702259974, 0.0, 0.0, 0.0, 0.0003863036597332952, 0.0, 0.049894412943689175, 0.0, 0.0125662543986348, 0.0, 0.04405435521176748, 0.014914207934970745, 0.02017636181222173, 0.0, 0.0, 0.004822285745891287, 0.04688068825761074, 0.008010850119663591, 0.05193147830173278, 0.033962564641230125, 0.0290722870364919, 0.0, 0.009917780494205351, 0.005984922592108475, 0.03282151479046842, 0.0, 0.002848151410113906, 0.0, 0.09252659146241621, 0.008607522052982422, 0.050196041187542624, 0.0, 0.0, 0.005572260117039223, 0.0, 0.09251384830026058, 0.05837892969632277, 0.04997322239578436, 0.03970733262139831, 0.052766022768017715, 0.01651764201509094, 0.0, 0.01702747628342921, 0.0, 0.02436370312911867, 0.0809968569193137, 0.05737663066173865, 0.019714374511222515, 0.07064814902731376, 0.006969957315797227, 0.0, 0.0927083784327638, 0.061014397201512374, 0.0521508646477315, 0.012065142190535776, 0.06456587586871963, 0.023803445486388745, 0.02545133657911384, 0.03842860563012536, 0.03569926404978476, 0.05666213474225423, 0.0, 0.03313174073058432, 0.04475391501763878, 0.024848065582276313, 0.11552732758784667, 0.04209530752183346, 0.08081409161901532, 0.044237667713563765, 0.05077585092015772, 0.051205097331532626, 0.0, 0.0, 6.176079448900484e-05, 0.0017959214047587476, 0.06784298273032106, 0.022887850943693364, 0.06967831728160499, 0.009250569831431459, 0.0, 0.01418918564121708, 0.0, 0.0, 0.0, 0.10888058706590809, 0.023905488202082242, 0.016981037738127366, 0.0217
gitextract_brqpx5l4/
├── .cargo/
│ └── config.toml
├── .dockerignore
├── .github/
│ └── workflows/
│ └── build.yml
├── .gitignore
├── Cargo.toml
├── LICENSE
├── README.md
├── assets/
│ ├── benchmarks/
│ │ └── benchmarks.md
│ └── documentation/
│ └── python/
│ └── api.md
├── benches/
│ ├── batch_sort_iou_tracker.rs
│ ├── batch_sort_maha_tracker.rs
│ ├── bbox_own_areas.rs
│ ├── feature_tracker.rs
│ ├── kalman_2d_point.rs
│ ├── kalman_bbox.rs
│ ├── nms.rs
│ ├── nms_oriented.rs
│ ├── simple_search.rs
│ ├── simple_sort_iou_tracker.rs
│ ├── simple_sort_iou_tracker_oriented.rs
│ ├── simple_sort_maha_tracker.rs
│ ├── simple_sort_maha_tracker_oriented.rs
│ ├── simple_visual_sort_tracker.rs
│ └── track_search.rs
├── build.rs
├── docker/
│ ├── Dockerfile.manylinux_2_28_ARM64
│ ├── Dockerfile.manylinux_2_28_X64
│ └── build-manylinux.sh
├── examples/
│ ├── batch_sort_iou_tracker.rs
│ ├── incremental_track_build.rs
│ ├── middleware_sort_tracker.rs
│ ├── simple.rs
│ ├── simple_sort_iou_tracker.rs
│ ├── simple_sort_iou_tracker_oriented.rs
│ ├── simple_sort_maha_tracker.rs
│ ├── simple_sort_maha_tracker_oriented.rs
│ └── track_merging.rs
├── pyproject.toml
├── python/
│ ├── bb.py
│ ├── bugfixes/
│ │ ├── bug_vs_1/
│ │ │ ├── bug_visual_sort.py
│ │ │ └── in/
│ │ │ ├── fixed-1/
│ │ │ │ ├── bug_vs_1.json
│ │ │ │ └── bug_vs_2.json
│ │ │ ├── in-1.json
│ │ │ └── in-2.json
│ │ └── github-84.py
│ ├── clipping_intersection.py
│ ├── kalman_2d_point.py
│ ├── kalman_2d_vec.py
│ ├── kalman_bbox.py
│ ├── motchallenge/
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── config.py
│ │ ├── config.yml
│ │ ├── confs/
│ │ │ ├── original-sort-config.yml
│ │ │ └── similari-maha-sort-config.yml
│ │ ├── evaluator.py
│ │ ├── requirements.txt
│ │ ├── trackers.py
│ │ └── utils.py
│ ├── nms.py
│ ├── sort/
│ │ ├── batch_sort_iou.py
│ │ ├── batch_sort_iou_bench.py
│ │ ├── sort_idle.py
│ │ ├── sort_iou.py
│ │ ├── sort_iou_bench.py
│ │ ├── sort_iou_rotated.py
│ │ ├── sort_iou_scene_id.py
│ │ └── sort_maha.py
│ ├── visual_sort/
│ │ ├── batch_visual_sort.py
│ │ └── visual_sort.py
│ └── visual_sort.py
└── src/
├── distance.rs
├── examples/
│ └── iou.rs
├── examples.rs
├── lib.rs
├── prelude.rs
├── track/
│ ├── builder.rs
│ ├── notify.rs
│ ├── store/
│ │ ├── builder.rs
│ │ ├── store_tests.rs
│ │ └── track_distance.rs
│ ├── store.rs
│ ├── utils.rs
│ ├── voting/
│ │ ├── best.rs
│ │ └── topn.rs
│ └── voting.rs
├── track.rs
├── trackers/
│ ├── batch.rs
│ ├── epoch_db.rs
│ ├── kalman_prediction.rs
│ ├── sort/
│ │ ├── batch_api.rs
│ │ ├── metric.rs
│ │ ├── simple_api.rs
│ │ └── voting.rs
│ ├── sort.rs
│ ├── spatio_temporal_constraints.rs
│ ├── tracker_api.rs
│ ├── visual_sort/
│ │ ├── batch_api.rs
│ │ ├── metric/
│ │ │ └── builder.rs
│ │ ├── metric.rs
│ │ ├── observation_attributes.rs
│ │ ├── options.rs
│ │ ├── simple_api.rs
│ │ ├── track_attributes.rs
│ │ ├── visual_sort_py.rs
│ │ └── voting.rs
│ └── visual_sort.rs
├── trackers.rs
├── utils/
│ ├── bbox.rs
│ ├── clipping/
│ │ ├── bbox_own_areas.rs
│ │ └── clipping_py.rs
│ ├── clipping.rs
│ ├── kalman/
│ │ ├── kalman_2d_box.rs
│ │ ├── kalman_2d_point.rs
│ │ └── kalman_2d_point_vec.rs
│ ├── kalman.rs
│ ├── nms/
│ │ └── nms_py.rs
│ ├── nms.rs
│ ├── point.rs
│ └── primitive.rs
└── utils.rs
SYMBOL INDEX (1114 symbols across 83 files)
FILE: benches/batch_sort_iou_tracker.rs
function batch_sort_iou_00010 (line 16) | fn batch_sort_iou_00010(b: &mut Bencher) {
function batch_sort_iou_00100 (line 21) | fn batch_sort_iou_00100(b: &mut Bencher) {
function batch_sort_iou_00500 (line 26) | fn batch_sort_iou_00500(b: &mut Bencher) {
function bench_batch_sort (line 30) | fn bench_batch_sort(objects: usize, b: &mut Bencher) {
FILE: benches/batch_sort_maha_tracker.rs
function batch_sort_maha_00010 (line 15) | fn batch_sort_maha_00010(b: &mut Bencher) {
function batch_sort_maha_00100 (line 20) | fn batch_sort_maha_00100(b: &mut Bencher) {
function batch_sort_maha_00500 (line 25) | fn batch_sort_maha_00500(b: &mut Bencher) {
function bench_batch_sort (line 29) | fn bench_batch_sort(objects: usize, b: &mut Bencher) {
FILE: benches/bbox_own_areas.rs
function bbox_own_areas_00010 (line 12) | fn bbox_own_areas_00010(b: &mut Bencher) {
function bbox_own_areas_00025 (line 17) | fn bbox_own_areas_00025(b: &mut Bencher) {
function bbox_own_areas_00050 (line 22) | fn bbox_own_areas_00050(b: &mut Bencher) {
function bbox_own_areas_00100 (line 27) | fn bbox_own_areas_00100(b: &mut Bencher) {
function bench_bbox_own_areas (line 31) | fn bench_bbox_own_areas(objects: usize, b: &mut Bencher) {
FILE: benches/feature_tracker.rs
constant FEAT0 (line 17) | const FEAT0: u64 = 0;
type NoopAttributes (line 20) | struct NoopAttributes;
type Update (line 32) | type Update = NoopAttributesUpdate;
type Lookup (line 33) | type Lookup = NoopLookup<NoopAttributes, ()>;
method compatible (line 35) | fn compatible(&self, _other: &NoopAttributes) -> bool {
method merge (line 39) | fn merge(&mut self, _other: &NoopAttributes) -> anyhow::Result<()> {
method baked (line 43) | fn baked(&self, _observations: &ObservationsDb<()>) -> anyhow::Result<...
type NoopAttributesUpdate (line 23) | struct NoopAttributesUpdate;
method apply (line 26) | fn apply(&self, _attrs: &mut NoopAttributes) -> anyhow::Result<()> {
type TrackMetric (line 49) | pub struct TrackMetric;
method metric (line 52) | fn metric(&self, mq: &MetricQuery<NoopAttributes, ()>) -> MetricOutput...
method optimize (line 63) | fn optimize(
method postprocess_distances (line 78) | fn postprocess_distances(
function benchmark (line 95) | fn benchmark(objects: usize, flen: usize, b: &mut Bencher) {
function ft_0010_256x3 (line 169) | fn ft_0010_256x3(b: &mut Bencher) {
function ft_0100_256x3 (line 174) | fn ft_0100_256x3(b: &mut Bencher) {
function ft_0500_256x3 (line 179) | fn ft_0500_256x3(b: &mut Bencher) {
FILE: benches/kalman_2d_point.rs
function kalman_2d_point_100k (line 11) | fn kalman_2d_point_100k(b: &mut Bencher) {
FILE: benches/kalman_bbox.rs
function kalman_2d_box_100k (line 11) | fn kalman_2d_box_100k(b: &mut Bencher) {
FILE: benches/nms.rs
function nms_00010 (line 10) | fn nms_00010(b: &mut Bencher) {
function nms_00100 (line 15) | fn nms_00100(b: &mut Bencher) {
function nms_00300 (line 20) | fn nms_00300(b: &mut Bencher) {
function nms_00500 (line 25) | fn nms_00500(b: &mut Bencher) {
function nms_01000 (line 30) | fn nms_01000(b: &mut Bencher) {
function bench_nms (line 34) | fn bench_nms(objects: usize, b: &mut Bencher) {
FILE: benches/nms_oriented.rs
function nms_oriented_00010 (line 11) | fn nms_oriented_00010(b: &mut Bencher) {
function nms_oriented_00100 (line 16) | fn nms_oriented_00100(b: &mut Bencher) {
function nms_oriented_00300 (line 21) | fn nms_oriented_00300(b: &mut Bencher) {
function nms_oriented_00500 (line 26) | fn nms_oriented_00500(b: &mut Bencher) {
function nms_oriented_01000 (line 31) | fn nms_oriented_01000(b: &mut Bencher) {
function bench_nms (line 35) | fn bench_nms(objects: usize, b: &mut Bencher) {
FILE: benches/simple_search.rs
function simple_0512_0001k (line 14) | fn simple_0512_0001k(b: &mut Bencher) {
function simple_0512_0010k (line 19) | fn simple_0512_0010k(b: &mut Bencher) {
function simple_0128_001k (line 24) | fn simple_0128_001k(b: &mut Bencher) {
function simple_0128_010k (line 29) | fn simple_0128_010k(b: &mut Bencher) {
function bench_capacity_len (line 33) | fn bench_capacity_len(vec_len: usize, count: usize, b: &mut Bencher) {
FILE: benches/simple_sort_iou_tracker.rs
function sort_iou_00010 (line 15) | fn sort_iou_00010(b: &mut Bencher) {
function sort_iou_00100 (line 20) | fn sort_iou_00100(b: &mut Bencher) {
function sort_iou_00500 (line 25) | fn sort_iou_00500(b: &mut Bencher) {
function bench_sort (line 29) | fn bench_sort(objects: usize, b: &mut Bencher) {
FILE: benches/simple_sort_iou_tracker_oriented.rs
function sort_iou_oriented_00010 (line 17) | fn sort_iou_oriented_00010(b: &mut Bencher) {
function sort_iou_oriented_00100 (line 22) | fn sort_iou_oriented_00100(b: &mut Bencher) {
function sort_iou_oriented_00500 (line 27) | fn sort_iou_oriented_00500(b: &mut Bencher) {
function bench_sort (line 31) | fn bench_sort(objects: usize, b: &mut Bencher) {
FILE: benches/simple_sort_maha_tracker.rs
function sort_maha_00010 (line 14) | fn sort_maha_00010(b: &mut Bencher) {
function sort_maha_00100 (line 19) | fn sort_maha_00100(b: &mut Bencher) {
function sort_maha_00500 (line 24) | fn sort_maha_00500(b: &mut Bencher) {
function bench_sort (line 28) | fn bench_sort(objects: usize, b: &mut Bencher) {
FILE: benches/simple_sort_maha_tracker_oriented.rs
function sort_maha_oriented_00010 (line 15) | fn sort_maha_oriented_00010(b: &mut Bencher) {
function sort_maha_oriented_00100 (line 20) | fn sort_maha_oriented_00100(b: &mut Bencher) {
function sort_maha_oriented_00500 (line 25) | fn sort_maha_oriented_00500(b: &mut Bencher) {
function bench_sort (line 29) | fn bench_sort(objects: usize, b: &mut Bencher) {
FILE: benches/simple_visual_sort_tracker.rs
function visual_sort_iou_00010x3x0128 (line 16) | fn visual_sort_iou_00010x3x0128(b: &mut Bencher) {
function visual_sort_iou_00050x3x0128 (line 21) | fn visual_sort_iou_00050x3x0128(b: &mut Bencher) {
function visual_sort_iou_00100x3x0128 (line 26) | fn visual_sort_iou_00100x3x0128(b: &mut Bencher) {
function visual_sort_iou_00010x3x0256 (line 31) | fn visual_sort_iou_00010x3x0256(b: &mut Bencher) {
function visual_sort_iou_00050x3x0256 (line 36) | fn visual_sort_iou_00050x3x0256(b: &mut Bencher) {
function visual_sort_iou_00100x3x0256 (line 41) | fn visual_sort_iou_00100x3x0256(b: &mut Bencher) {
function visual_sort_iou_00010x3x0512 (line 46) | fn visual_sort_iou_00010x3x0512(b: &mut Bencher) {
function visual_sort_iou_00050x3x0512 (line 51) | fn visual_sort_iou_00050x3x0512(b: &mut Bencher) {
function visual_sort_iou_00100x3x0512 (line 56) | fn visual_sort_iou_00100x3x0512(b: &mut Bencher) {
function visual_sort_iou_00010x3x1024 (line 61) | fn visual_sort_iou_00010x3x1024(b: &mut Bencher) {
function visual_sort_iou_00050x3x1024 (line 66) | fn visual_sort_iou_00050x3x1024(b: &mut Bencher) {
function visual_sort_iou_00100x3x1024 (line 71) | fn visual_sort_iou_00100x3x1024(b: &mut Bencher) {
function visual_sort_iou_00010x3x2048 (line 76) | fn visual_sort_iou_00010x3x2048(b: &mut Bencher) {
function visual_sort_iou_00050x3x2048 (line 81) | fn visual_sort_iou_00050x3x2048(b: &mut Bencher) {
function visual_sort_iou_00100x3x2048 (line 86) | fn visual_sort_iou_00100x3x2048(b: &mut Bencher) {
function bench_visual_sort (line 90) | fn bench_visual_sort(objects: usize, len: usize, b: &mut Bencher) {
FILE: benches/track_search.rs
function bench_capacity_len (line 14) | fn bench_capacity_len(vec_len: usize, track_len: usize, count: usize, b:...
function track_0256_030_100 (line 59) | fn track_0256_030_100(b: &mut Bencher) {
function track_0512_030_100 (line 64) | fn track_0512_030_100(b: &mut Bencher) {
function track_1024_030_100 (line 69) | fn track_1024_030_100(b: &mut Bencher) {
function track_0256_030_01k (line 74) | fn track_0256_030_01k(b: &mut Bencher) {
FILE: build.rs
function main (line 1) | fn main() {
FILE: examples/batch_sort_iou_tracker.rs
function main (line 10) | fn main() {
FILE: examples/incremental_track_build.rs
constant FEAT0 (line 14) | const FEAT0: u64 = 0;
constant MAX_DIST (line 15) | const MAX_DIST: f32 = 0.1;
type BBoxAttributes (line 18) | struct BBoxAttributes {
type Update (line 35) | type Update = BBoxAttributesUpdate;
type Lookup (line 36) | type Lookup = NoopLookup<BBoxAttributes, f32>;
method compatible (line 38) | fn compatible(&self, _other: &BBoxAttributes) -> bool {
method merge (line 42) | fn merge(&mut self, other: &BBoxAttributes) -> anyhow::Result<()> {
method baked (line 47) | fn baked(&self, _observations: &ObservationsDb<f32>) -> anyhow::Result...
type BBoxAttributesUpdate (line 23) | struct BBoxAttributesUpdate {
method apply (line 28) | fn apply(&self, attrs: &mut BBoxAttributes) -> anyhow::Result<()> {
type TrackMetric (line 53) | pub struct TrackMetric;
method metric (line 56) | fn metric(&self, mq: &MetricQuery<BBoxAttributes, f32>) -> MetricOutpu...
method optimize (line 67) | fn optimize(
method postprocess_distances (line 82) | fn postprocess_distances(
function main (line 93) | fn main() {
FILE: examples/middleware_sort_tracker.rs
constant FEAT0 (line 12) | const FEAT0: u64 = 0;
constant BBOX_HISTORY (line 13) | const BBOX_HISTORY: usize = 100;
function main (line 15) | fn main() {
FILE: examples/simple.rs
function main (line 8) | fn main() {
FILE: examples/simple_sort_iou_tracker.rs
function main (line 9) | fn main() {
FILE: examples/simple_sort_iou_tracker_oriented.rs
function main (line 9) | fn main() {
FILE: examples/simple_sort_maha_tracker.rs
function main (line 8) | fn main() {
FILE: examples/simple_sort_maha_tracker_oriented.rs
function main (line 8) | fn main() {
FILE: examples/track_merging.rs
constant FEATURE0 (line 22) | const FEATURE0: u64 = 0;
type AppErrors (line 25) | enum AppErrors {
type Gender (line 35) | enum Gender {
type CamTrackingAttributes (line 44) | struct CamTrackingAttributes {
method get_age (line 56) | pub fn get_age(&self) -> Option<u8> {
method get_gender (line 64) | pub fn get_gender(&self) -> Gender {
type Update (line 219) | type Update = CamTrackingAttributesUpdate;
type Lookup (line 220) | type Lookup = NoopLookup<CamTrackingAttributes, f32>;
method compatible (line 222) | fn compatible(&self, other: &CamTrackingAttributes) -> bool {
method merge (line 227) | fn merge(&mut self, other: &CamTrackingAttributes) -> Result<()> {
method baked (line 240) | fn baked(&self, _observations: &ObservationsDb<f32>) -> Result<TrackSt...
function test_attributes_age_gender (line 77) | fn test_attributes_age_gender() {
type CamTrackingAttributesUpdate (line 94) | enum CamTrackingAttributesUpdate {
method apply (line 106) | fn apply(&self, attrs: &mut CamTrackingAttributes) -> Result<()> {
function cam_tracking_attributes_update_test (line 163) | fn cam_tracking_attributes_update_test() {
function feat_gen (line 206) | fn feat_gen() {
type CamTrackingAttributesMetric (line 251) | pub struct CamTrackingAttributesMetric {
method metric (line 268) | fn metric(&self, mq: &MetricQuery<CamTrackingAttributes, f32>) -> Metr...
method optimize (line 279) | fn optimize(
method default (line 258) | fn default() -> Self {
type TrackObservation (line 300) | struct TrackObservation {
method new (line 311) | pub fn new(
function main (line 331) | fn main() {
FILE: python/bugfixes/bug_vs_1/bug_visual_sort.py
function main (line 14) | def main():
FILE: python/bugfixes/github-84.py
function create_detections (line 151) | def create_detections(boxes):
function main (line 167) | def main():
FILE: python/motchallenge/__main__.py
function main (line 17) | def main(config_file_path: str):
FILE: python/motchallenge/config.py
class TrackerType (line 7) | class TrackerType(Enum):
class Tracker (line 16) | class Tracker:
class OriginalSortParams (line 24) | class OriginalSortParams:
class PositionalMetricType (line 39) | class PositionalMetricType(Enum):
class PositionalMetric (line 47) | class PositionalMetric:
class SortParams (line 55) | class SortParams:
class VisualSortParams (line 87) | class VisualSortParams:
class Evaluator (line 94) | class Evaluator:
class ConfigSchema (line 102) | class ConfigSchema:
class Config (line 113) | class Config(ConfigSchema):
class ConfigException (line 119) | class ConfigException(Exception):
function load_config (line 123) | def load_config(config_file_path: str) -> Config:
FILE: python/motchallenge/evaluator.py
function evaluate (line 6) | def evaluate(
FILE: python/motchallenge/trackers.py
class Tracker (line 23) | class Tracker:
method process_frame (line 25) | def process_frame(
class OriginalSort (line 34) | class OriginalSort(Tracker):
method __init__ (line 35) | def __init__(self, params: OriginalSortParams):
method process_frame (line 38) | def process_frame(
class SimilariTracker (line 58) | class SimilariTracker(Tracker):
method __init__ (line 59) | def __init__(self, params: Union[SortParams, VisualSortParams]):
method process_frame (line 90) | def process_frame(
FILE: python/motchallenge/utils.py
function read_detections (line 6) | def read_detections(
function write_csv (line 25) | def write_csv(file_path: Union[str, Path], rows: List[Tuple]):
FILE: python/sort/batch_sort_iou_bench.py
function bench (line 8) | def bench(n):
FILE: python/sort/sort_iou_bench.py
function bench (line 7) | def bench(n):
FILE: python/visual_sort/batch_visual_sort.py
function get_opts (line 12) | def get_opts():
function build_observation (line 45) | def build_observation(obj):
function generate_objs (line 71) | def generate_objs(n_objs):
function build_prediction_request (line 79) | def build_prediction_request(objs, n_batches):
function main (line 95) | def main(n_frames=10, n_objs=6, n_batches=2):
FILE: python/visual_sort/visual_sort.py
function get_opts (line 10) | def get_opts():
FILE: src/distance.rs
function euclidean (line 9) | pub fn euclidean(f1: &Feature, f2: &Feature) -> f32 {
function cosine (line 26) | pub fn cosine(f1: &Feature, f2: &Feature) -> f32 {
function euclidean_distances (line 57) | fn euclidean_distances() {
function cosine_distances (line 68) | fn cosine_distances() {
FILE: src/examples.rs
type AppError (line 18) | pub enum AppError {
type SimpleAttrs (line 26) | pub struct SimpleAttrs {
type Update (line 44) | type Update = SimpleAttributeUpdate;
type Lookup (line 45) | type Lookup = NoopLookup<SimpleAttrs, f32>;
method compatible (line 47) | fn compatible(&self, other: &SimpleAttrs) -> bool {
method merge (line 51) | fn merge(&mut self, other: &SimpleAttrs) -> Result<()> {
method baked (line 59) | fn baked(&self, _observations: &ObservationsDb<f32>) -> Result<TrackSt...
type SimpleAttributeUpdate (line 31) | pub struct SimpleAttributeUpdate;
method apply (line 34) | fn apply(&self, attrs: &mut SimpleAttrs) -> Result<()> {
type SimpleMetric (line 69) | pub struct SimpleMetric;
method metric (line 72) | fn metric(&self, mq: &MetricQuery<'_, SimpleAttrs, f32>) -> MetricOutp...
method optimize (line 83) | fn optimize(
type UnboundAttrs (line 97) | pub struct UnboundAttrs;
type Update (line 109) | type Update = UnboundAttributeUpdate;
type Lookup (line 110) | type Lookup = NoopLookup<UnboundAttrs, f32>;
method compatible (line 112) | fn compatible(&self, _other: &UnboundAttrs) -> bool {
method merge (line 116) | fn merge(&mut self, _other: &UnboundAttrs) -> Result<()> {
method baked (line 120) | fn baked(&self, _observations: &ObservationsDb<f32>) -> Result<TrackSt...
type UnboundAttributeUpdate (line 100) | pub struct UnboundAttributeUpdate;
method apply (line 103) | fn apply(&self, _attrs: &mut UnboundAttrs) -> Result<()> {
type UnboundMetric (line 126) | pub struct UnboundMetric;
method metric (line 129) | fn metric(&self, mq: &MetricQuery<'_, UnboundAttrs, f32>) -> MetricOut...
method optimize (line 140) | fn optimize(
function vec2 (line 153) | pub fn vec2(x: f32, y: f32) -> Feature {
type FeatGen2 (line 157) | pub struct FeatGen2 {
method new (line 165) | pub fn new(x: f32, y: f32, drift: f32) -> Self {
type Item (line 176) | type Item = Observation<f32>;
method next (line 178) | fn next(&mut self) -> Option<Self::Item> {
type BoxGen2 (line 188) | pub struct BoxGen2 {
method new (line 199) | pub fn new(x: f32, y: f32, width: f32, height: f32, pos_drift: f32, bo...
method new_monotonous (line 210) | pub fn new_monotonous(
type Item (line 231) | type Item = BoundingBox;
method next (line 233) | fn next(&mut self) -> Option<Self::Item> {
function current_time_span (line 252) | pub fn current_time_span() -> Duration {
function current_time_ms (line 257) | pub fn current_time_ms() -> u128 {
function current_time_sec (line 262) | pub fn current_time_sec() -> u64 {
type FeatGen (line 266) | pub struct FeatGen {
method new (line 274) | pub fn new(x: f32, len: usize, drift: f32) -> Self {
type Item (line 285) | type Item = Observation<()>;
method next (line 287) | fn next(&mut self) -> Option<Self::Item> {
FILE: src/examples/iou.rs
type BBoxAttributes (line 9) | pub struct BBoxAttributes {
type Update (line 23) | type Update = BBoxAttributesUpdate;
type Lookup (line 24) | type Lookup = NoopLookup<BBoxAttributes, BoundingBox>;
method compatible (line 26) | fn compatible(&self, _other: &BBoxAttributes) -> bool {
method merge (line 30) | fn merge(&mut self, other: &BBoxAttributes) -> Result<()> {
method baked (line 35) | fn baked(&self, _observations: &ObservationsDb<BoundingBox>) -> Result...
type BBoxAttributesUpdate (line 14) | pub struct BBoxAttributesUpdate;
method apply (line 17) | fn apply(&self, _attrs: &mut BBoxAttributes) -> Result<()> {
type IOUMetric (line 41) | pub struct IOUMetric {
method metric (line 52) | fn metric(&self, mq: &MetricQuery<'_, BBoxAttributes, BoundingBox>) ->...
method optimize (line 67) | fn optimize(
method default (line 46) | fn default() -> Self {
FILE: src/lib.rs
type Errors (line 44) | pub enum Errors {
constant EPS (line 80) | pub const EPS: f32 = 0.00001;
function version (line 113) | pub fn version() -> String {
function similari (line 119) | fn similari(m: &Bound<'_, PyModule>) -> PyResult<()> {
FILE: src/track.rs
type ObservationMetricOk (line 20) | pub struct ObservationMetricOk<OA>
function new (line 38) | pub fn new(
type Feature (line 55) | pub type Feature = Vec<f32x8>;
constant FEATURE_LANES_SIZE (line 58) | const FEATURE_LANES_SIZE: usize = 8;
type Observation (line 67) | pub struct Observation<T>(pub(crate) Option<T>, pub(crate) Option<Feature>)
function new (line 75) | pub fn new(attrs: Option<T>, feature: Option<Feature>) -> Self {
function attr (line 81) | pub fn attr(&self) -> &Option<T> {
function attr_mut (line 87) | pub fn attr_mut(&mut self) -> &mut Option<T> {
function feature (line 93) | pub fn feature(&self) -> &Option<Feature> {
function feature_mut (line 99) | pub fn feature_mut(&mut self) -> &mut Option<Feature> {
type ObservationsDb (line 108) | pub type ObservationsDb<T> = HashMap<u64, Vec<Observation<T>>>;
type ObservationAttributes (line 112) | pub trait ObservationAttributes: Send + Sync + Clone + 'static {
method calculate_metric_object (line 114) | fn calculate_metric_object(l: &Option<&Self>, r: &Option<&Self>) -> Op...
type MetricOutput (line 125) | pub type MetricOutput<T> = Option<(Option<T>, Option<f32>)>;
type MetricQuery (line 134) | pub struct MetricQuery<'a, TA, OA: ObservationAttributes> {
type ObservationMetric (line 152) | pub trait ObservationMetric<TA, OA: ObservationAttributes>: Send + Sync ...
method metric (line 158) | fn metric(&self, mq: &'_ MetricQuery<'_, TA, OA>) -> MetricOutput<OA::...
method optimize (line 176) | fn optimize(
method postprocess_distances (line 191) | fn postprocess_distances(
type TrackStatus (line 204) | pub enum TrackStatus {
type LookupRequest (line 215) | pub trait LookupRequest<TA, OA>: Send + Sync + Clone + 'static
method lookup (line 220) | fn lookup(
type NoopLookup (line 236) | pub struct NoopLookup<TA, OA, const RES: bool = false>
method clone (line 250) | fn clone(&self) -> Self {
method default (line 263) | fn default() -> Self {
function lookup (line 276) | fn lookup(
type TrackAttributes (line 291) | pub trait TrackAttributes<TA: TrackAttributes<TA, OA>, OA: ObservationAt...
method compatible (line 304) | fn compatible(&self, other: &TA) -> bool;
method merge (line 312) | fn merge(&mut self, other: &TA) -> Result<()>;
method baked (line 322) | fn baked(&self, observations: &ObservationsDb<OA>) -> Result<TrackStat...
type TrackAttributesUpdate (line 329) | pub trait TrackAttributesUpdate<TA>: Clone + Send + Sync + 'static {
method apply (line 332) | fn apply(&self, attrs: &mut TA) -> Result<()>;
type Track (line 344) | pub struct Track<TA, M, OA, N = NoopNotifier>
function new (line 372) | pub fn new(track_id: u64, metric: M, attributes: TA, notifier: N) -> Self {
function get_track_id (line 387) | pub fn get_track_id(&self) -> u64 {
function set_track_id (line 393) | pub fn set_track_id(&mut self, track_id: u64) -> u64 {
function get_attributes (line 401) | pub fn get_attributes(&self) -> &TA {
function get_observations (line 405) | pub fn get_observations(&self, feature_class: u64) -> Option<&Vec<Observ...
function get_mut_observations (line 409) | pub fn get_mut_observations(
function get_merge_history (line 418) | pub fn get_merge_history(&self) -> &Vec<u64> {
function get_feature_classes (line 424) | pub fn get_feature_classes(&self) -> Vec<u64> {
function update_attributes (line 428) | fn update_attributes(&mut self, update: &TA::Update) -> Result<()> {
function add_observation (line 447) | pub fn add_observation(
function merge (line 522) | pub fn merge(&mut self, other: &Self, classes: &[u64], merge_history: bo...
function distances (line 604) | pub fn distances(
function lookup (line 654) | pub fn lookup(&self, query: &TA::Lookup) -> bool {
type DefaultAttrs (line 674) | pub struct DefaultAttrs;
type Update (line 686) | type Update = DefaultAttrUpdates;
type Lookup (line 687) | type Lookup = NoopLookup<DefaultAttrs, f32>;
method compatible (line 689) | fn compatible(&self, _other: &DefaultAttrs) -> bool {
method merge (line 693) | fn merge(&mut self, _other: &DefaultAttrs) -> Result<()> {
method baked (line 697) | fn baked(&self, _observations: &ObservationsDb<f32>) -> Result<TrackSt...
type DefaultAttrUpdates (line 677) | pub struct DefaultAttrUpdates;
method apply (line 680) | fn apply(&self, _attrs: &mut DefaultAttrs) -> Result<()> {
type DefaultMetric (line 703) | struct DefaultMetric;
method metric (line 705) | fn metric(&self, mq: &MetricQuery<'_, DefaultAttrs, f32>) -> MetricOut...
method optimize (line 716) | fn optimize(
function init (line 732) | fn init() {
function track_distances (line 738) | fn track_distances() -> Result<()> {
function merge_same (line 783) | fn merge_same() -> Result<()> {
function merge_other_feature_class (line 806) | fn merge_other_feature_class() -> Result<()> {
function attribute_compatible_match (line 830) | fn attribute_compatible_match() -> Result<()> {
function get_classes (line 940) | fn get_classes() -> Result<()> {
function attr_metric_update_recover (line 964) | fn attr_metric_update_recover() {
function merge_history (line 1107) | fn merge_history() -> Result<()> {
function unit_track (line 1136) | fn unit_track() {
function lookup (line 1199) | fn lookup() {
FILE: src/track/builder.rs
type TrackBuilderObservationRepr (line 6) | type TrackBuilderObservationRepr<OA, TAU> = (u64, Option<OA>, Option<Fea...
type ObservationBuilder (line 10) | pub struct ObservationBuilder<TAU, OA>
function new (line 31) | pub fn new(feature_class: u64) -> Self {
function observation_attributes (line 42) | pub fn observation_attributes(mut self, attrs: OA) -> Self {
function observation (line 49) | pub fn observation(mut self, observation: Feature) -> Self {
function track_attributes_update (line 56) | pub fn track_attributes_update(mut self, upd: TAU) -> Self {
function build (line 63) | pub fn build(self) -> TrackBuilderObservationRepr<OA, TAU> {
type TrackBuilder (line 75) | pub struct TrackBuilder<TA, M, OA, N = NoopNotifier>
method default (line 96) | fn default() -> Self {
function new (line 114) | pub fn new(id: u64) -> TrackBuilder<TA, M, OA, N> {
function attributes (line 124) | pub fn attributes(mut self, track_attrs: TA) -> Self {
function metric (line 133) | pub fn metric(mut self, metric: M) -> Self {
function notifier (line 142) | pub fn notifier(mut self, notifier: N) -> Self {
function observation (line 156) | pub fn observation(mut self, observation: TrackBuilderObservationRepr<OA...
function build (line 168) | pub fn build(self) -> Result<Track<TA, M, OA, N>> {
function builder_id (line 192) | fn builder_id() -> Result<()> {
function builder_noid (line 210) | fn builder_noid() -> Result<()> {
FILE: src/track/notify.rs
type ChangeNotifier (line 1) | pub trait ChangeNotifier: Clone + Sync + Send + 'static {
method send (line 2) | fn send(&mut self, id: u64);
method send (line 9) | fn send(&mut self, _id: u64) {}
type NoopNotifier (line 6) | pub struct NoopNotifier;
FILE: src/track/store.rs
type Commands (line 22) | enum Commands<TA, M, OA, N>
type StoreMutexGuard (line 50) | pub type StoreMutexGuard<'a, TA, M, FA, N> = MutexGuard<'a, HashMap<u64,...
type OwnedMergeResult (line 55) | pub type OwnedMergeResult<TA, M, FA, N> = Result<Option<Track<TA, M, FA,...
type Results (line 58) | pub enum Results<OA>
type FutureMergeResponse (line 71) | pub struct FutureMergeResponse<OA>
function get (line 83) | pub fn get(&self) -> Result<()> {
function is_ready (line 92) | pub fn is_ready(&self) -> bool {
type ObservationMetricErr (line 98) | pub type ObservationMetricErr<OA> = Result<Vec<ObservationMetricOk<OA>>>;
type TrackStore (line 113) | pub struct TrackStore<TA, M, OA, N = NoopNotifier>
method drop (line 138) | fn drop(&mut self) {
function handle_store_ops (line 167) | fn handle_store_ops(
function new (line 318) | pub fn new(metric: M, default_attributes: TA, notifier: N, shards: usize...
function find_usable (line 355) | pub fn find_usable(&mut self) -> Vec<(u64, Result<TrackStatus>)> {
function shard_stats (line 378) | pub fn shard_stats(&self) -> Vec<usize> {
function fetch_tracks (line 388) | pub fn fetch_tracks(&mut self, tracks: &[u64]) -> Vec<Track<TA, M, OA, N...
function new_track (line 403) | pub fn new_track(&self, track_id: u64) -> TrackBuilder<TA, M, OA, N> {
function new_track_random_id (line 414) | pub fn new_track_random_id(&self) -> TrackBuilder<TA, M, OA, N> {
function foreign_track_distances (line 429) | pub fn foreign_track_distances(
function owned_track_distances (line 471) | pub fn owned_track_distances(
function get_store (line 490) | pub fn get_store(&self, id: usize) -> StoreMutexGuard<'_, TA, M, OA, N> {
function get_executor (line 497) | pub fn get_executor(&self, id: usize) -> usize {
function add_track (line 510) | pub fn add_track(&mut self, track: Track<TA, M, OA, N>) -> Result<u64> {
function add (line 530) | pub fn add(
function merge_owned (line 584) | pub fn merge_owned(
function merge_external_noblock (line 625) | pub fn merge_external_noblock(
function merge_external (line 677) | pub fn merge_external(
function lookup (line 697) | pub fn lookup(&self, q: TA::Lookup) -> Vec<(u64, Result<TrackStatus>)> {
function clear (line 720) | pub fn clear(&self) {
FILE: src/track/store/builder.rs
type TrackStoreBuilder (line 8) | pub struct TrackStoreBuilder<TA, M, OA, N = NoopNotifier>
method default (line 32) | fn default() -> TrackStoreBuilder<TA, M, OA, N> {
function new (line 49) | pub fn new(shards: usize) -> Self {
function metric (line 61) | pub fn metric(mut self, metric: M) -> Self {
function notifier (line 72) | pub fn notifier(mut self, notifier: N) -> Self {
function default_attributes (line 83) | pub fn default_attributes(mut self, attrs: TA) -> Self {
function build (line 94) | pub fn build(self) -> TrackStore<TA, M, OA, N> {
FILE: src/track/store/store_tests.rs
type TimeAttrs (line 19) | pub struct TimeAttrs {
type Update (line 41) | type Update = TimeAttrUpdates;
type Lookup (line 42) | type Lookup = NoopLookup<TimeAttrs, f32>;
method compatible (line 44) | fn compatible(&self, other: &TimeAttrs) -> bool {
method merge (line 48) | fn merge(&mut self, other: &TimeAttrs) -> Result<()> {
method baked (line 54) | fn baked(&self, _observations: &ObservationsDb<f32>) -> Result<TrackSt...
type TimeAttrUpdates (line 26) | pub struct TimeAttrUpdates {
method apply (line 31) | fn apply(&self, attrs: &mut TimeAttrs) -> Result<()> {
type TimeMetric (line 64) | struct TimeMetric {
method metric (line 69) | fn metric(&self, mq: &MetricQuery<TimeAttrs, f32>) -> MetricOutput<f32> {
method optimize (line 80) | fn optimize(
function new_default_store (line 96) | fn new_default_store() -> Result<()> {
function new_store_10_shards (line 107) | fn new_store_10_shards() -> Result<()> {
function time_attrs_current_ts (line 130) | fn time_attrs_current_ts() -> Option<TimeAttrUpdates> {
function sharding_n_fetch (line 137) | fn sharding_n_fetch() -> Result<()> {
function general_ops (line 182) | fn general_ops() -> Result<()> {
function baked_similarity (line 298) | fn baked_similarity() -> Result<()> {
function all_similarity (line 364) | fn all_similarity() -> Result<()> {
function add_track_ok (line 428) | fn add_track_ok() -> Result<()> {
function add_track_dup_id (line 470) | fn add_track_dup_id() -> Result<()> {
function merge_ext_tracks (line 513) | fn merge_ext_tracks() -> Result<()> {
function merge_own_tracks (line 572) | fn merge_own_tracks() -> Result<()> {
function lookup (line 614) | fn lookup() {
FILE: src/track/store/track_distance.rs
type TrackDistanceResponse (line 8) | trait TrackDistanceResponse<OA>: IntoIterator
method get_all (line 13) | fn get_all(&self) -> Vec<Self::Output> {
method count (line 22) | fn count(&self) -> usize;
method elt (line 23) | fn elt(&self, res: Results<OA>) -> Vec<Self::Output>;
method extend (line 24) | fn extend(output: &mut Vec<Self::Output>, elt: Vec<Self::Output>);
method channel (line 25) | fn channel(&self) -> &Receiver<Results<OA>>;
type TrackDistanceOk (line 30) | pub struct TrackDistanceOk<OA>
type TrackDistanceOkIterator (line 38) | pub struct TrackDistanceOkIterator<OA>
type TrackDistanceErrIterator (line 47) | pub struct TrackDistanceErrIterator<OA>
function all (line 60) | pub fn all(self) -> Vec<ObservationMetricOk<OA>> {
function new (line 64) | pub(crate) fn new(count: usize, channel: Receiver<Results<OA>>) -> Self {
type TrackDistanceErr (line 71) | pub struct TrackDistanceErr<OA>
function all (line 83) | pub fn all(self) -> Vec<ObservationMetricErr<OA>> {
function new (line 87) | pub(crate) fn new(count: usize, channel: Receiver<Results<OA>>) -> Self {
type Item (line 96) | type Item = ObservationMetricOk<OA>;
method next (line 98) | fn next(&mut self) -> Option<Self::Item> {
type Item (line 123) | type Item = ObservationMetricErr<OA>;
method next (line 125) | fn next(&mut self) -> Option<Self::Item> {
type Item (line 150) | type Item = ObservationMetricOk<OA>;
type IntoIter (line 151) | type IntoIter = TrackDistanceOkIterator<OA>;
method into_iter (line 153) | fn into_iter(self) -> Self::IntoIter {
type Item (line 166) | type Item = ObservationMetricErr<OA>;
type IntoIter (line 167) | type IntoIter = TrackDistanceErrIterator<OA>;
method into_iter (line 169) | fn into_iter(self) -> Self::IntoIter {
type Output (line 182) | type Output = ObservationMetricOk<OA>;
function count (line 184) | fn count(&self) -> usize {
function elt (line 188) | fn elt(&self, res: Results<OA>) -> Vec<Self::Output> {
function extend (line 197) | fn extend(output: &mut Vec<Self::Output>, elt: Vec<Self::Output>) {
function channel (line 201) | fn channel(&self) -> &Receiver<Results<OA>> {
type Output (line 210) | type Output = ObservationMetricErr<OA>;
function count (line 212) | fn count(&self) -> usize {
function elt (line 216) | fn elt(&self, res: Results<OA>) -> Vec<Self::Output> {
function extend (line 224) | fn extend(output: &mut Vec<Self::Output>, elt: Vec<Self::Output>) {
function channel (line 228) | fn channel(&self) -> &Receiver<Results<OA>> {
type MockAttrs (line 246) | struct MockAttrs;
type Update (line 258) | type Update = MockAttrsUpdate;
type Lookup (line 259) | type Lookup = NoopLookup<MockAttrs, f32>;
method compatible (line 261) | fn compatible(&self, _other: &MockAttrs) -> bool {
method merge (line 265) | fn merge(&mut self, _other: &MockAttrs) -> Result<()> {
method baked (line 269) | fn baked(&self, _observations: &ObservationsDb<f32>) -> Result<TrackSt...
type MockAttrsUpdate (line 249) | pub struct MockAttrsUpdate;
method apply (line 252) | fn apply(&self, _attrs: &mut MockAttrs) -> Result<()> {
type MockMetric (line 275) | pub struct MockMetric;
method metric (line 278) | fn metric(&self, mq: &MetricQuery<MockAttrs, f32>) -> MetricOutput<f32> {
method optimize (line 289) | fn optimize(
function result_iterators (line 303) | fn result_iterators() {
FILE: src/track/utils.rs
function feature_attributes_sort_dec (line 8) | pub fn feature_attributes_sort_dec<FA: ObservationAttributes + PartialOrd>(
function feature_attributes_sort_inc (line 18) | pub fn feature_attributes_sort_inc<FA: ObservationAttributes + PartialOrd>(
function from_vec (line 26) | fn from_vec(vec: &Feature) -> Vec<f32> {
method from_vec (line 38) | fn from_vec(vec: Vec<f32>) -> Feature {
method from_vec (line 46) | fn from_vec(vec: &Vec<f32>) -> Feature {
type FromVec (line 75) | pub trait FromVec<V, R> {
method from_vec (line 76) | fn from_vec(vec: V) -> R;
function conv_tests (line 85) | fn conv_tests() {
FILE: src/track/voting.rs
type Voting (line 12) | pub trait Voting<OA>
method winners (line 26) | fn winners<T>(&self, distances: T) -> HashMap<u64, Vec<Self::WinnerObj...
FILE: src/track/voting/best.rs
type BestFitVoting (line 18) | pub struct BestFitVoting<OA>
function new (line 37) | pub fn new(max_distance: f32, min_votes: usize) -> Self {
type WinnerObject (line 50) | type WinnerObject = TopNVotingElt;
function winners (line 52) | fn winners<T>(&self, distances: T) -> HashMap<u64, Vec<TopNVotingElt>>
FILE: src/track/voting/topn.rs
type TopNVoting (line 16) | pub struct TopNVoting<OA>
function new (line 37) | pub fn new(topn: usize, max_distance: f32, min_votes: usize) -> Self {
type TopNVotingElt (line 50) | pub struct TopNVotingElt {
method new (line 59) | pub fn new(query_track: u64, winner_track: u64, weight: f64) -> Self {
type WinnerObject (line 72) | type WinnerObject = TopNVotingElt;
function winners (line 74) | fn winners<T>(&self, distances: T) -> HashMap<u64, Vec<TopNVotingElt>>
function default_voting (line 146) | fn default_voting() {
function two_query_vecs (line 230) | fn two_query_vecs() {
FILE: src/trackers/batch.rs
type BatchRecords (line 8) | pub type BatchRecords<T> = HashMap<u64, Vec<T>>;
type SceneTracks (line 9) | pub type SceneTracks = (u64, Vec<SortTrack>);
type PredictionBatchRequest (line 12) | pub struct PredictionBatchRequest<T> {
type PredictionBatchResult (line 19) | pub struct PredictionBatchResult {
method ready (line 25) | pub fn ready(&self) -> bool {
method get (line 29) | pub fn get(&self) -> SceneTracks {
method batch_size (line 35) | pub fn batch_size(&self) -> usize {
type PySceneTracks (line 47) | pub type PySceneTracks = (u64, Vec<PySortTrack>);
type PyPredictionBatchResult (line 52) | pub struct PyPredictionBatchResult(pub(crate) PredictionBatchResult);
method ready (line 56) | pub fn ready(&self) -> bool {
method get (line 61) | fn get(&self) -> PySceneTracks {
method batch_size (line 65) | pub fn batch_size(&self) -> usize {
function get_sender (line 72) | pub fn get_sender(&self) -> Sender<SceneTracks> {
function send (line 77) | pub(crate) fn send(&self, res: SceneTracks) -> bool {
function batch_size (line 90) | pub fn batch_size(&self) -> usize {
function add (line 94) | pub fn add(&mut self, scene_id: u64, elt: T) {
function new (line 105) | pub fn new() -> (Self, PredictionBatchResult) {
function get_batch (line 121) | pub fn get_batch(&self) -> &BatchRecords<T> {
function test (line 132) | fn test() {
FILE: src/trackers/epoch_db.rs
type EpochDb (line 6) | pub trait EpochDb {
method epoch_db (line 7) | fn epoch_db(&self) -> &Option<RwLock<HashMap<u64, usize>>>;
method max_idle_epochs (line 8) | fn max_idle_epochs(&self) -> usize;
method skip_epochs_for_scene (line 10) | fn skip_epochs_for_scene(&self, scene_id: u64, n: usize) {
method current_epoch_with_scene (line 21) | fn current_epoch_with_scene(&self, scene_id: u64) -> Option<usize> {
method next_epoch (line 35) | fn next_epoch(&self, scene_id: u64) -> Option<usize> {
method baked (line 51) | fn baked(&self, scene_id: u64, last_updated: usize) -> Result<TrackSta...
function test_epoch_db (line 76) | fn test_epoch_db() {
FILE: src/trackers/kalman_prediction.rs
type TrackAttributesKalmanPrediction (line 5) | pub trait TrackAttributesKalmanPrediction {
method get_state (line 6) | fn get_state(&self) -> Option<KalmanState<{ DIM_2D_BOX_X2 }>>;
method set_state (line 7) | fn set_state(&mut self, state: KalmanState<{ DIM_2D_BOX_X2 }>);
method get_position_weight (line 9) | fn get_position_weight(&self) -> f32;
method get_velocity_weight (line 11) | fn get_velocity_weight(&self) -> f32;
method make_prediction (line 13) | fn make_prediction(&mut self, observation_bbox: &Universal2DBox) -> Un...
FILE: src/trackers/sort.rs
constant DEFAULT_SORT_IOU_THRESHOLD (line 31) | pub const DEFAULT_SORT_IOU_THRESHOLD: f32 = 0.3;
type SortAttributesOptions (line 34) | pub struct SortAttributesOptions {
method new (line 70) | pub fn new(
method default (line 47) | fn default() -> Self {
method epoch_db (line 60) | fn epoch_db(&self) -> &Option<RwLock<HashMap<u64, usize>>> {
method max_idle_epochs (line 64) | fn max_idle_epochs(&self) -> usize {
type SortAttributes (line 92) | pub struct SortAttributes {
method new (line 150) | pub fn new(opts: Arc<SortAttributesOptions>) -> Self {
method update_history (line 157) | fn update_history(
type Update (line 247) | type Update = SortAttributesUpdate;
type Lookup (line 248) | type Lookup = SortLookup;
method compatible (line 250) | fn compatible(&self, other: &SortAttributes) -> bool {
method merge (line 272) | fn merge(&mut self, other: &SortAttributes) -> Result<()> {
method baked (line 278) | fn baked(&self, _observations: &ObservationsDb<Universal2DBox>) -> Res...
method get_state (line 112) | fn get_state(&self) -> Option<KalmanState<{ DIM_2D_BOX_X2 }>> {
method set_state (line 116) | fn set_state(&mut self, state: KalmanState<{ DIM_2D_BOX_X2 }>) {
method get_position_weight (line 120) | fn get_position_weight(&self) -> f32 {
method get_velocity_weight (line 124) | fn get_velocity_weight(&self) -> f32 {
method default (line 130) | fn default() -> Self {
type SortAttributesUpdate (line 177) | pub struct SortAttributesUpdate {
method new (line 216) | pub fn new(epoch: usize, custom_object_id: Option<i64>) -> Self {
method new_with_scene (line 228) | pub fn new_with_scene(epoch: usize, scene_id: u64, custom_object_id: O...
method apply (line 238) | fn apply(&self, attrs: &mut SortAttributes) -> Result<()> {
type SortLookup (line 186) | pub enum SortLookup {
method lookup (line 191) | fn lookup(
type SortTrack (line 286) | pub struct SortTrack {
type WastedSortTrack (line 316) | pub struct WastedSortTrack {
method from (line 344) | fn from(track: Track<SortAttributes, SortMetric, Universal2DBox>) -> S...
type VotingType (line 360) | pub enum VotingType {
type PositionalMetricType (line 367) | pub enum PositionalMetricType {
type AutoWaste (line 373) | pub struct AutoWaste {
constant DEFAULT_AUTO_WASTE_PERIODICITY (line 378) | pub(crate) const DEFAULT_AUTO_WASTE_PERIODICITY: usize = 100;
constant MAHALANOBIS_NEW_TRACK_THRESHOLD (line 379) | pub(crate) const MAHALANOBIS_NEW_TRACK_THRESHOLD: f32 = 1.0;
type PyPositionalMetricType (line 392) | pub struct PyPositionalMetricType(pub PositionalMetricType);
method maha (line 397) | pub fn maha() -> Self {
method iou (line 402) | pub fn iou(threshold: f32) -> Self {
constant __hash__ (line 412) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 414) | fn __repr__(&self) -> String {
method __str__ (line 418) | fn __str__(&self) -> String {
type PySortTrack (line 427) | pub struct PySortTrack(pub(crate) SortTrack);
constant __hash__ (line 432) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 434) | fn __repr__(&self) -> String {
method __str__ (line 438) | fn __str__(&self) -> String {
method get_id (line 443) | fn get_id(&self) -> u64 {
method get_epoch (line 448) | fn get_epoch(&self) -> usize {
method get_predicted_bbox (line 453) | fn get_predicted_bbox(&self) -> PyUniversal2DBox {
method get_observed_bbox (line 458) | fn get_observed_bbox(&self) -> PyUniversal2DBox {
method get_scene_id (line 463) | fn get_scene_id(&self) -> u64 {
method get_length (line 468) | fn get_length(&self) -> usize {
method get_voting_type (line 473) | fn get_voting_type(&self) -> PyVotingType {
method get_custom_object_id (line 478) | fn get_custom_object_id(&self) -> Option<i64> {
type PyWastedSortTrack (line 487) | pub struct PyWastedSortTrack(pub(crate) WastedSortTrack);
constant __hash__ (line 492) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 494) | fn __repr__(&self) -> String {
method __str__ (line 498) | fn __str__(&self) -> String {
method id (line 503) | fn id(&self) -> u64 {
method epoch (line 508) | fn epoch(&self) -> usize {
method predicted_bbox (line 513) | fn predicted_bbox(&self) -> PyUniversal2DBox {
method observed_bbox (line 518) | fn observed_bbox(&self) -> PyUniversal2DBox {
method scene_id (line 523) | fn scene_id(&self) -> u64 {
method length (line 528) | fn length(&self) -> usize {
method predicted_boxes (line 533) | fn predicted_boxes(&self) -> Vec<PyUniversal2DBox> {
method observed_boxes (line 538) | fn observed_boxes(&self) -> Vec<PyUniversal2DBox> {
type PyVotingType (line 546) | pub struct PyVotingType(pub VotingType);
constant __hash__ (line 551) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 553) | fn __repr__(&self) -> String {
method __str__ (line 557) | fn __str__(&self) -> String {
function construct (line 573) | fn construct() {
FILE: src/trackers/sort/batch_api.rs
type VotingSenderChannel (line 28) | type VotingSenderChannel = Sender<VotingCommands>;
type VotingReceiverChannel (line 29) | type VotingReceiverChannel = Receiver<VotingCommands>;
type MiddlewareSortTrackStore (line 31) | type MiddlewareSortTrackStore = TrackStore<SortAttributes, SortMetric, U...
type MiddlewareSortTrack (line 32) | type MiddlewareSortTrack = Track<SortAttributes, SortMetric, Universal2D...
type BatchBusyMonitor (line 33) | type BatchBusyMonitor = Arc<(Mutex<usize>, Condvar)>;
type VotingCommands (line 35) | enum VotingCommands {
type BatchSort (line 46) | pub struct BatchSort {
method new (line 157) | pub fn new(
method predict (line 222) | pub fn predict(
method idle_tracks (line 292) | pub fn idle_tracks(&mut self) -> Vec<SortTrack> {
method idle_tracks_with_scene (line 296) | pub fn idle_tracks_with_scene(&mut self, scene_id: u64) -> Vec<SortTra...
method get_auto_waste_obj_mut (line 314) | fn get_auto_waste_obj_mut(&mut self) -> &mut AutoWaste {
method get_opts (line 318) | fn get_opts(&self) -> &SortAttributesOptions {
method get_main_store_mut (line 322) | fn get_main_store_mut(&mut self) -> RwLockWriteGuard<MiddlewareSortTra...
method get_wasted_store_mut (line 326) | fn get_wasted_store_mut(&mut self) -> RwLockWriteGuard<MiddlewareSortT...
method get_main_store (line 330) | fn get_main_store(&self) -> RwLockReadGuard<MiddlewareSortTrackStore> {
method get_wasted_store (line 334) | fn get_wasted_store(&self) -> RwLockReadGuard<MiddlewareSortTrackStore> {
method drop (line 56) | fn drop(&mut self) {
function voting_thread (line 68) | fn voting_thread(
type SortPredictionBatchRequest (line 340) | pub struct SortPredictionBatchRequest {
method new (line 346) | pub fn new() -> Self {
method add (line 355) | pub fn add(&mut self, scene_id: u64, bbox: Universal2DBox, custom_obje...
method default (line 361) | fn default() -> Self {
type PyBatchSort (line 386) | pub struct PyBatchSort(pub(crate) BatchSort);
method new (line 403) | pub fn new(
method skip_epochs (line 432) | fn skip_epochs(&mut self, n: i64) {
method skip_epochs_for_scene (line 438) | fn skip_epochs_for_scene(&mut self, scene_id: i64, n: i64) {
method shard_stats (line 447) | fn shard_stats(&self) -> Vec<i64> {
method current_epoch (line 465) | fn current_epoch(&self) -> i64 {
method current_epoch_with_scene (line 477) | fn current_epoch_with_scene(&self, scene_id: i64) -> isize {
method predict (line 491) | fn predict(&mut self, mut batch: PySortPredictionBatchRequest) -> PyPr...
method wasted (line 499) | fn wasted(&mut self) -> Vec<PyWastedSortTrack> {
method clear_wasted (line 515) | pub fn clear_wasted(&mut self) {
method idle_tracks (line 524) | pub fn idle_tracks(&mut self, scene_id: i64) -> Vec<PySortTrack> {
type PySortPredictionBatchRequest (line 536) | pub struct PySortPredictionBatchRequest(pub(crate) SortPredictionBatchRe...
method new (line 541) | fn new() -> Self {
method add (line 546) | fn add(&mut self, scene_id: u64, bbox: PyUniversal2DBox, custom_object...
function new_drop (line 561) | fn new_drop() {
FILE: src/trackers/sort/metric.rs
constant DEFAULT_MINIMAL_SORT_CONFIDENCE (line 11) | pub const DEFAULT_MINIMAL_SORT_CONFIDENCE: f32 = 0.05;
type SortMetric (line 14) | pub struct SortMetric {
method new (line 29) | pub fn new(method: PositionalMetricType, min_confidence: f32) -> Self {
method metric (line 38) | fn metric(&self, mq: &MetricQuery<SortAttributes, Universal2DBox>) -> ...
method optimize (line 79) | fn optimize(
method postprocess_distances (line 107) | fn postprocess_distances(
method default (line 20) | fn default() -> Self {
function confidence_preserved_during_optimization (line 131) | fn confidence_preserved_during_optimization() {
function confidence_used_in_distance_calculation (line 163) | fn confidence_used_in_distance_calculation() {
FILE: src/trackers/sort/simple_api.rs
type Sort (line 22) | pub struct Sort {
method new (line 41) | pub fn new(
method predict (line 95) | pub fn predict(&mut self, bboxes: &[(Universal2DBox, Option<i64>)]) ->...
method gen_track_id (line 99) | fn gen_track_id(&mut self) -> u64 {
method predict_with_scene (line 110) | pub fn predict_with_scene(
method idle_tracks (line 198) | pub fn idle_tracks(&mut self) -> Vec<SortTrack> {
method idle_tracks_with_scene (line 202) | pub fn idle_tracks_with_scene(&mut self, scene_id: u64) -> Vec<SortTra...
method get_auto_waste_obj_mut (line 220) | fn get_auto_waste_obj_mut(&mut self) -> &mut AutoWaste {
method get_opts (line 224) | fn get_opts(&self) -> &SortAttributesOptions {
method get_main_store_mut (line 228) | fn get_main_store_mut(
method get_wasted_store_mut (line 235) | fn get_wasted_store_mut(
method get_main_store (line 242) | fn get_main_store(
method get_wasted_store (line 248) | fn get_wasted_store(
method from (line 256) | fn from(track: &Track<SortAttributes, SortMetric, Universal2DBox>) -> Se...
function sort (line 281) | fn sort() {
function sort_with_scenes (line 345) | fn sort_with_scenes() {
function idle_tracks (line 373) | fn idle_tracks() {
function clear_wasted_tracks (line 398) | fn clear_wasted_tracks() {
type PySort (line 456) | pub struct PySort(pub Sort);
method new_py (line 472) | pub fn new_py(
method skip_epochs (line 497) | pub fn skip_epochs(&mut self, n: i64) {
method skip_epochs_for_scene (line 503) | pub fn skip_epochs_for_scene(&mut self, scene_id: i64, n: i64) {
method shard_stats (line 512) | pub fn shard_stats(&self) -> Vec<i64> {
method current_epoch (line 530) | pub fn current_epoch(&self) -> i64 {
method current_epoch_with_scene (line 540) | pub fn current_epoch_with_scene(&self, scene_id: i64) -> isize {
method predict (line 554) | pub fn predict(
method predict_with_scene (line 568) | pub fn predict_with_scene(
method wasted (line 589) | pub fn wasted(&mut self) -> Vec<PyWastedSortTrack> {
method clear_wasted (line 605) | pub fn clear_wasted(&mut self) {
method idle_tracks (line 614) | pub fn idle_tracks(&mut self) -> Vec<PySortTrack> {
method idle_tracks_with_scene (line 621) | pub fn idle_tracks_with_scene(&mut self, scene_id: i64) -> Vec<PySortT...
FILE: src/trackers/sort/voting.rs
constant F32_U64_MULT (line 9) | const F32_U64_MULT: f32 = 1_000_000.0;
type SortVoting (line 11) | pub struct SortVoting {
method new (line 18) | pub fn new(threshold: f32, candidates_num: usize, tracks_num: usize) -...
type WinnerObject (line 28) | type WinnerObject = u64;
method winners (line 30) | fn winners<T>(&self, distances: T) -> HashMap<u64, Vec<Self::WinnerObj...
function test_voting (line 111) | fn test_voting() {
FILE: src/trackers/spatio_temporal_constraints.rs
type SpatioTemporalConstraints (line 15) | pub struct SpatioTemporalConstraints {
method constraints (line 25) | pub fn constraints(mut self, constraints: &[(usize, f32)]) -> Self {
method new (line 32) | pub fn new() -> Self {
method add_constraints (line 36) | pub fn add_constraints(&mut self, constraints: Vec<(usize, f32)>) {
method validate (line 48) | pub fn validate(&self, epoch_delta: usize, dist: f32) -> bool {
type PySpatioTemporalConstraints (line 71) | pub struct PySpatioTemporalConstraints(pub(crate) SpatioTemporalConstrai...
method new (line 76) | pub fn new() -> Self {
method add_constraints (line 86) | pub fn add_constraints(&mut self, constraints: Vec<(usize, f32)>) {
method validate (line 93) | pub fn validate(&self, epoch_delta: usize, dist: f32) -> bool {
function test (line 104) | fn test() {
FILE: src/trackers/tracker_api.rs
type TrackerAPI (line 9) | pub trait TrackerAPI<TA, M, OA, E, N>
method get_auto_waste_obj_mut (line 17) | fn get_auto_waste_obj_mut(&mut self) -> &mut AutoWaste;
method get_opts (line 18) | fn get_opts(&self) -> &E;
method get_main_store_mut (line 19) | fn get_main_store_mut(&mut self) -> RwLockWriteGuard<TrackStore<TA, M,...
method get_wasted_store_mut (line 20) | fn get_wasted_store_mut(&mut self) -> RwLockWriteGuard<TrackStore<TA, ...
method get_main_store (line 22) | fn get_main_store(&self) -> RwLockReadGuard<TrackStore<TA, M, OA, N>>;
method get_wasted_store (line 23) | fn get_wasted_store(&self) -> RwLockReadGuard<TrackStore<TA, M, OA, N>>;
method set_auto_waste (line 27) | fn set_auto_waste(&mut self, periodicity: usize) {
method skip_epochs (line 38) | fn skip_epochs(&mut self, n: usize) {
method skip_epochs_for_scene (line 48) | fn skip_epochs_for_scene(&mut self, scene_id: u64, n: usize) {
method current_epoch (line 55) | fn current_epoch(&self) -> usize {
method current_epoch_with_scene (line 64) | fn current_epoch_with_scene(&self, scene_id: u64) -> usize {
method get_main_store_wasted (line 70) | fn get_main_store_wasted(&mut self) -> Vec<Track<TA, M, OA, N>> {
method auto_waste (line 81) | fn auto_waste(&mut self) {
method wasted (line 90) | fn wasted(&mut self) -> Vec<Track<TA, M, OA, N>> {
method active_shard_stats (line 104) | fn active_shard_stats(&self) -> Vec<usize> {
method wasted_shard_stats (line 110) | fn wasted_shard_stats(&self) -> Vec<usize> {
method clear_wasted (line 115) | fn clear_wasted(&self) {
FILE: src/trackers/visual_sort.rs
type VisualSortObservation (line 35) | pub struct VisualSortObservation<'a> {
function new (line 43) | pub fn new(
type VisualSortObservationSet (line 59) | pub struct VisualSortObservationSet<'a> {
function new (line 64) | pub fn new() -> Self {
function add (line 70) | pub fn add(&mut self, observation: VisualSortObservation<'a>) {
method default (line 76) | fn default() -> Self {
type WastedVisualSortTrack (line 84) | pub struct WastedVisualSortTrack {
method from (line 125) | fn from(track: Track<VisualAttributes, VisualMetric, VisualObservation...
type PyWastedVisualSortTrack (line 155) | pub struct PyWastedVisualSortTrack(pub(crate) WastedVisualSortTrack);
constant __hash__ (line 160) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 162) | fn __repr__(&self) -> String {
method __str__ (line 166) | fn __str__(&self) -> String {
method id (line 171) | fn id(&self) -> u64 {
method epoch (line 176) | fn epoch(&self) -> usize {
method predicted_bbox (line 181) | fn predicted_bbox(&self) -> PyUniversal2DBox {
method observed_bbox (line 186) | fn observed_bbox(&self) -> PyUniversal2DBox {
method scene_id (line 191) | fn scene_id(&self) -> u64 {
method length (line 196) | fn length(&self) -> usize {
method predicted_boxes (line 201) | fn predicted_boxes(&self) -> Vec<PyUniversal2DBox> {
method observed_boxes (line 206) | fn observed_boxes(&self) -> Vec<PyUniversal2DBox> {
method observed_features (line 211) | fn observed_features(&self) -> Vec<Option<Vec<f32>>> {
type PyVisualSortObservation (line 219) | pub struct PyVisualSortObservation(pub(crate) VisualSortObservation<'sta...
method new (line 225) | pub fn new(
constant __hash__ (line 240) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 242) | fn __repr__(&self) -> String {
method __str__ (line 246) | fn __str__(&self) -> String {
type PyVisualSortObservationSet (line 254) | pub struct PyVisualSortObservationSet(pub(crate) VisualSortObservationSe...
method new (line 259) | fn new() -> Self {
method add (line 264) | fn add(&mut self, observation: PyVisualSortObservation) {
constant __hash__ (line 269) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 271) | fn __repr__(&self) -> String {
method __str__ (line 275) | fn __str__(&self) -> String {
FILE: src/trackers/visual_sort/batch_api.rs
type VotingSenderChannel (line 33) | type VotingSenderChannel = Sender<VotingCommands>;
type VotingReceiverChannel (line 34) | type VotingReceiverChannel = Receiver<VotingCommands>;
type MiddlewareVisualSortTrackStore (line 36) | type MiddlewareVisualSortTrackStore =
type MiddlewareSortTrack (line 38) | type MiddlewareSortTrack = Track<VisualAttributes, VisualMetric, VisualO...
type BatchBusyMonitor (line 39) | type BatchBusyMonitor = Arc<(Mutex<usize>, Condvar)>;
type VotingCommands (line 41) | enum VotingCommands {
type BatchVisualSort (line 54) | pub struct BatchVisualSort {
method new (line 161) | pub fn new(distance_shards: usize, voting_shards: usize, opts: &Visual...
method predict (line 213) | pub fn predict(&mut self, batch_request: PredictionBatchRequest<Visual...
method idle_tracks (line 319) | pub fn idle_tracks(&mut self) -> Vec<SortTrack> {
method idle_tracks_with_scene (line 323) | pub fn idle_tracks_with_scene(&mut self, scene_id: u64) -> Vec<SortTra...
method get_auto_waste_obj_mut (line 347) | fn get_auto_waste_obj_mut(&mut self) -> &mut AutoWaste {
method get_opts (line 351) | fn get_opts(&self) -> &SortAttributesOptions {
method get_main_store_mut (line 355) | fn get_main_store_mut(&mut self) -> RwLockWriteGuard<MiddlewareVisualS...
method get_wasted_store_mut (line 359) | fn get_wasted_store_mut(&mut self) -> RwLockWriteGuard<MiddlewareVisua...
method get_main_store (line 363) | fn get_main_store(&self) -> RwLockReadGuard<MiddlewareVisualSortTrackS...
method get_wasted_store (line 367) | fn get_wasted_store(&self) -> RwLockReadGuard<MiddlewareVisualSortTrac...
method drop (line 65) | fn drop(&mut self) {
function voting_thread (line 77) | fn voting_thread(
function test (line 382) | fn test() {
type VisualSortPredictionBatchRequest (line 457) | pub struct VisualSortPredictionBatchRequest<'a> {
function new (line 463) | pub fn new() -> Self {
function prediction (line 471) | pub fn prediction(&mut self) -> Option<PredictionBatchResult> {
function add (line 475) | pub fn add(&mut self, scene_id: u64, elt: VisualSortObservation<'a>) {
method default (line 481) | fn default() -> Self {
type PyBatchVisualSort (line 508) | pub struct PyBatchVisualSort(pub(crate) BatchVisualSort);
method new (line 514) | pub fn new(distance_shards: i64, voting_shards: i64, opts: &PyVisualSo...
method skip_epochs (line 525) | fn skip_epochs(&mut self, n: i64) {
method skip_epochs_for_scene (line 531) | fn skip_epochs_for_scene(&mut self, scene_id: i64, n: i64) {
method shard_stats (line 540) | fn shard_stats(&self) -> Vec<i64> {
method current_epoch (line 558) | fn current_epoch(&self) -> i64 {
method current_epoch_with_scene (line 570) | fn current_epoch_with_scene(&self, scene_id: i64) -> isize {
method predict (line 584) | fn predict(
method wasted (line 611) | fn wasted(&mut self) -> Vec<PyWastedVisualSortTrack> {
method clear_wasted (line 627) | pub fn clear_wasted(&mut self) {
method idle_tracks (line 634) | pub fn idle_tracks(&mut self, scene_id: i64) -> Vec<PySortTrack> {
type PyVisualSortPredictionBatchRequest (line 646) | pub(crate) struct PyVisualSortPredictionBatchRequest(
method new (line 653) | fn new() -> Self {
method prediction (line 657) | fn prediction(&mut self) -> Option<PyPredictionBatchResult> {
method add (line 661) | fn add(&mut self, scene_id: u64, elt: PyVisualSortObservation) {
FILE: src/trackers/visual_sort/metric.rs
type VisualSortMetricType (line 21) | pub enum VisualSortMetricType {
method euclidean (line 33) | pub fn euclidean(threshold: f32) -> Self {
method cosine (line 38) | pub fn cosine(threshold: f32) -> Self {
method threshold (line 46) | pub fn threshold(&self) -> f32 {
method is_ok (line 52) | pub fn is_ok(&self, dist: f32) -> bool {
method distance_to_weight (line 59) | pub fn distance_to_weight(&self, dist: f32) -> f32 {
method default (line 27) | fn default() -> Self {
type PyVisualSortMetricType (line 75) | pub struct PyVisualSortMetricType(pub VisualSortMetricType);
method euclidean (line 80) | pub fn euclidean(threshold: f32) -> Self {
method cosine (line 85) | pub fn cosine(threshold: f32) -> Self {
constant __hash__ (line 90) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 92) | fn __repr__(&self) -> String {
method __str__ (line 96) | fn __str__(&self) -> String {
type VisualMetricOptions (line 103) | pub struct VisualMetricOptions {
type VisualMetric (line 118) | pub struct VisualMetric {
method optimize_observations (line 129) | fn optimize_observations(
method positional_metric (line 156) | fn positional_metric(
method visual_metric (line 200) | fn visual_metric(
method feature_can_be_used (line 227) | fn feature_can_be_used(
method metric (line 253) | fn metric(
method optimize (line 297) | fn optimize(
method postprocess_distances (line 376) | fn postprocess_distances(
method default (line 123) | fn default() -> Self {
function optimization_regular (line 401) | fn optimization_regular() {
function optimize_low_quality (line 531) | fn optimize_low_quality() {
function optimize_small_box (line 566) | fn optimize_small_box() {
function optimize_overlap (line 601) | fn optimize_overlap() {
function default_attrs (line 654) | fn default_attrs() -> VisualAttributes {
function default_store (line 665) | fn default_store(
function pos_metric_far (line 676) | fn pos_metric_far() {
function metric_iou (line 727) | fn metric_iou() {
function metric_maha (line 776) | fn metric_maha() {
function visual_track_too_short (line 826) | fn visual_track_too_short() {
function visual_track_long_enough (line 876) | fn visual_track_long_enough() {
function visual_track_small_bbox (line 944) | fn visual_track_small_bbox() {
function visual_quality_low (line 997) | fn visual_quality_low() {
function visual_own_area_percentage_low (line 1048) | fn visual_own_area_percentage_low() {
FILE: src/trackers/visual_sort/metric/builder.rs
type VisualMetricBuilder (line 9) | pub struct VisualMetricBuilder {
method visual_minimal_own_area_percentage_use (line 45) | pub fn visual_minimal_own_area_percentage_use(mut self, area: f32) -> ...
method visual_minimal_own_area_percentage_collect (line 54) | pub fn visual_minimal_own_area_percentage_collect(mut self, area: f32)...
method visual_min_votes (line 63) | pub fn visual_min_votes(mut self, n: usize) -> Self {
method positional_min_confidence (line 68) | pub fn positional_min_confidence(mut self, conf: f32) -> Self {
method visual_metric (line 77) | pub fn visual_metric(mut self, metric: VisualSortMetricType) -> Self {
method positional_metric (line 82) | pub fn positional_metric(mut self, metric: PositionalMetricType) -> Se...
method visual_minimal_track_length (line 93) | pub fn visual_minimal_track_length(mut self, length: usize) -> Self {
method visual_minimal_area (line 102) | pub fn visual_minimal_area(mut self, area: f32) -> Self {
method visual_minimal_quality_use (line 111) | pub fn visual_minimal_quality_use(mut self, q: f32) -> Self {
method visual_max_observations (line 120) | pub fn visual_max_observations(mut self, n: usize) -> Self {
method visual_minimal_quality_collect (line 125) | pub fn visual_minimal_quality_collect(mut self, q: f32) -> Self {
method build (line 134) | pub fn build(self) -> VisualMetric {
method set_visual_minimal_area (line 160) | pub fn set_visual_minimal_area(&mut self, visual_minimal_area: f32) {
method set_positional_kind (line 165) | pub fn set_positional_kind(&mut self, positional_kind: PositionalMetri...
method set_visual_minimal_track_length (line 170) | pub fn set_visual_minimal_track_length(&mut self, visual_minimal_track...
method set_visual_minimal_quality_use (line 175) | pub fn set_visual_minimal_quality_use(&mut self, visual_minimal_qualit...
method set_visual_minimal_quality_collect (line 180) | pub fn set_visual_minimal_quality_collect(&mut self, visual_minimal_qu...
method set_visual_max_observations (line 185) | pub fn set_visual_max_observations(&mut self, visual_max_observations:...
method set_visual_min_votes (line 190) | pub fn set_visual_min_votes(&mut self, visual_min_votes: usize) {
method set_visual_minimal_own_area_percentage_use (line 195) | pub fn set_visual_minimal_own_area_percentage_use(
method set_visual_minimal_own_area_percentage_collect (line 202) | pub fn set_visual_minimal_own_area_percentage_collect(
method set_positional_min_confidence (line 211) | pub fn set_positional_min_confidence(&mut self, positional_min_confide...
method set_visual_kind (line 215) | pub fn set_visual_kind(&mut self, visual_kind: VisualSortMetricType) {
method default (line 27) | fn default() -> Self {
FILE: src/trackers/visual_sort/observation_attributes.rs
type VisualObservationAttributes (line 7) | pub struct VisualObservationAttributes {
method new (line 14) | pub fn new(q: f32, b: Universal2DBox) -> Self {
method with_own_area_percentage (line 22) | pub fn with_own_area_percentage(q: f32, b: Universal2DBox, own_area_pe...
method unchecked_bbox_ref (line 35) | pub fn unchecked_bbox_ref(&self) -> &Universal2DBox {
method bbox_opt (line 39) | pub fn bbox_opt(&self) -> &Option<Universal2DBox> {
method own_area_percentage_opt (line 43) | pub fn own_area_percentage_opt(&self) -> &Option<f32> {
method drop_bbox (line 47) | pub fn drop_bbox(&mut self) {
method visual_quality (line 51) | pub fn visual_quality(&self) -> f32 {
method eq (line 88) | fn eq(&self, other: &Self) -> bool {
function fmt (line 57) | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
type MetricObject (line 63) | type MetricObject = f32;
method calculate_metric_object (line 65) | fn calculate_metric_object(l: &Option<&Self>, r: &Option<&Self>) -> Opti...
function operations (line 105) | fn operations() {
FILE: src/trackers/visual_sort/options.rs
type VisualSortOptions (line 10) | pub struct VisualSortOptions {
method build (line 20) | pub(crate) fn build(self) -> (SortAttributesOptions, VisualMetric) {
method max_idle_epochs (line 42) | pub fn max_idle_epochs(mut self, n: usize) -> Self {
method kept_history_length (line 56) | pub fn kept_history_length(mut self, n: usize) -> Self {
method visual_metric (line 67) | pub fn visual_metric(mut self, metric: VisualSortMetricType) -> Self {
method visual_min_votes (line 86) | pub fn visual_min_votes(mut self, n: usize) -> Self {
method visual_max_observations (line 95) | pub fn visual_max_observations(mut self, n: usize) -> Self {
method positional_min_confidence (line 103) | pub fn positional_min_confidence(mut self, conf: f32) -> Self {
method spatio_temporal_constraints (line 112) | pub fn spatio_temporal_constraints(mut self, constraints: SpatioTempor...
method positional_metric (line 121) | pub fn positional_metric(mut self, metric: PositionalMetricType) -> Se...
method visual_minimal_track_length (line 132) | pub fn visual_minimal_track_length(mut self, length: usize) -> Self {
method visual_minimal_area (line 140) | pub fn visual_minimal_area(mut self, area: f32) -> Self {
method visual_minimal_quality_use (line 148) | pub fn visual_minimal_quality_use(mut self, q: f32) -> Self {
method visual_minimal_quality_collect (line 156) | pub fn visual_minimal_quality_collect(mut self, q: f32) -> Self {
method visual_minimal_own_area_percentage_use (line 165) | pub fn visual_minimal_own_area_percentage_use(mut self, area: f32) -> ...
method visual_minimal_own_area_percentage_collect (line 176) | pub fn visual_minimal_own_area_percentage_collect(mut self, area: f32)...
method kalman_position_weight (line 183) | pub fn kalman_position_weight(mut self, weight: f32) -> Self {
method kalman_velocity_weight (line 188) | pub fn kalman_velocity_weight(mut self, weight: f32) -> Self {
method default (line 195) | fn default() -> Self {
type PyVisualSortOptions (line 218) | pub struct PyVisualSortOptions(pub(crate) VisualSortOptions);
method new (line 223) | pub(crate) fn new() -> Self {
method max_idle_epochs (line 228) | pub(crate) fn max_idle_epochs(&mut self, n: i64) {
method kept_history_length (line 233) | pub(crate) fn kept_history_length(&mut self, n: i64) {
method visual_min_votes (line 238) | pub(crate) fn visual_min_votes(&mut self, n: i64) {
method visual_metric (line 243) | pub(crate) fn visual_metric(&mut self, metric: PyVisualSortMetricType) {
method spatio_temporal_constraints (line 248) | pub(crate) fn spatio_temporal_constraints(
method positional_metric (line 256) | pub(crate) fn positional_metric(&mut self, metric: PyPositionalMetricT...
method visual_minimal_track_length (line 261) | pub(crate) fn visual_minimal_track_length(&mut self, length: i64) {
method visual_minimal_area (line 270) | pub(crate) fn visual_minimal_area(&mut self, area: f32) {
method visual_minimal_quality_use (line 275) | pub(crate) fn visual_minimal_quality_use(&mut self, q: f32) {
method positional_min_confidence (line 280) | pub(crate) fn positional_min_confidence(&mut self, conf: f32) {
method visual_max_observations (line 285) | pub(crate) fn visual_max_observations(&mut self, n: i64) {
method visual_minimal_quality_collect (line 292) | pub(crate) fn visual_minimal_quality_collect(&mut self, q: f32) {
method visual_minimal_own_area_percentage_use (line 297) | pub(crate) fn visual_minimal_own_area_percentage_use(&mut self, area: ...
method visual_minimal_own_area_percentage_collect (line 304) | pub(crate) fn visual_minimal_own_area_percentage_collect(&mut self, ar...
method kalman_position_weight (line 311) | pub(crate) fn kalman_position_weight(&mut self, weight: f32) {
method kalman_velocity_weight (line 316) | pub(crate) fn kalman_velocity_weight(&mut self, weight: f32) {
constant __hash__ (line 321) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 323) | fn __repr__(&self) -> String {
method __str__ (line 327) | fn __str__(&self) -> String {
function visual_sort_options_builder (line 345) | fn visual_sort_options_builder() {
FILE: src/trackers/visual_sort/simple_api.rs
type VisualSort (line 29) | pub struct VisualSort {
method new (line 45) | pub fn new(shards: usize, opts: &VisualSortOptions) -> Self {
method predict (line 84) | pub fn predict(&mut self, observations: &[VisualSortObservation]) -> V...
method gen_track_id (line 88) | fn gen_track_id(&mut self) -> u64 {
method predict_with_scene (line 99) | pub fn predict_with_scene(
method idle_tracks (line 232) | pub fn idle_tracks(&mut self) -> Vec<SortTrack> {
method idle_tracks_with_scene (line 236) | pub fn idle_tracks_with_scene(&mut self, scene_id: u64) -> Vec<SortTra...
method get_auto_waste_obj_mut (line 259) | fn get_auto_waste_obj_mut(&mut self) -> &mut AutoWaste {
method get_opts (line 263) | fn get_opts(&self) -> &SortAttributesOptions {
method get_main_store_mut (line 267) | fn get_main_store_mut(
method get_wasted_store_mut (line 275) | fn get_wasted_store_mut(
method get_main_store (line 283) | fn get_main_store(
method get_wasted_store (line 291) | fn get_wasted_store(
method from (line 301) | fn from(track: &Track<VisualAttributes, VisualMetric, VisualObservationA...
function visual_sort (line 329) | fn visual_sort() {
type PyVisualSort (line 690) | pub struct PyVisualSort(pub(crate) VisualSort);
method new (line 695) | pub fn new(shards: i64, opts: &PyVisualSortOptions) -> Self {
method skip_epochs (line 701) | pub fn skip_epochs(&mut self, n: i64) {
method skip_epochs_for_scene (line 707) | pub fn skip_epochs_for_scene(&mut self, scene_id: i64, n: i64) {
method shard_stats (line 716) | pub fn shard_stats(&self) -> Vec<i64> {
method current_epoch (line 731) | pub fn current_epoch(&self) -> i64 {
method current_epoch_with_scene (line 741) | pub fn current_epoch_with_scene(&self, scene_id: i64) -> isize {
method predict (line 755) | pub fn predict(
method predict_with_scene (line 769) | pub fn predict_with_scene(
method wasted (line 802) | pub fn wasted(&mut self) -> Vec<PyWastedVisualSortTrack> {
method clear_wasted (line 818) | pub fn clear_wasted(&mut self) {
method idle_tracks (line 825) | pub fn idle_tracks(&mut self) -> Vec<PySortTrack> {
method idle_tracks_with_scene_py (line 832) | pub fn idle_tracks_with_scene_py(&mut self, scene_id: i64) -> Vec<PySo...
FILE: src/trackers/visual_sort/track_attributes.rs
type VisualAttributes (line 18) | pub struct VisualAttributes {
method new (line 66) | pub fn new(opts: Arc<SortAttributesOptions>) -> Self {
method update_history (line 73) | pub fn update_history(
type Update (line 185) | type Update = VisualAttributesUpdate;
type Lookup (line 186) | type Lookup = VisualSortLookup;
method compatible (line 188) | fn compatible(&self, other: &VisualAttributes) -> bool {
method merge (line 210) | fn merge(&mut self, other: &VisualAttributes) -> Result<()> {
method baked (line 217) | fn baked(
method default (line 43) | fn default() -> Self {
method get_state (line 94) | fn get_state(&self) -> Option<KalmanState<{ DIM_2D_BOX_X2 }>> {
method set_state (line 98) | fn set_state(&mut self, state: KalmanState<{ DIM_2D_BOX_X2 }>) {
method get_position_weight (line 102) | fn get_position_weight(&self) -> f32 {
method get_velocity_weight (line 106) | fn get_velocity_weight(&self) -> f32 {
type VisualSortLookup (line 112) | pub enum VisualSortLookup {
method lookup (line 117) | fn lookup(
type VisualAttributesUpdate (line 137) | pub enum VisualAttributesUpdate {
method new_init (line 147) | pub fn new_init(epoch: usize, custom_object_id: Option<i64>) -> Self {
method new_init_with_scene (line 151) | pub fn new_init_with_scene(epoch: usize, scene_id: u64, custom_object_...
method new_voting_type (line 159) | pub fn new_voting_type(vt: VotingType) -> Self {
method apply (line 165) | fn apply(&self, attrs: &mut VisualAttributes) -> Result<()> {
function attribute_operations (line 235) | fn attribute_operations() {
FILE: src/trackers/visual_sort/visual_sort_py.rs
type PyVisualSortPredictionBatchRequest (line 8) | pub(crate) struct PyVisualSortPredictionBatchRequest {
method new (line 16) | fn new() -> Self {
method prediction (line 24) | fn prediction(&mut self) -> Option<PredictionBatchResult> {
method add (line 28) | fn add(&mut self, scene_id: u64, elt: PyVisualSortObservation) {
type PyVisualSortObservation (line 38) | pub struct PyVisualSortObservation {
method new (line 49) | pub fn new(
constant __hash__ (line 64) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 66) | fn __repr__(&self) -> String {
method __str__ (line 70) | fn __str__(&self) -> String {
type PyVisualSortObservationSet (line 80) | pub struct PyVisualSortObservationSet {
method new (line 87) | fn new() -> Self {
method add (line 94) | fn add(&mut self, observation: PyVisualSortObservation) {
constant __hash__ (line 99) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 101) | fn __repr__(&self) -> String {
method __str__ (line 105) | fn __str__(&self) -> String {
FILE: src/trackers/visual_sort/voting.rs
type VisualVoting (line 12) | pub struct VisualVoting {
method new (line 19) | pub fn new(
type WinnerObject (line 46) | type WinnerObject = (u64, VotingType);
method winners (line 48) | fn winners<T>(&self, distances: T) -> HashMap<u64, Vec<Self::WinnerObj...
function from (line 35) | fn from(e: ObservationMetricOk<VisualObservationAttributes>) -> Self {
function test_visual_match (line 110) | fn test_visual_match() {
function test_positional_match (line 117) | fn test_positional_match() {
function test_visual_competitive_match (line 124) | fn test_visual_competitive_match() {
function test_visual_competitive_match_2 (line 140) | fn test_visual_competitive_match_2() {
function test_visual_positional_competitive_match_2 (line 161) | fn test_visual_positional_competitive_match_2() {
function test_visual_positional_competitive_match_no_pos_metric (line 184) | fn test_visual_positional_competitive_match_no_pos_metric() {
FILE: src/utils/bbox.rs
type BoundingBox (line 11) | pub struct BoundingBox {
method new (line 20) | pub fn new(left: f32, top: f32, width: f32, height: f32) -> Self {
method new_with_confidence (line 30) | pub fn new_with_confidence(
method as_xyaah (line 50) | pub fn as_xyaah(&self) -> Universal2DBox {
method intersection (line 54) | pub fn intersection(l: &BoundingBox, r: &BoundingBox) -> f64 {
type Error (line 261) | type Error = Errors;
method try_from (line 263) | fn try_from(value: Universal2DBox) -> Result<Self, Self::Error> {
type Error (line 269) | type Error = Errors;
method try_from (line 271) | fn try_from(f: &Universal2DBox) -> Result<Self, Self::Error> {
method eq (line 417) | fn eq(&self, other: &Self) -> bool {
type Universal2DBox (line 79) | pub struct Universal2DBox {
method new (line 103) | pub fn new(xc: f32, yc: f32, angle: Option<f32>, aspect: f32, height: ...
method new_with_confidence (line 115) | pub fn new_with_confidence(
method ltwh (line 139) | pub fn ltwh(left: f32, top: f32, width: f32, height: f32) -> Self {
method ltwh_with_confidence (line 145) | pub fn ltwh_with_confidence(
method get_radius (line 157) | pub fn get_radius(&self) -> f32 {
method area (line 163) | pub fn area(&self) -> f32 {
method get_vertices (line 169) | pub fn get_vertices(&self) -> Polygon {
method get_cached_vertices (line 174) | pub fn get_cached_vertices(&self) -> &Option<Polygon<f64>> {
method gen_vertices (line 179) | pub fn gen_vertices(&mut self) -> &Self {
method rotate (line 188) | pub fn rotate(self, angle: f32) -> Self {
method rotate_mut (line 202) | pub fn rotate_mut(&mut self, angle: f32) {
method set_confidence (line 208) | pub fn set_confidence(&mut self, confidence: f32) {
method sutherland_hodgman_clip (line 216) | pub fn sutherland_hodgman_clip(mut self, mut clipping: Universal2DBox)...
method from (line 241) | fn from(f: BoundingBox) -> Self {
method from (line 247) | fn from(f: &BoundingBox) -> Self {
method too_far (line 452) | pub fn too_far(l: &Universal2DBox, r: &Universal2DBox) -> bool {
method dist_in_2r (line 464) | pub fn dist_in_2r(l: &Universal2DBox, r: &Universal2DBox) -> f32 {
method intersection (line 476) | pub fn intersection(l: &Universal2DBox, r: &Universal2DBox) -> f64 {
method eq (line 538) | fn eq(&self, other: &Self) -> bool {
method clone (line 90) | fn clone(&self) -> Self {
function from (line 288) | fn from(b: &Universal2DBox) -> Self {
function transform (line 342) | fn transform() {
function corner_case_f32 (line 372) | fn corner_case_f32() {
type MetricObject (line 398) | type MetricObject = f32;
method calculate_metric_object (line 400) | fn calculate_metric_object(
function normalize_angle (line 426) | pub fn normalize_angle(a: f32) -> f32 {
function normalize (line 443) | fn normalize() {
type MetricObject (line 513) | type MetricObject = f32;
method calculate_metric_object (line 515) | fn calculate_metric_object(
type PyBoundingBox (line 558) | pub struct PyBoundingBox(pub(crate) BoundingBox);
constant __hash__ (line 563) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 565) | fn __repr__(&self) -> String {
method __str__ (line 569) | fn __str__(&self) -> String {
method get_left (line 574) | pub fn get_left(&self) -> f32 {
method set_left (line 579) | pub fn set_left(&mut self, left: f32) {
method get_top (line 584) | pub fn get_top(&self) -> f32 {
method set_top (line 589) | pub fn set_top(&mut self, top: f32) {
method get_width (line 594) | pub fn get_width(&mut self) -> f32 {
method set_width (line 599) | pub fn set_width(&mut self, width: f32) {
method get_height (line 604) | pub fn get_height(&mut self) -> f32 {
method set_height (line 609) | pub fn set_height(&mut self, height: f32) {
method get_confidence (line 614) | pub fn get_confidence(&mut self) -> f32 {
method set_confidence (line 619) | pub fn set_confidence(&mut self, confidence: f32) {
method as_xyaah (line 623) | pub fn as_xyaah(&self) -> PyUniversal2DBox {
method new (line 629) | pub fn new(left: f32, top: f32, width: f32, height: f32) -> Self {
method new_with_confidence (line 636) | pub fn new_with_confidence(
type PyUniversal2DBox (line 653) | pub struct PyUniversal2DBox(pub(crate) Universal2DBox);
constant __hash__ (line 658) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 660) | fn __repr__(&self) -> String {
method __str__ (line 664) | fn __str__(&self) -> String {
method get_radius (line 668) | pub fn get_radius(&self) -> f32 {
method as_ltwh (line 672) | pub fn as_ltwh(&self) -> PyResult<PyBoundingBox> {
method gen_vertices (line 681) | pub fn gen_vertices(&mut self) {
method get_vertices (line 685) | pub fn get_vertices(&self) -> PyPolygon {
method rotate (line 692) | pub fn rotate(&mut self, angle: f32) {
method get_confidence (line 697) | pub fn get_confidence(&self) -> f32 {
method set_confidence (line 702) | pub fn set_confidence(&mut self, confidence: f32) {
method get_xc (line 707) | pub fn get_xc(&self) -> f32 {
method set_xc (line 712) | pub fn set_xc(&mut self, xc: f32) {
method get_yc (line 717) | pub fn get_yc(&self) -> f32 {
method set_yc (line 722) | pub fn set_yc(&mut self, yc: f32) {
method get_angle (line 727) | pub fn get_angle(&self) -> Option<f32> {
method set_angle (line 732) | pub fn set_angle(&mut self, angle: Option<f32>) {
method get_aspect (line 737) | pub fn get_aspect(&self) -> f32 {
method set_aspect (line 742) | pub fn set_aspect(&mut self, aspect: f32) {
method get_height (line 747) | pub fn get_height(&self) -> f32 {
method set_height (line 752) | pub fn set_height(&mut self, height: f32) {
method new (line 760) | pub fn new(xc: f32, yc: f32, angle: Option<f32>, aspect: f32, height: ...
method new_with_confidence (line 768) | pub fn new_with_confidence(
method ltwh (line 789) | pub fn ltwh(left: f32, top: f32, width: f32, height: f32) -> Self {
method ltwh_with_confidence (line 798) | pub fn ltwh_with_confidence(
method area (line 810) | pub fn area(&self) -> f32 {
function test_radius (line 824) | fn test_radius() {
function test_not_too_far (line 831) | fn test_not_too_far() {
function test_same (line 838) | fn test_same() {
function test_too_far (line 844) | fn test_too_far() {
function dist_same (line 851) | fn dist_same() {
function dist_less_1 (line 857) | fn dist_less_1() {
function dist_is_1 (line 865) | fn dist_is_1() {
function test_iou (line 873) | fn test_iou() {
FILE: src/utils/clipping.rs
function is_inside (line 12) | fn is_inside(q: &Coord<f64>, p1: &Coord<f64>, p2: &Coord<f64>) -> bool {
function compute_intersection (line 17) | fn compute_intersection(
function sutherland_hodgman_clip (line 40) | pub fn sutherland_hodgman_clip(
function clip (line 99) | fn clip() {
FILE: src/utils/clipping/bbox_own_areas.rs
function exclusively_owned_areas (line 8) | pub fn exclusively_owned_areas(boxes: &[&Universal2DBox]) -> Vec<MultiPo...
function exclusively_owned_areas_normalized_shares (line 36) | pub fn exclusively_owned_areas_normalized_shares(
function test (line 58) | fn test() {
FILE: src/utils/clipping/clipping_py.rs
type PyPolygon (line 8) | pub struct PyPolygon(pub(crate) Polygon<f64>);
method get_points (line 13) | pub fn get_points(&self) -> Vec<(f64, f64)> {
constant __hash__ (line 18) | const __hash__: Option<Py<PyAny>> = None;
method __repr__ (line 20) | fn __repr__(&self) -> String {
method __str__ (line 24) | fn __str__(&self) -> String {
function sutherland_hodgman_clip_py (line 34) | pub fn sutherland_hodgman_clip_py(
function intersection_area_py (line 43) | pub fn intersection_area_py(subject: PyUniversal2DBox, clipping: PyUnive...
FILE: src/utils/kalman.rs
constant CHI2_UPPER_BOUND (line 16) | pub const CHI2_UPPER_BOUND: f32 = 100.0;
constant CHI2INV95 (line 18) | pub const CHI2INV95: [f32; 9] = [
type KalmanState (line 43) | pub struct KalmanState<const X: usize> {
function mean_pos_xc (line 49) | pub fn mean_pos_xc(&self) -> f32 {
function mean_pos_yc (line 52) | pub fn mean_pos_yc(&self) -> f32 {
function mean_vel_xc (line 55) | pub fn mean_vel_xc(&self) -> f32 {
function mean_vel_yc (line 58) | pub fn mean_vel_yc(&self) -> f32 {
function dump (line 66) | pub fn dump(&self) {
type Error (line 73) | type Error = Errors;
method try_from (line 75) | fn try_from(value: KalmanState<X>) -> Result<Self, Self::Error> {
type Error (line 95) | type Error = Errors;
method try_from (line 97) | fn try_from(value: KalmanState<X>) -> Result<Self, Self::Error> {
constant DT (line 103) | pub const DT: u64 = 1;
FILE: src/utils/kalman/kalman_2d_box.rs
constant DIM_2D_BOX (line 9) | pub const DIM_2D_BOX: usize = 5;
constant DIM_2D_BOX_X2 (line 10) | pub const DIM_2D_BOX_X2: usize = DIM_2D_BOX * 2;
type Universal2DBoxKalmanFilter (line 15) | pub struct Universal2DBoxKalmanFilter {
method new (line 31) | pub fn new(position_weight: f32, velocity_weight: f32) -> Self {
method std_position (line 46) | fn std_position(&self, k: f32, cnst: f32, p: f32) -> [f32; DIM_2D_BOX] {
method std_velocity (line 51) | fn std_velocity(&self, k: f32, cnst: f32, p: f32) -> [f32; DIM_2D_BOX] {
method initiate (line 58) | pub fn initiate(&self, bbox: &Universal2DBox) -> KalmanState<DIM_2D_BO...
method predict (line 86) | pub fn predict(&self, state: &KalmanState<DIM_2D_BOX_X2>) -> KalmanSta...
method project (line 104) | fn project(
method update (line 124) | pub fn update(
method distance (line 150) | pub fn distance(&self, state: KalmanState<DIM_2D_BOX_X2>, measurement:...
method calculate_cost (line 172) | pub fn calculate_cost(distance: f32, inverted: bool) -> f32 {
method default (line 24) | fn default() -> Self {
function constructor (line 194) | fn constructor() {
function step (line 204) | fn step() {
function gating_distance (line 225) | fn gating_distance() {
type PyUniversal2DBoxKalmanFilter (line 262) | pub struct PyUniversal2DBoxKalmanFilter {
method new (line 290) | pub fn new(position_weight: f32, velocity_weight: f32) -> Self {
method initiate (line 297) | pub fn initiate(&self, bbox: PyUniversal2DBox) -> PyUniversal2DBoxKalm...
method predict (line 304) | pub fn predict(
method update (line 314) | pub fn update(
method distance (line 325) | pub fn distance(
method calculate_cost (line 335) | pub fn calculate_cost(distance: f32, inverted: bool) -> f32 {
type PyUniversal2DBoxKalmanFilterState (line 269) | pub struct PyUniversal2DBoxKalmanFilterState {
method universal_bbox (line 276) | pub fn universal_bbox(&self) -> PyUniversal2DBox {
method bbox (line 281) | pub fn bbox(&self) -> PyResult<PyBoundingBox> {
FILE: src/utils/kalman/kalman_2d_point.rs
constant DIM_2D_POINT (line 5) | pub const DIM_2D_POINT: usize = 2;
constant DIM_2D_POINT_X2 (line 6) | pub const DIM_2D_POINT_X2: usize = DIM_2D_POINT * 2;
type Point2DKalmanFilter (line 11) | pub struct Point2DKalmanFilter {
method new (line 26) | pub fn new(position_weight: f32, velocity_weight: f32) -> Self {
method std_position (line 41) | fn std_position(&self, k: f32) -> [f32; DIM_2D_POINT] {
method std_velocity (line 46) | fn std_velocity(&self, k: f32) -> [f32; DIM_2D_POINT] {
method initiate (line 51) | pub fn initiate(&self, p: &Point2<f32>) -> KalmanState<DIM_2D_POINT_X2> {
method predict (line 67) | pub fn predict(&self, state: &KalmanState<DIM_2D_POINT_X2>) -> KalmanS...
method project (line 86) | fn project(
method update (line 103) | pub fn update(
method distance (line 123) | pub fn distance(&self, state: &KalmanState<DIM_2D_POINT_X2>, p: &Point...
method calculate_cost (line 139) | pub fn calculate_cost(distance: f32, inverted: bool) -> f32 {
method default (line 20) | fn default() -> Self {
function from (line 155) | fn from(s: KalmanState<{ DIM_2D_POINT_X2 }>) -> Self {
function test (line 166) | fn test() {
type PyPoint2DKalmanFilter (line 232) | pub struct PyPoint2DKalmanFilter {
method new (line 270) | pub fn new(position_weight: f32, velocity_weight: f32) -> Self {
method initiate (line 277) | pub fn initiate(&self, x: f32, y: f32) -> PyPoint2DKalmanFilterState {
method predict (line 284) | pub fn predict(&self, state: PyPoint2DKalmanFilterState) -> PyPoint2DK...
method update (line 291) | pub fn update(
method distance (line 303) | pub fn distance(&self, state: PyPoint2DKalmanFilterState, x: f32, y: f...
method calculate_cost (line 309) | pub fn calculate_cost(distance: f32, inverted: bool) -> f32 {
type PyPoint2DKalmanFilterState (line 239) | pub struct PyPoint2DKalmanFilterState {
method new (line 244) | pub fn new(state: KalmanState<{ DIM_2D_POINT_X2 }>) -> Self {
method inner (line 248) | pub fn inner(&self) -> &KalmanState<{ DIM_2D_POINT_X2 }> {
method x (line 256) | pub fn x(&self) -> f32 {
method y (line 261) | pub fn y(&self) -> f32 {
FILE: src/utils/kalman/kalman_2d_point_vec.rs
type Vec2DKalmanFilter (line 6) | pub struct Vec2DKalmanFilter {
method new (line 20) | pub fn new(position_weight: f32, velocity_weight: f32) -> Self {
method initiate (line 26) | pub fn initiate(&self, points: &[Point2<f32>]) -> Vec<KalmanState<DIM_...
method predict (line 30) | pub fn predict(
method update (line 37) | pub fn update(
method distance (line 54) | pub fn distance(
method calculate_cost (line 71) | pub fn calculate_cost(distances: &[f32], inverted: bool) -> Vec<f32> {
method default (line 12) | fn default() -> Self {
type PyVec2DKalmanFilter (line 88) | pub struct PyVec2DKalmanFilter {
method new (line 96) | pub fn new(position_weight: f32, velocity_weight: f32) -> Self {
method initiate (line 103) | pub fn initiate(&self, points: Vec<(f32, f32)>) -> Vec<PyPoint2DKalman...
method predict (line 117) | pub fn predict(
method update (line 130) | pub fn update(
method distance (line 148) | pub fn distance(
method calculate_cost (line 163) | pub fn calculate_cost(distances: Vec<f32>, inverted: bool) -> Vec<f32> {
FILE: src/utils/nms.rs
type Candidate (line 9) | struct Candidate<'a> {
function new (line 16) | pub fn new(bbox: &'a Universal2DBox, rank: &Option<f32>, index: usize) -...
function nms (line 32) | pub fn nms(
FILE: src/utils/nms/nms_py.rs
function nms_py (line 46) | pub fn nms_py(
FILE: src/utils/point.rs
type Point2D (line 1) | pub struct Point2D(pub f32, pub f32);
FILE: src/utils/primitive.rs
type MetricObject (line 4) | type MetricObject = f32;
method calculate_metric_object (line 6) | fn calculate_metric_object(
type MetricObject (line 19) | type MetricObject = ();
method calculate_metric_object (line 21) | fn calculate_metric_object(
Condensed preview — 123 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (745K chars).
[
{
"path": ".cargo/config.toml",
"chars": 280,
"preview": "[target.x86_64-unknown-linux-gnu]\nrustflags = \"-C target-cpu=x86-64-v3\"\n\n[target.x86_64-pc-windows-gnu]\nrustflags = \"-C "
},
{
"path": ".dockerignore",
"chars": 62,
"preview": "dist\n.idea\ntarget\n**/Dockerfile\n*/Dockerfile\ndata\n__pycache__\n"
},
{
"path": ".github/workflows/build.yml",
"chars": 5070,
"preview": "name: Similari\n\nconcurrency:\n group: ${{ github.workflow }}-${{ github.head_ref }}\n cancel-in-progress: true\n\non:\n pu"
},
{
"path": ".gitignore",
"chars": 48,
"preview": "/target\n/Cargo.lock\n.idea\ndist\ndata\n__pycache__\n"
},
{
"path": "Cargo.toml",
"chars": 1430,
"preview": "[package]\nname = \"similari-trackers-rs\"\nauthors = [\"Ivan Kudriavtsev <ivan.a.kudryavtsev@gmail.com>\"]\ndescription = \"Mac"
},
{
"path": "LICENSE",
"chars": 11384,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 14043,
"preview": "# Similari\n\nNewer versions (renamed):\n\n[](https://crate"
},
{
"path": "assets/benchmarks/benchmarks.md",
"chars": 5748,
"preview": "# Benchmarks\n\nAll benchmarks numbers received on Run on 4 cores of Intel(R) Core(TM) i5-7440HQ CPU @ 2.80GHz.\n\nVersion: "
},
{
"path": "assets/documentation/python/api.md",
"chars": 14603,
"preview": "# Python API\n\nPython API is generated with PyO3 & Maturin.\n\n## Functions\n[nms](https://docs.rs/similari/0.22.6/similari/"
},
{
"path": "benches/batch_sort_iou_tracker.rs",
"chars": 2459,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::trackers::batch::PredictionBatchRe"
},
{
"path": "benches/batch_sort_maha_tracker.rs",
"chars": 2348,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::prelude::PositionalMetricType::Mah"
},
{
"path": "benches/bbox_own_areas.rs",
"chars": 1344,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::utils::clipping::bbox_own_areas::{"
},
{
"path": "benches/feature_tracker.rs",
"chars": 5023,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::distance::euclidean;\nuse similari::examples::FeatGen;\nuse similari:"
},
{
"path": "benches/kalman_2d_point.rs",
"chars": 841,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse nalgebra::Point2;\nuse similari::examples::FeatGen2;\nuse similari::utils::kalm"
},
{
"path": "benches/kalman_bbox.rs",
"chars": 952,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::FeatGen2;\nuse similari::utils::bbox::Universal2DBox;\nuse "
},
{
"path": "benches/nms.rs",
"chars": 986,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::utils::nms::nms;\nuse test::Bencher"
},
{
"path": "benches/nms_oriented.rs",
"chars": 1200,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::utils::bbox::Universal2DBox;\nuse s"
},
{
"path": "benches/simple_search.rs",
"chars": 2084,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse rand::{distributions::Uniform, Rng};\nuse similari::examples::{UnboundAttribut"
},
{
"path": "benches/simple_sort_iou_tracker.rs",
"chars": 2250,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::trackers::sort::metric::DEFAULT_MI"
},
{
"path": "benches/simple_sort_iou_tracker_oriented.rs",
"chars": 2420,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse rand::Rng;\nuse similari::examples::BoxGen2;\nuse similari::trackers::sort::met"
},
{
"path": "benches/simple_sort_maha_tracker.rs",
"chars": 2164,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::prelude::Sort;\nuse similari::track"
},
{
"path": "benches/simple_sort_maha_tracker_oriented.rs",
"chars": 2312,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse similari::examples::BoxGen2;\nuse similari::prelude::Sort;\nuse similari::track"
},
{
"path": "benches/simple_visual_sort_tracker.rs",
"chars": 4443,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse rand::distributions::Uniform;\nuse rand::Rng;\nuse similari::examples::BoxGen2;"
},
{
"path": "benches/track_search.rs",
"chars": 2052,
"preview": "#![feature(test)]\n\nextern crate test;\n\nuse rand::{distributions::Uniform, Rng};\nuse similari::examples::{UnboundAttribut"
},
{
"path": "build.rs",
"chars": 102,
"preview": "fn main() {\n #[cfg(feature = \"python\")]\n pyo3_build_config::add_extension_module_link_args();\n}\n"
},
{
"path": "docker/Dockerfile.manylinux_2_28_ARM64",
"chars": 283,
"preview": "FROM ghcr.io/insight-platform/manylinux_2_28_arm64:v0.0.7 AS builder\n\nWORKDIR /opt\nCOPY . .\nARG PYTHON_INTERPRETER\nRUN c"
},
{
"path": "docker/Dockerfile.manylinux_2_28_X64",
"chars": 281,
"preview": "FROM ghcr.io/insight-platform/manylinux_2_28_x64:v0.0.7 AS builder\n\nWORKDIR /opt\nCOPY . .\nARG PYTHON_INTERPRETER\nRUN chm"
},
{
"path": "docker/build-manylinux.sh",
"chars": 215,
"preview": "#!/usr/bin/env bash\n\nset -e\n\nARGS=-f\n\nif [[ -z $PYTHON_INTERPRETER ]]; then\n ARGS=-f\nelse\n ARGS=\"-i $PYTHON_INTERP"
},
{
"path": "examples/batch_sort_iou_tracker.rs",
"chars": 1778,
"preview": "use similari::examples::BoxGen2;\nuse similari::trackers::batch::PredictionBatchRequest;\nuse similari::trackers::sort::ba"
},
{
"path": "examples/incremental_track_build.rs",
"chars": 5285,
"preview": "use similari::distance::euclidean;\nuse similari::examples::{BoxGen2, FeatGen2};\nuse similari::prelude::*;\nuse similari::"
},
{
"path": "examples/middleware_sort_tracker.rs",
"chars": 3135,
"preview": "use similari::examples::{current_time_ms, BoxGen2};\nuse similari::prelude::{NoopNotifier, ObservationBuilder, TrackStore"
},
{
"path": "examples/simple.rs",
"chars": 2427,
"preview": "use similari::examples::{vec2, SimpleAttributeUpdate, SimpleAttrs, SimpleMetric};\nuse similari::store;\nuse similari::tra"
},
{
"path": "examples/simple_sort_iou_tracker.rs",
"chars": 1426,
"preview": "use similari::examples::BoxGen2;\nuse similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;\nuse similari::tr"
},
{
"path": "examples/simple_sort_iou_tracker_oriented.rs",
"chars": 1321,
"preview": "use similari::examples::BoxGen2;\nuse similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT_CONFIDENCE;\nuse similari::tr"
},
{
"path": "examples/simple_sort_maha_tracker.rs",
"chars": 1352,
"preview": "use similari::examples::BoxGen2;\nuse similari::prelude::Sort;\nuse similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT"
},
{
"path": "examples/simple_sort_maha_tracker_oriented.rs",
"chars": 1232,
"preview": "use similari::examples::BoxGen2;\nuse similari::prelude::Sort;\nuse similari::trackers::sort::metric::DEFAULT_MINIMAL_SORT"
},
{
"path": "examples/track_merging.rs",
"chars": 16013,
"preview": "use crate::Gender::{Female, Male};\nuse anyhow::Result;\nuse itertools::Itertools;\nuse once_cell::sync::OnceCell;\nuse simi"
},
{
"path": "pyproject.toml",
"chars": 467,
"preview": "[build-system]\nrequires = [\"maturin>=1.8,<1.9\"]\nbuild-backend = \"maturin\"\n\n[project]\nname = \"similari-trackers-rs\"\nrequi"
},
{
"path": "python/bb.py",
"chars": 850,
"preview": "from similari import nms, BoundingBox, Universal2DBox\n\nif __name__ == '__main__':\n bb = BoundingBox(left=1.0, top=2.0"
},
{
"path": "python/bugfixes/bug_vs_1/bug_visual_sort.py",
"chars": 2539,
"preview": "import pathlib\nimport collections\nimport json\nfrom similari import (\n VisualSort,\n SpatioTemporalConstraints,\n "
},
{
"path": "python/bugfixes/bug_vs_1/in/fixed-1/bug_vs_1.json",
"chars": 25550,
"preview": "[{\"bbox\": {\"xc\": 305.5, \"yc\": 933.5, \"angle\": null, \"aspect\": 0.467576801776886, \"height\": 293.0, \"confidence\": 0.920410"
},
{
"path": "python/bugfixes/bug_vs_1/in/fixed-1/bug_vs_2.json",
"chars": 25569,
"preview": "[{\"bbox\": {\"xc\": 293.0, \"yc\": 936.5, \"angle\": null, \"aspect\": 0.4320557415485382, \"height\": 287.0, \"confidence\": 0.92089"
},
{
"path": "python/bugfixes/bug_vs_1/in/in-1.json",
"chars": 25393,
"preview": "[{\"bbox\": {\"xc\": 316.0, \"yc\": 932.0, \"angle\": null, \"aspect\": 0.5, \"height\": 296.0, \"confidence\": 0.9267578125}, \"featur"
},
{
"path": "python/bugfixes/bug_vs_1/in/in-2.json",
"chars": 25550,
"preview": "[{\"bbox\": {\"xc\": 305.5, \"yc\": 933.5, \"angle\": null, \"aspect\": 0.467576801776886, \"height\": 293.0, \"confidence\": 0.920410"
},
{
"path": "python/bugfixes/github-84.py",
"chars": 5744,
"preview": "from similari import (\n Sort,\n Universal2DBox,\n SpatioTemporalConstraints,\n PositionalMetricType,\n)\n\nBOXES_1"
},
{
"path": "python/clipping_intersection.py",
"chars": 650,
"preview": "from similari import sutherland_hodgman_clip, intersection_area, BoundingBox\n\nif __name__ == '__main__':\n bbox1 = Bou"
},
{
"path": "python/kalman_2d_point.py",
"chars": 369,
"preview": "from similari import Point2DKalmanFilter\n\nif __name__ == '__main__':\n f = Point2DKalmanFilter()\n state = f.initiat"
},
{
"path": "python/kalman_2d_vec.py",
"chars": 508,
"preview": "from similari import Vec2DKalmanFilter\n\nif __name__ == '__main__':\n f = Vec2DKalmanFilter()\n state = f.initiate([("
},
{
"path": "python/kalman_bbox.py",
"chars": 916,
"preview": "from similari import Universal2DBoxKalmanFilter, BoundingBox\n\nif __name__ == '__main__':\n f = Universal2DBoxKalmanFil"
},
{
"path": "python/motchallenge/Dockerfile",
"chars": 1391,
"preview": "FROM python:3.8-buster as base\n\nWORKDIR /opt\nCOPY docker/common/install-basic-deps.sh .\nRUN bash /opt/install-basic-deps"
},
{
"path": "python/motchallenge/README.md",
"chars": 2554,
"preview": "# Trackers Evaluation on MOT Challenge Data\n\nAn easy way to run Similari trackers and measure their performance on real "
},
{
"path": "python/motchallenge/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "python/motchallenge/__main__.py",
"chars": 2884,
"preview": "\"\"\"Entrypoint.\n>>> python -m motchallenge [config_file_path]\n\"\"\"\nfrom datetime import timedelta\nfrom pathlib import Path"
},
{
"path": "python/motchallenge/config.py",
"chars": 3644,
"preview": "from dataclasses import dataclass, asdict\nfrom enum import Enum\nfrom typing import Any, Dict, List, Optional, Union\nfrom"
},
{
"path": "python/motchallenge/config.yml",
"chars": 1923,
"preview": "# Default tracker and evaluator configuration.\n# Use as a template to configure\n\n# unique run name (used to build result"
},
{
"path": "python/motchallenge/confs/original-sort-config.yml",
"chars": 1940,
"preview": "# Default tracker and evaluator configuration.\n# Use as a template to configure\n\n# unique run name (used to build result"
},
{
"path": "python/motchallenge/confs/similari-maha-sort-config.yml",
"chars": 1506,
"preview": "# Default tracker and evaluator configuration.\n# Use as a template to configure\n\n# unique run name (used to build result"
},
{
"path": "python/motchallenge/evaluator.py",
"chars": 1437,
"preview": "from pathlib import Path\nimport trackeval\nfrom .config import Evaluator\n\n\ndef evaluate(\n tracker_name: str, data_path"
},
{
"path": "python/motchallenge/requirements.txt",
"chars": 38,
"preview": "numpy==1.20\nscipy\nomegaconf~=2.2\ntqdm\n"
},
{
"path": "python/motchallenge/trackers.py",
"chars": 4126,
"preview": "\"\"\"Unified tracker interface for supported trackers.\"\"\"\nfrom abc import abstractmethod\nfrom dataclasses import asdict\nfr"
},
{
"path": "python/motchallenge/utils.py",
"chars": 1116,
"preview": "from pathlib import Path\nfrom typing import Dict, List, Tuple, Union\nimport csv\n\n\ndef read_detections(\n file_path: Un"
},
{
"path": "python/nms.py",
"chars": 576,
"preview": "from similari import nms, BoundingBox\n\nif __name__ == '__main__':\n\n print(\"With score\")\n bbox1 = (BoundingBox(10.0"
},
{
"path": "python/sort/batch_sort_iou.py",
"chars": 1264,
"preview": "from similari import BatchSort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType, SortPredictionBatchRequest"
},
{
"path": "python/sort/batch_sort_iou_bench.py",
"chars": 1637,
"preview": "import timeit\n\nfrom similari import BatchSort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType, SortPredict"
},
{
"path": "python/sort/sort_idle.py",
"chars": 665,
"preview": "from similari import Sort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType\n\nif __name__ == '__main__':\n "
},
{
"path": "python/sort/sort_iou.py",
"chars": 886,
"preview": "from similari import Sort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType\n\nif __name__ == '__main__':\n "
},
{
"path": "python/sort/sort_iou_bench.py",
"chars": 987,
"preview": "from similari import Sort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType\nimport timeit\n\nif __name__ == '_"
},
{
"path": "python/sort/sort_iou_rotated.py",
"chars": 1071,
"preview": "from similari import Sort, Universal2DBox, SpatioTemporalConstraints, PositionalMetricType\n\nif __name__ == '__main__':\n "
},
{
"path": "python/sort/sort_iou_scene_id.py",
"chars": 1009,
"preview": "from similari import Sort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType\n\nif __name__ == '__main__':\n "
},
{
"path": "python/sort/sort_maha.py",
"chars": 806,
"preview": "from similari import Sort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType\n\nif __name__ == '__main__':\n "
},
{
"path": "python/visual_sort/batch_visual_sort.py",
"chars": 5068,
"preview": "import numpy as np\nfrom similari import (\n BatchVisualSort,\n SpatioTemporalConstraints,\n PositionalMetricType,\n"
},
{
"path": "python/visual_sort/visual_sort.py",
"chars": 3376,
"preview": "from similari import (\n VisualSort,\n SpatioTemporalConstraints,\n PositionalMetricType,\n VisualSortOptions,\n "
},
{
"path": "python/visual_sort.py",
"chars": 1574,
"preview": "from similari import VisualSortOptions, VisualSortObservation, VisualSortObservationSet, VisualSort, BoundingBox, \\\n "
},
{
"path": "src/distance.rs",
"chars": 2297,
"preview": "use crate::track::Feature;\nuse std::ops::{Mul, MulAssign, SubAssign};\n\n/// Euclidian distance between two feature vector"
},
{
"path": "src/examples/iou.rs",
"chars": 2452,
"preview": "use crate::track::{\n MetricOutput, MetricQuery, NoopLookup, Observation, ObservationAttributes, ObservationMetric,\n "
},
{
"path": "src/examples.rs",
"chars": 7222,
"preview": "pub mod iou;\n\nuse crate::distance::euclidean;\nuse crate::track::utils::FromVec;\nuse crate::track::{\n Feature, MetricO"
},
{
"path": "src/lib.rs",
"chars": 5732,
"preview": "//!\n//! # Similari\n//!\n//! The purpose of the crate is to provide tools to config.toml in-memory vector (feature) simila"
},
{
"path": "src/prelude.rs",
"chars": 836,
"preview": "use crate::track;\nuse crate::trackers;\nuse crate::utils;\n\npub use track::builder::{ObservationBuilder, TrackBuilder};\npu"
},
{
"path": "src/track/builder.rs",
"chars": 6390,
"preview": "use crate::track::notify::{ChangeNotifier, NoopNotifier};\nuse crate::track::{Feature, ObservationAttributes, Observation"
},
{
"path": "src/track/notify.rs",
"chars": 221,
"preview": "pub trait ChangeNotifier: Clone + Sync + Send + 'static {\n fn send(&mut self, id: u64);\n}\n\n#[derive(Clone, Debug)]\npu"
},
{
"path": "src/track/store/builder.rs",
"chars": 2732,
"preview": "use crate::store::TrackStore;\nuse crate::track::notify::{ChangeNotifier, NoopNotifier};\nuse crate::track::{ObservationAt"
},
{
"path": "src/track/store/store_tests.rs",
"chars": 19590,
"preview": "#[cfg(test)]\nmod tests {\n use crate::distance::euclidean;\n use crate::examples::{current_time_ms, vec2};\n use c"
},
{
"path": "src/track/store/track_distance.rs",
"chars": 9542,
"preview": "use crate::store::{ObservationMetricErr, Results};\nuse crate::track::{ObservationAttributes, ObservationMetricOk};\nuse c"
},
{
"path": "src/track/store.rs",
"chars": 25497,
"preview": "pub mod builder;\nmod store_tests;\npub mod track_distance;\n\nuse crate::prelude::TrackBuilder;\nuse crate::track::notify::{"
},
{
"path": "src/track/utils.rs",
"chars": 2649,
"preview": "use crate::track::{Feature, Observation, ObservationAttributes, FEATURE_LANES_SIZE};\nuse std::cmp::Ordering;\nuse ultravi"
},
{
"path": "src/track/voting/best.rs",
"chars": 3928,
"preview": "use crate::track::{ObservationAttributes, ObservationMetricOk};\nuse crate::voting::topn::TopNVotingElt;\nuse crate::votin"
},
{
"path": "src/track/voting/topn.rs",
"chars": 8799,
"preview": "use crate::track::{ObservationAttributes, ObservationMetricOk};\nuse crate::voting::Voting;\nuse itertools::Itertools;\nuse"
},
{
"path": "src/track/voting.rs",
"chars": 759,
"preview": "pub mod best;\npub mod topn;\n\nuse crate::track::{ObservationAttributes, ObservationMetricOk};\nuse std::collections::HashM"
},
{
"path": "src/track.rs",
"chars": 42427,
"preview": "use crate::track::notify::{ChangeNotifier, NoopNotifier};\nuse crate::Errors;\nuse anyhow::Result;\nuse itertools::Itertool"
},
{
"path": "src/trackers/batch.rs",
"chars": 3966,
"preview": "use crate::prelude::SortTrack;\nuse crossbeam::channel::{Receiver, Sender};\nuse log::debug;\n\nuse std::collections::HashMa"
},
{
"path": "src/trackers/epoch_db.rs",
"chars": 3825,
"preview": "use crate::track::TrackStatus;\nuse anyhow::Result;\nuse std::collections::HashMap;\nuse std::sync::RwLock;\n\npub trait Epoc"
},
{
"path": "src/trackers/kalman_prediction.rs",
"chars": 1092,
"preview": "use crate::utils::bbox::Universal2DBox;\nuse crate::utils::kalman::kalman_2d_box::{Universal2DBoxKalmanFilter, DIM_2D_BOX"
},
{
"path": "src/trackers/sort/batch_api.rs",
"chars": 19643,
"preview": "use crate::prelude::{\n NoopNotifier, ObservationBuilder, PositionalMetricType, SortTrack, TrackStoreBuilder,\n Univ"
},
{
"path": "src/trackers/sort/metric.rs",
"chars": 7035,
"preview": "use crate::track::{\n MetricOutput, MetricQuery, Observation, ObservationAttributes, ObservationMetric,\n Observatio"
},
{
"path": "src/trackers/sort/simple_api.rs",
"chars": 20635,
"preview": "use std::collections::HashMap;\nuse std::sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard};\n\nuse rand::Rng;\n\nuse cra"
},
{
"path": "src/trackers/sort/voting.rs",
"chars": 4986,
"preview": "use crate::track::ObservationMetricOk;\nuse crate::utils::bbox::Universal2DBox;\nuse crate::voting::Voting;\nuse core::opti"
},
{
"path": "src/trackers/sort.rs",
"chars": 17548,
"preview": "use crate::track::{\n LookupRequest, ObservationsDb, Track, TrackAttributes, TrackAttributesUpdate, TrackStatus,\n};\nus"
},
{
"path": "src/trackers/spatio_temporal_constraints.rs",
"chars": 4094,
"preview": "/// The struct allows defining the constraints for objects comprared across different epochs.\n///\n/// When the new objec"
},
{
"path": "src/trackers/tracker_api.rs",
"chars": 3779,
"preview": "use crate::store::TrackStore;\nuse crate::track::notify::ChangeNotifier;\nuse crate::track::TrackStatus;\nuse crate::track:"
},
{
"path": "src/trackers/visual_sort/batch_api.rs",
"chars": 22742,
"preview": "use crate::prelude::{\n NoopNotifier, ObservationBuilder, PositionalMetricType, SortTrack, TrackStoreBuilder,\n Visu"
},
{
"path": "src/trackers/visual_sort/metric/builder.rs",
"chars": 7565,
"preview": "use crate::trackers::sort::PositionalMetricType;\nuse crate::trackers::visual_sort::metric::{\n VisualMetric, VisualMet"
},
{
"path": "src/trackers/visual_sort/metric.rs",
"chars": 36836,
"preview": "/// Auxiliary class that helps to build a metric object\npub mod builder;\n\nuse crate::distance::{cosine, euclidean};\nuse "
},
{
"path": "src/trackers/visual_sort/observation_attributes.rs",
"chars": 3904,
"preview": "use crate::track::{Observation, ObservationAttributes};\nuse crate::utils::bbox::Universal2DBox;\nuse crate::EPS;\nuse std:"
},
{
"path": "src/trackers/visual_sort/options.rs",
"chars": 16257,
"preview": "use crate::trackers::sort::{PositionalMetricType, SortAttributesOptions};\nuse crate::trackers::spatio_temporal_constrain"
},
{
"path": "src/trackers/visual_sort/simple_api.rs",
"chars": 30574,
"preview": "use crate::prelude::{NoopNotifier, ObservationBuilder, SortTrack, TrackStoreBuilder};\nuse crate::store::TrackStore;\nuse "
},
{
"path": "src/trackers/visual_sort/track_attributes.rs",
"chars": 8399,
"preview": "use crate::track::{\n Feature, LookupRequest, ObservationsDb, TrackAttributes, TrackAttributesUpdate, TrackStatus,\n};\n"
},
{
"path": "src/trackers/visual_sort/visual_sort_py.rs",
"chars": 2640,
"preview": "use crate::prelude::Universal2DBox;\nuse crate::trackers::batch::{PredictionBatchRequest, PredictionBatchResult};\nuse pyo"
},
{
"path": "src/trackers/visual_sort/voting.rs",
"chars": 7537,
"preview": "use crate::track::ObservationMetricOk;\nuse crate::trackers::sort::voting::SortVoting;\nuse crate::trackers::sort::VotingT"
},
{
"path": "src/trackers/visual_sort.rs",
"chars": 7309,
"preview": "use std::borrow::Cow;\n\nuse crate::{\n track::{utils::FromVec, Track},\n utils::bbox::Universal2DBox,\n};\n\nuse self::{"
},
{
"path": "src/trackers.rs",
"chars": 647,
"preview": "/// SORT tracker implementations (middleware and simple sort implementation - IoU and Mahalanobis)\n///\npub mod sort;\n\n//"
},
{
"path": "src/utils/bbox.rs",
"chars": 24289,
"preview": "use crate::track::ObservationAttributes;\nuse crate::utils::clipping::sutherland_hodgman_clip;\nuse crate::Errors::Generic"
},
{
"path": "src/utils/clipping/bbox_own_areas.rs",
"chars": 2613,
"preview": "use crate::prelude::Universal2DBox;\nuse crate::EPS;\nuse geo::{Area, BooleanOps, MultiPolygon, Polygon};\nuse rayon::prelu"
},
{
"path": "src/utils/clipping/clipping_py.rs",
"chars": 1163,
"preview": "use crate::utils::bbox::python::PyUniversal2DBox;\nuse geo::{Area, CoordsIter, Polygon};\nuse pyo3::prelude::*;\n\n#[derive("
},
{
"path": "src/utils/clipping.rs",
"chars": 3374,
"preview": "/// Python interface for `sutherland_hodgman_clip`\n///\n#[cfg(feature = \"python\")]\npub mod clipping_py;\n\n/// The function"
},
{
"path": "src/utils/kalman/kalman_2d_box.rs",
"chars": 11535,
"preview": "use std::ops::SubAssign;\n// Original source code idea from\n// https://github.com/nwojke/deep_sort/blob/master/deep_sort/"
},
{
"path": "src/utils/kalman/kalman_2d_point.rs",
"chars": 10155,
"preview": "use crate::utils::kalman::{KalmanState, CHI2INV95, CHI2_UPPER_BOUND, DT};\nuse nalgebra::{Point2, SMatrix, SVector};\nuse "
},
{
"path": "src/utils/kalman/kalman_2d_point_vec.rs",
"chars": 5056,
"preview": "use crate::utils::kalman::kalman_2d_point::{Point2DKalmanFilter, DIM_2D_POINT_X2};\nuse crate::utils::kalman::KalmanState"
},
{
"path": "src/utils/kalman.rs",
"chars": 2808,
"preview": "use crate::prelude::{BoundingBox, Universal2DBox};\nuse crate::Errors;\nuse kalman_2d_box::DIM_2D_BOX;\nuse nalgebra::{SMat"
},
{
"path": "src/utils/nms/nms_py.rs",
"chars": 2318,
"preview": "use crate::utils::bbox::python::PyUniversal2DBox;\nuse crate::utils::bbox::Universal2DBox;\nuse crate::utils::nms::nms;\nus"
},
{
"path": "src/utils/nms.rs",
"chars": 5142,
"preview": "#[cfg(feature = \"python\")]\npub mod nms_py;\n\nuse crate::utils::bbox::Universal2DBox;\nuse itertools::Itertools;\nuse std::c"
},
{
"path": "src/utils/point.rs",
"chars": 38,
"preview": "pub struct Point2D(pub f32, pub f32);\n"
},
{
"path": "src/utils/primitive.rs",
"chars": 612,
"preview": "use crate::track::ObservationAttributes;\n\nimpl ObservationAttributes for f32 {\n type MetricObject = f32;\n\n fn calc"
},
{
"path": "src/utils.rs",
"chars": 466,
"preview": "/// Various bounding boxes implementations for axis-aligned and oriented (rotated)\n///\npub mod bbox;\n\n/// Bounding box i"
}
]
About this extraction
This page contains the full source code of the insight-platform/Similari GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 123 files (700.8 KB), approximately 208.2k tokens, and a symbol index with 1114 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.