Skip to main content

DISCOver PATterns (DISCOPAT)

Project description

https://raw.githubusercontent.com/mansour-b/discopat/main/assets/discopat_hollywood.png

DISCOver PATterns (DISCOPAT)

Build Status Code Coverage PyPI Version Python Versions License Downloads Docs

Welcome to discopat, the pattern discovery library!

This library provides tools to discover, detect, and track meaningful patterns in physical signals. These signals can be of various forms:

  1. Time series,

  2. Images,

  3. Movies,

  4. Any other type of n-dimensional data.

Installation

You can install discopat by doing the following:

pip install discopat

You can then try running this notebook on your computer to verify that the installation was succesful.

Quickstart

Here is an example to briefly present the API:

import numpy as np

from discopat.core import Box, Frame, Model, Movie, Tracker
from discopat.display import plot_frame

# Define the dimensions of the problem
frame_width = 5
frame_height = 5
movie_length = 3
gif_frames_per_second = 2

# Define a concrete model class, just for the example
class DumbModel(Model):
    def predict(self, frame: Frame) -> Frame:
        frame_id = int(frame.name)
        frame.annotations.append(
            Box(label="noise_in_a_square", x=frame_id, y=frame_id, width=1, height=1)
        )
        return frame

model = DumbModel()

# Our data for this short tutorial
frames = [
    Frame(
        name=str(10 * i),
        width=frame_width,
        height=frame_height,
        annotations=[],
        image_array=np.random.random(frame_height, frame_width),
    )
    for i in range(movie_length)
]

movie = Movie(name="some_noise", frames=frames, tracks=[])

# Run the detection model on individual frames
analysed_frames = [model(frame) for frame in movie.frames]
analysed_movie = Movie(
    name="some_noise_with_boxes", frames=analysed_frames, tracks=[]
)

# TBD: run tracker on detections
analysed_movie = tracker.make_tracks(analysed_movie)
analysed_movie.name = "some_noise_with_boxes_and_tracks"

# Plot individual frames with detections
for frame in analysed_movie:
    plot_frame(frame)

# TBD: make a GIF to show the tracks
export_to_gif(analysed_movie, fps=gif_frames_per_seconds)

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

discopat-0.4.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

discopat-0.4.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file discopat-0.4.2.tar.gz.

File metadata

  • Download URL: discopat-0.4.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for discopat-0.4.2.tar.gz
Algorithm Hash digest
SHA256 58c8642fef31649c570413386f2fd9c30a3cbcbe250c3dc8c9c9de8eebf53a57
MD5 e62f6ff19e82403e3bfa09faba4ab8cf
BLAKE2b-256 f62c9883eb5f8fdff267d0fe49d0e66ef98117314f651913416ff3291dda872e

See more details on using hashes here.

Provenance

The following attestation bundles were made for discopat-0.4.2.tar.gz:

Publisher: pypi_upload.yaml on mansour-b/discopat

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

File details

Details for the file discopat-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: discopat-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for discopat-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0db60eb57459397d163d17b4d2544609641a746d8b4f8169c41aa628dc69d9c0
MD5 6482aee82346cb80bc987b981e472c79
BLAKE2b-256 96c65a87d6652de5cc23bf892c2f80efd8dfd3444875604cb572006d3385bc8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for discopat-0.4.2-py3-none-any.whl:

Publisher: pypi_upload.yaml on mansour-b/discopat

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