semvec/pypi-packages huggingface dataset:
activity-plots 0.0.1
Activity/event timeline visualization for action localization (or detection) labels and predictions.
Requires Python: >=3.9
Keywords: activity, plotting, timeline

# activity-plots

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

# Install

```bash
pip install activity-plots
```

# Usage

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

```python
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](/images/multi_bar_segments.png)

2. `continuous_shaded` 
    - Use to visualize probabilities (model output)

![Example plot](/images/continuous_shaded.png)

3. `single_bar` 
    - Use when there can only be one label per frame
    - Useful to visualize multiple videos/instances

![Example plot](/images/single_bar.png)

# 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:
```python
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
rBat 0.1.1
Toolkit for preprocessing rat time-spatial data and quantifying their (artificially induced) OCD-like behaviour.
Requires Python: >=3.10
Keywords: rat, time-spatial, preprocessing, OCD, OCD-like, summary measure

# rBat
Repo for the rBat package — behavioural quantification algorithms &amp; preprocessing methods.

----
## Important Links

- Source Code: https://github.com/brandonc-edu/rBat
- Bug Reports: https://github.com/brandonc-edu/rBat/issues

## Capabilities

It provides:
- Objects to replicate test environments for purposes of tracking rat movement.
- Functions to calculate summary measures — quantifications of the rat's OCD-like behaviour.
- Preprocessing methods to smooth time-spatial data and segment it into episodes of movement types (lingering, progression, etc.)
- API Interfaces to assist in preprocessing and summary measure calcuations.

## Testing

rBat requires `pytest` to test the summary measure and preprocessing algorithms.

----
## Credits

Brandon Carrasco & Daniel Locke - Original Developers of rBat Package
Inoday Yadav & Jamie Wong - Tested rBat package functionality
Dr. Henry Szechtman & Dr. Anna Dvorkin-Gheva - Supervisors & Consultants for Desired Functionality

### Implementations Based Upon

#### Summary Measures

Szechtman, H., Sulis, W., & Eilam, D. (1998). Quinpirole induces compulsive checking behavior in rats: a potential animal model of obsessive-compulsive disorder (OCD). Behavioral neuroscience, 112(6), 1475–1485. https://doi.org/10.1037//0735-7044.112.6.1475

Dvorkin, A., Perreault, M. L., & Szechtman, H. (2006). Development and temporal organization of compulsive checking induced by repeated injections of the dopamine agonist quinpirole in an animal model of obsessive-compulsive disorder. Behavioural brain research, 169(2), 303–311. https://doi.org/10.1016/j.bbr.2006.01.024

Dvorkin, A., Culver, K. E., & Szechtman, H. (2006). Differential effects of clorgyline on sensitization to quinpirole in rats tested in small and large environments. Psychopharmacology, 186(4), 534–543. https://doi.org/10.1007/s00213-006-0377-4

Tucci, M. C., Dvorkin-Gheva, A., Johnson, E., Cheon, P., Taji, L., Agarwal, A., Foster, J., & Szechtman, H. (2014). Performance of compulsive behavior in rats is not a unitary phenomenon - validation of separate functional components in compulsive checking behavior. The European journal of neuroscience, 40(6), 2971–2979. https://doi.org/10.1111/ejn.12652

#### Preprocessing

Hen, I., Sakov, A., Kafkafi, N., Golani, I., & Benjamini, Y. (2004). The dynamics of spatial behavior: how can robust smoothing techniques help?. Journal of neuroscience methods, 133(1-2), 161–172. https://doi.org/10.1016/j.jneumeth.2003.10.013

Drai, D., Benjamini, Y., & Golani, I. (2000). Statistical discrimination of natural modes of motion in rat exploratory behavior. Journal of neuroscience methods, 96(2), 119–131. https://doi.org/10.1016/s0165-0270(99)00194-6

Additional implementation details gleaned from: https://www.tau.ac.il/~ilan99/see/help/