Skip to main content

Activity/event timeline visualization for action localization (or detection) labels and predictions.

Project description

activity-plots

Plotting tools for temporal action localization (or per-frame classification) labels and predictions.

Install

pip install activity-plots

Usage

Create a data container then pass it into one of the plotting functions.

import activity_plots
import matplotlib.pyplot as plt

data = activity_plots.ActivitySegments(
    starts=[5, 13, 29], ends=[15, 17, 45], label_ids=[0, 1, 0],
    label_set=["Activity A", "Activity B"]
)
fig, ax = plt.subplots()
ax = activity_plots.multi_bar(ax, data, title="Test Plot", xlabel="Frame #")
plt.show()

Plot Types

  1. multi_bar

Example plot

  1. continuous_shaded
    • Use to visualize probabilities (model output)

Example plot

  1. single_bar
    • Use when there can only be one label per frame
    • Useful to visualize multiple videos/instances

Example plot

Data Containers

ActivitySegments

  • Build from a set of variable-length segments

ActivityProbabilities

  • Used for visualizing predictions (per-frame distributions over all activities)

segments_from_sequence

  • Helper function to build ActivitySegments from a sequence of label IDs.
  • Example:
seq = [1, 1, 1, 0, 2, 3, 3, 3, 4, -1, -1, 5]  # -1 is ignored ("background")
data = activity_plots.segments_from_sequence(seq)

TODO

  • Github action to publish on pypi
  • Stackplot
    • Check different options for "baseline"
  • Ridge plot
    • Fill color with same colormap as multi-bar
  • Better handling of overlapping segments
    • Could use additional offset
    • Might need to increase the y-axis range too
  • Create tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

activity_plots-0.0.1.tar.gz (80.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

activity_plots-0.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file activity_plots-0.0.1.tar.gz.

File metadata

  • Download URL: activity_plots-0.0.1.tar.gz
  • Upload date:
  • Size: 80.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for activity_plots-0.0.1.tar.gz
Algorithm Hash digest
SHA256 994e97d4b4f2afc564990502f09832a4745d69d4ab6baa03ad302ac131c32f01
MD5 21b5c90633ece87d5f3a23d5b49b8332
BLAKE2b-256 313e3fcb44faf483ac0eff6fc67e4f58f9bc3edb2c8548820a5a9080d9564e21

See more details on using hashes here.

Provenance

The following attestation bundles were made for activity_plots-0.0.1.tar.gz:

Publisher: python-publish.yml on mpeven/activity-plots

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file activity_plots-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: activity_plots-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for activity_plots-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 faad42e00e21d66fabd1558cc4830e9001377dd3726a3762b381bbe0a59c0499
MD5 8b9128bb3ad176be2c7cfaaa16f9129d
BLAKE2b-256 6255746aa4e27ebed13fe276ab138333d6fb96e2511064c65794e049eea5d76f

See more details on using hashes here.

Provenance

The following attestation bundles were made for activity_plots-0.0.1-py3-none-any.whl:

Publisher: python-publish.yml on mpeven/activity-plots

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page