Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release] 0.1.1 🎉 #5

Merged
merged 5 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
## [0.1.1](https://github.com/eonu/torch-fsdd/releases/tag/v0.1.1)

### Major changes

- Add `torch` and `torchaudio` dependencies to `docs/requirements.txt`. ([#4](https://github.com/eonu/torch-fsdd/pull/4))
- Upgrade minimum package dependency versions: ([#3](https://github.com/eonu/torch-fsdd/pull/3))
- `torch` (>= 1.8)
- `torchaudio` (>= 0.8)
- `torchvision` (>= 0.9) - only used in tests and notebooks

### Minor changes

- Remove platform-dependent `torch`, `torchaudio` and `torchvision` installation for tests. ([#1](https://github.com/eonu/torch-fsdd/pull/1))
- Move Travis badges to separate `README.md` section. ([#2](https://github.com/eonu/torch-fsdd/pull/2))

## [0.1.0](https://github.com/eonu/torch-fsdd/releases/tag/v0.1.0)

#### Major changes
### Major changes

Nothing, initial release!
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
<a href="https://raw.githubusercontent.com/eonu/torchfsdd/master/LICENSE">
<img src="https://img.shields.io/pypi/l/torchfsdd?style=flat-square" alt="PyPI - License"/>
</a>
<a href="https://torchfsdd.readthedocs.io/en/latest">
<img src="https://readthedocs.org/projects/torchfsdd/badge/?version=latest&style=flat-square" alt="Read The Docs - Documentation">
</a>
<a href="https://travis-ci.org/eonu/torchfsdd">
<img src="https://img.shields.io/travis/eonu/torchfsdd?logo=travis&style=flat-square" alt="Travis - Build">
<a href="https://torch-fsdd.readthedocs.io/en/latest/">
<img src="https://readthedocs.org/projects/torch-fsdd/badge/?version=latest&style=flat-square" alt="Read The Docs - Documentation">
</a>
</p>

Expand All @@ -33,6 +30,12 @@ The data set can be though of as an audio version of the popular [MNIST data set
Models based on recurrent neural networks that can be implemented in PyTorch are a common approach
for this task, and TorchFSDD aims to provide an interface to FSDD for such neural networks in PyTorch, by providing a [`torch.utils.data.Dataset`](https://pytorch.org/docs/stable/data.html#torch.utils.data.Dataset) wrapper that is ready to be used with a [`torch.utils.data.DataLoader`](https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader).

## Build status

| `master` | `dev` |
| -------- | ------|
| [![Travis Build (Master)](https://img.shields.io/travis/com/eonu/torch-fsdd?logo=travis&style=flat-square)](https://travis-ci.com/github/eonu/torch-fsdd) | [![Travis Build (Development)](https://img.shields.io/travis/com/eonu/torch-fsdd/dev?logo=travis&style=flat-square)](https://travis-ci.com/github/eonu/torch-fsdd) |

## Examples

```python
Expand Down Expand Up @@ -69,8 +72,8 @@ pip install torchfsdd

**Note**: TorchFSDD assumes you have the following packages already installed (along with Python v3.6+).

- [`torch`](https://github.com/pytorch/audio) (>= 1.6.0)
- [`torchaudio`](https://github.com/pytorch/pytorch) (>= 0.6.0)
- [`torch`](https://github.com/pytorch/audio) (>= 1.8.0)
- [`torchaudio`](https://github.com/pytorch/pytorch) (>= 0.8.0)

Since there are many different possible configurations when installing PyTorch (e.g. CPU or GPU, CUDA version), we leave this up to the user instead of specifying particular binaries to install alongside TorchFSDD.

Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
torch==1.8.0
torchaudio==0.8.0
sphinx==3.5.4
9 changes: 3 additions & 6 deletions lib/test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==1.6.0+cpu; sys_platform == 'linux'
torch==1.6.0; sys_platform == 'darwin'
torchaudio==0.6.0+cpu; sys_platform == 'linux'
torchaudio==0.6.0; sys_platform == 'darwin'
torchvision==0.7.0+cpu; sys_platform == 'linux'
torchvision==0.7.0; sys_platform == 'darwin'
torch==1.8.0
torchaudio==0.8.0
torchvision==0.9.0
pytest==6.2.3
20 changes: 8 additions & 12 deletions lib/test/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,17 @@ def test_generator_train_val_test_split_17_50_33():
assert len(test) == 960

def test_dataset_no_transforms():
"""Note: This test may fail if not on Linux."""
fsdd = TorchFSDD(glob.glob('lib/test/data/v1.0.10/*.wav'))
x, y = fsdd[0]
assert isinstance(x, torch.Tensor)
assert x.ndim == 1
assert x.min() >= -1
assert x.max() <= 1
assert y == 5
assert y == 7

def test_dataset_transforms_single():
"""Note: This test may fail if not on Linux."""
files = glob.glob('lib/test/data/v1.0.10/*.wav')
x_original, y = TorchFSDD(files)[0]
x_trans, _ = TorchFSDD(files, transforms=TrimSilence(threshold=0.1))[0]
Expand All @@ -267,9 +269,10 @@ def test_dataset_transforms_single():
assert x_trans.min() >= -1
assert x_trans.max() <= 1
assert len(x_original) != len(x_trans)
assert y == 5
assert y == 7

def test_dataset_transforms_multiple():
"""Note: This test may fail if not on Linux."""
n_mfcc = 13
files = glob.glob('lib/test/data/v1.0.10/*.wav')
x_original, y = TorchFSDD(files)[0]
Expand All @@ -279,8 +282,8 @@ def test_dataset_transforms_multiple():
]))[0]
assert isinstance(x_trans, torch.Tensor)
assert x_trans.ndim == 2
assert x_trans.shape == (n_mfcc, 12)
assert y == 5
assert x_trans.shape == (n_mfcc, 9)
assert y == 7

def test_dataset_load_all_false():
files = glob.glob('lib/test/data/v1.0.10/*.wav')
Expand All @@ -298,11 +301,4 @@ def test_dataset_load_all_true():
assert hasattr(fsdd, 'labels')
assert isinstance(fsdd.labels, list)
assert isinstance(fsdd.labels[0], int)
assert len(fsdd.labels) == len(files)

def test_dataset_args():
offset = 100
files = glob.glob('lib/test/data/v1.0.10/*.wav')
x1, _ = TorchFSDD(files)[0]
x2, _ = TorchFSDD(files, offset=offset)[0]
assert torch.eq(x2, x1[100:]).all()
assert len(fsdd.labels) == len(files)
8 changes: 4 additions & 4 deletions lib/torchfsdd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.1.0'
__version__ = '0.1.1'

import importlib, platform
from pkg_resources import packaging
Expand All @@ -7,8 +7,8 @@
else:
from importlib import metadata

MIN_TORCH_VERSION = '1.6'
MIN_TORCHAUDIO_VERSION = '0.6'
MIN_TORCH_VERSION = '1.8'
MIN_TORCHAUDIO_VERSION = '0.8'

def check_package(pkg, min_version, url):
"""Checks whether a specified package has been installed,
Expand All @@ -20,7 +20,7 @@ def check_package(pkg, min_version, url):
Name of the package.

min_version: str
Minimum version for the package, e.g. `1.6`.
Minimum version for the package, e.g. `1.8`.

url: str
Package installation page URL (for help).
Expand Down
12 changes: 6 additions & 6 deletions notebooks/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==1.6.0+cpu; sys_platform == 'linux'
torch==1.6.0; sys_platform == 'darwin'
torchaudio==0.6.0+cpu; sys_platform == 'linux'
torchaudio==0.6.0; sys_platform == 'darwin'
torchvision==0.7.0+cpu; sys_platform == 'linux'
torchvision==0.7.0; sys_platform == 'darwin'
torch==1.8.0+cpu; sys_platform == 'linux'
torch==1.8.0; sys_platform == 'darwin'
torchaudio==0.8.0+cpu; sys_platform == 'linux'
torchaudio==0.8.0; sys_platform == 'darwin'
torchvision==0.9.0+cpu; sys_platform == 'linux'
torchvision==0.9.0; sys_platform == 'darwin'
jupyter
matplotlib
tqdm
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pkg_resources import packaging
from setuptools import setup, find_packages

VERSION = '0.1.0'
VERSION = '0.1.1'

with open('README.md', 'r', encoding='utf8') as fh:
long_description = fh.read()
Expand Down Expand Up @@ -47,5 +47,5 @@
],
python_requires = '>=3.6',
install_requires = install_requires,
extra_requires = {'torch': ['torch>=1.6+cpu', 'torchaudio>=0.6+cpu']}
extra_requires = {'torch': ['torch>=1.8+cpu', 'torchaudio>=0.8+cpu']}
)