https://github.com/tobias-gp/simplefilters

A collection of simple NumPy-based filters and trackers optimized for real-time performance.

https://github.com/tobias-gp/simplefilters

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

filter filtering-algorithm time-series time-series-analysis tracker tracking tracking-algorithm
Last synced: 5 months ago · JSON representation

Repository

A collection of simple NumPy-based filters and trackers optimized for real-time performance.

Basic Info
  • Host: GitHub
  • Owner: tobias-gp
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 15.7 MB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
filter filtering-algorithm time-series time-series-analysis tracker tracking tracking-algorithm
Created over 5 years ago · Last pushed over 5 years ago
Metadata Files
Readme License

README.md

Simple Filters and Tracking for Time-Series using NumPy

Python package Upload Python Package

pip install simple-filters

This is a collection of simple filters and trackers based on NumPy and SciPy, which are optimized for real-time performance. This is an example that applies tracking to non-recurrent methods like SMOKE with the DummyFilterStrategy:

Tracking vehicles based on detections from the SMOKE algorithm

Filter

A filter acts as a container for a time-series. The length of the time-series is kept constant after initial filling, according to the history_size specified.

Currently, two filters are implemented: * NumpyFilterStrategy: Applies a numpy function (e.g. numpy.mean) to the time-series. * PolynomialFilterStrategy: Returns the filtered last item (and optionally predicts the next item) of a multi-dimensional time series using a polynomial regression. The strategy can be applied to sensor data to retain smoothness while ensuring low latency and avoiding offsets with outliers. * DummyFilterStrategy: Simply returns the last item of the time-series.

Set up your filter: ``` from simple_filters import Filter, PolynomialFilterStrategy, NumpyFilterStrategy, DummyFilterStrategy

strategy1 = PolynomialFilterStrategy(polydegree=3, outlierrejectionratio=2.0) strategy2 = NumpyFilterStrategy(np.mean) strategy3 = DummyFilterStrategy()

filter = Filter(strategy1, historysize=10) ```

Fill the history with a 1D array: filter.update([1.0, 2.0]) filter.update([1.1, 2.1])

Get the last filtered item at the currenttime, or by specifying a time step in the future (time=1). Note that only PolynomialFilterStrategy allows for predicting the future. ``` resultcurrent = filter.eval() result_future = filter.eval(time=1) ```

Tracker

Oftentimes, multiple objects must be tracked that also require filtering. SimpleFilters implements a simple multi-object tracker for this purpose. The tracker associates objects by applying minimum weight matching to a distance graph.

The following properties can be defined: * distance_threshold: Maximum distance to match objects - when the threshold is exceeded, a new object will be created * maxtimeto_live: If an object is not seen, it is still retained for the given number of state updates * timetobirth: The number of observations needed until an object is born * filter_prototype: A filter that will be cloned for each new appearing object * distance_function: A lambda (x1, x2) that returns a distance between the two arrays

The PolynomialFilterStrategy is especially suitable for tracking, as it can predict the future state of the object according to its reconstructed polynomial: ``` from simple_filters import Filter, PolynomialFilterStrategy, Tracker

strategy = PolynomialFilterStrategy(polydegree=3, outlierrejectionratio=2.0) filterprototype = Filter(strategy, historysize=10) tracker = Tracker(filterprototype, distancethreshold=1.0, timeto_live=1) ```

Update your tracker with a 2D array: tracker.update([[1.0, 1.0], [2.0, 2.1]]) tracker.update([[1.1, 1.1], [1.9, 2.0], [3.1, 3.0]])

Retrieve the results: ```

Access the list of objects like any filter:

listofobjects = tracker.gettrackedobjects() listofobjects[0].eval(0) # get the latest state ([1.1, 1.1]) listofobjects[0].id # get the tracking ID

Or convert to a NumPy array:

nparray = tracker.tonumpy_array() ```

Testing

Simply run pytest in the project directory.

Owner

  • Name: Tobias Grosse-Puppendahl
  • Login: tobias-gp
  • Kind: user
  • Company: Porsche

Deep-tech enthusiast at Porsche

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 41
  • Total Committers: 2
  • Avg Commits per committer: 20.5
  • Development Distribution Score (DDS): 0.268
Top Committers
Name Email Commits
Tobias Grosse-Puppendahl t****l@p****e 30
Tobias Grosse-Puppendahl t****s@g****m 11
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 0
  • Average time to close issues: about 15 hours
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • MohamedKari (2)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 10 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 6
  • Total maintainers: 1
pypi.org: simple-filters

A collection of simple NumPy-based filters and trackers optimized for real-time performance

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 10 Last month
Rankings
Dependent packages count: 9.9%
Dependent repos count: 21.8%
Stargazers count: 23.1%
Average: 24.2%
Forks count: 29.9%
Downloads: 36.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • numpy *
  • scipy >=0.17.0