Skip to content

Commit 65e8b53

Browse files
Update setup & documentation
1 parent 2f5daeb commit 65e8b53

File tree

8 files changed

+96
-44
lines changed

8 files changed

+96
-44
lines changed

.github/workflows/github-actions.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/MODULES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Full list of [Mgt-python](README.md#mgt-python) project modules.
2727
- [Pose](musicalgestures/_pose.md#pose)
2828
- [Show](musicalgestures/_show.md#show)
2929
- [Show Window](musicalgestures/_show_window.md#show-window)
30+
- [Ssm](musicalgestures/_ssm.md#ssm)
3031
- [Utils](musicalgestures/_utils.md#utils)
3132
- [Videoadjust](musicalgestures/_videoadjust.md#videoadjust)
3233
- [Videograms](musicalgestures/_videograms.md#videograms)

docs/musicalgestures/_motionvideo.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## mg_motion
1515

16-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L272)
16+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L273)
1717

1818
```python
1919
def mg_motion(
@@ -109,7 +109,7 @@ Shortcut for [mg_motion](#mg_motion) to only render motion data.
109109

110110
## mg_motiongrams
111111

112-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L17)
112+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L16)
113113

114114
```python
115115
def mg_motiongrams(
@@ -173,6 +173,7 @@ Shortcut for [mg_motion](#mg_motion) to only render motion plots.
173173
- `thresh` *float, optional* - Eliminates pixel values less than given threshold. Ranges from 0 to 1. Defaults to 0.05.
174174
- `blur` *str, optional* - 'Average' to apply a 10px * 10px blurring filter, 'None' otherwise. Defaults to 'None'.
175175
- `kernel_size` *int, optional* - Size of structuring element. Defaults to 5.
176+
- `audio_descriptors` *bool, optional* - Whether to plot motion plots together with audio descriptors in order to see possible correlations in the data. Deflauts to False.
176177
- `unit` *str, optional* - Unit in QoM plot. Accepted values are 'seconds' or 'samples'. Defaults to 'seconds'.
177178
- `title` *str, optional* - Optionally add title to the plot. Defaults to None, which uses the file name as a title.
178179
- `target_name` *str, optional* - Target output name for the plot. Defaults to None (which assumes that the input filename with the suffix "_motion_com_aom_qom" should be used).
@@ -184,7 +185,7 @@ Shortcut for [mg_motion](#mg_motion) to only render motion plots.
184185

185186
## mg_motionvideo
186187

187-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L212)
188+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L213)
188189

189190
```python
190191
def mg_motionvideo(
@@ -242,7 +243,7 @@ Helper function to plot the centroid and quantity of motion using matplotlib.
242243

243244
## save_txt
244245

245-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L675)
246+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_motionvideo.py#L707)
246247

247248
```python
248249
def save_txt(

docs/musicalgestures/_show.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ General method to show an image or video file either in a window, or inline in a
3535

3636
## show_in_new_process
3737

38-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_show.py#L262)
38+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_show.py#L274)
3939

4040
```python
4141
def show_in_new_process(command):

docs/musicalgestures/_ssm.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Ssm
2+
3+
> Auto-generated documentation for [musicalgestures._ssm](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_ssm.py) module.
4+
5+
- [Mgt-python](../README.md#mgt-python) / [Modules](../MODULES.md#mgt-python-modules) / [Musicalgestures](index.md#musicalgestures) / Ssm
6+
- [mg_ssm](#mg_ssm)
7+
- [smooth_downsample_feature_sequence](#smooth_downsample_feature_sequence)
8+
9+
## mg_ssm
10+
11+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_ssm.py#L43)
12+
13+
```python
14+
def mg_ssm(
15+
self,
16+
features='motiongrams',
17+
filtertype='Regular',
18+
thresh=0.05,
19+
blur='None',
20+
norm=np.inf,
21+
threshold=0.001,
22+
cmap='gray_r',
23+
use_median=False,
24+
kernel_size=5,
25+
target_name=None,
26+
overwrite=False,
27+
):
28+
```
29+
30+
Compute Self-Similarity Matrix (SSM) by converting the input signal into a suitable feature sequence and comparing each element of the feature sequence with all other elements of the sequence.
31+
SSMs can be computed over different input features such as 'motiongrams', 'spectrogram', 'chromagram' and 'tempogram'.
32+
33+
#### Arguments
34+
35+
- `features` *str, optional* - Defines the type of features on which to compute SSM. Possible to compute SSM on 'motiongrams', 'spectrogram', 'chromagram' and 'tempogram'. Defaults to 'motiongrams'.
36+
- `filtertype` *str, optional* - 'Regular' turns all values below `thresh` to 0. 'Binary' turns all values below `thresh` to 0, above `thresh` to 1. 'Blob' removes individual pixels with erosion method. Defaults to 'Regular'.
37+
- `thresh` *float, optional* - Eliminates pixel values less than given threshold. Ranges from 0 to 1. Defaults to 0.05.
38+
- `blur` *str, optional* - 'Average' to apply a 10px * 10px blurring filter, 'None' otherwise. Defaults to 'None'.
39+
- `norm` *int, optional* - Normalize the columns of the feature sequence. Possible to compute Manhattan norm (1), Euclidean norm (2), Minimum norm (-np.inf), Maximum norm (np.inf), etc. Defaults to np.inf.
40+
- `threshold` *float, optional* - Only the columns with norm at least the amount of `threshold` indicated are normalized. Defaults to 0.001.
41+
- `cmap` *str, optional* - A Colormap instance or registered colormap name. The colormap maps the C values to colors. Defaults to 'gray_r'.
42+
- `use_median` *bool, optional* - If True the algorithm applies a median filter on the thresholded frame-difference stream. Defaults to False.
43+
- `kernel_size` *int, optional* - Size of the median filter (if `use_median=True`) or the erosion filter (if `filtertype='blob'`). Defaults to 5.
44+
- `target_name` *[type], optional* - Target output name for the SSM. Defaults to None.
45+
- `overwrite` *bool, optional* - Whether to allow overwriting existing files or to automatically increment target filenames to avoid overwriting. Defaults to False.
46+
47+
#### Returns
48+
49+
# if features='motiongrams':
50+
- `MgList` - An MgList pointing to the output SSM images (as MgImages).
51+
# else:
52+
- `MgImage` - An MgImage to the output SSM.
53+
54+
## smooth_downsample_feature_sequence
55+
56+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_ssm.py#L16)
57+
58+
```python
59+
def smooth_downsample_feature_sequence(
60+
X,
61+
sr,
62+
filt_len=41,
63+
down_sampling=10,
64+
w_type='boxcar',
65+
):
66+
```
67+
68+
Smoothes and downsamples a feature sequence. Smoothing is achieved by convolution with a filter kernel
69+
70+
#### Arguments
71+
72+
- `X` *np.ndarray* - Feature sequence.
73+
- `sr` *int* - Sampling rate.
74+
- `filt_len` *int, optional* - Length of smoothing filter. Defaults to 41.
75+
- `down_sampling` *int, optional* - Downsampling factor. Defaults to 10.
76+
- `w_type` *str, optional* - Window type of smoothing filter. Defaults to 'boxcar'.
77+
78+
#### Returns
79+
80+
- `X_smooth` *np.ndarray* - Smoothed and downsampled feature sequence.
81+
- `sr_feature` *scalar* - Sampling rate of `X_smooth`.

docs/musicalgestures/_videoadjust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Applies contrast and brightness adjustments on the source video using ffmpeg.
3737

3838
## fixed_frames_ffmpeg
3939

40-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_videoadjust.py#L98)
40+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/_videoadjust.py#L99)
4141

4242
```python
4343
def fixed_frames_ffmpeg(

docs/musicalgestures/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- [Pose](_pose.md#pose)
3131
- [Show](_show.md#show)
3232
- [Show Window](_show_window.md#show-window)
33+
- [Ssm](_ssm.md#ssm)
3334
- [Utils](_utils.md#utils)
3435
- [Videoadjust](_videoadjust.md#videoadjust)
3536
- [Videograms](_videograms.md#videograms)
@@ -39,7 +40,7 @@
3940

4041
## Examples
4142

42-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L147)
43+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L148)
4344

4445
```python
4546
class Examples():
@@ -84,7 +85,7 @@ These preprocesses will apply upon creating the MgVideo. Further processes are a
8485

8586
### MgVideo().get_video
8687

87-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L124)
88+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L125)
8889

8990
```python
9091
def get_video():
@@ -94,7 +95,7 @@ Creates a video attribute to the Musical Gestures object with the given correct
9495

9596
### MgVideo().info
9697

97-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L112)
98+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L113)
9899

99100
```python
100101
def info(type='video'):
@@ -104,7 +105,7 @@ Retrieves the information related to video, audio and format.
104105

105106
### MgVideo().test_input
106107

107-
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L108)
108+
[[find in source code]](https://github.com/fourMs/MGT-python/blob/master/musicalgestures/__init__.py#L109)
108109

109110
```python
110111
def test_input():

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
setup(
1313
name='musicalgestures',
1414
packages=['musicalgestures'],
15-
version='v1.2.3',
15+
version='v1.2.4',
1616
license='GNU General Public License v3 (GPLv3)',
1717
description='Musical Gestures Toolbox for Python',
1818
long_description=README,
@@ -23,7 +23,7 @@
2323
author='University of Oslo fourMs Lab',
2424
author_email='[email protected]',
2525
url='https://github.com/fourMs/MGT-python',
26-
download_url='https://github.com/fourMs/MGT-python/archive/v1.2.3.tar.gz',
26+
download_url='https://github.com/fourMs/MGT-python/archive/v1.2.4.tar.gz',
2727
keywords=['Computer Vision', 'Motion Analysis',
2828
'Musical Gestures', 'Video-Analysis'],
2929
install_requires=[

0 commit comments

Comments
 (0)