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

v0.9.0 #702

Merged
merged 133 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
2d4bf1d
not working, just ideas
sammlapp Jan 12, 2023
bcb4f45
Merge pull request #651 from kitzeslab/master
sammlapp Jan 18, 2023
361956b
Changed link in annotaqtion tutorial
syunkova Feb 9, 2023
aba8d40
Moved download links in tutorials box --> onedrive
syunkova Feb 9, 2023
5db9689
moved download links to kitzeslab google drive
syunkova Feb 13, 2023
157ace6
Merge pull request #658 from kitzeslab/578_links
sammlapp Feb 21, 2023
8cc6365
working prototype of Sample class
sammlapp Feb 22, 2023
e6989c0
move logic to create dataloder to intern. function
sammlapp Feb 24, 2023
c505bcd
working prototype
sammlapp Feb 24, 2023
bea5e4d
add helpful repr method for AudioSample
sammlapp Feb 24, 2023
e02cc9c
clarify purpose of AudioSplittingDataset
sammlapp Feb 24, 2023
2626317
refactor cnn dataloader
sammlapp Feb 24, 2023
a288a64
update tests
sammlapp Feb 24, 2023
ff18ddf
update tests and debug (2 tests still failing)
sammlapp Feb 24, 2023
7157e6b
update preprocessor comments/docstrings
sammlapp Feb 28, 2023
e32b9e6
fix behavior for predict() w zero samples
sammlapp Feb 28, 2023
0769994
workaround for adding trace with Spectrogram
sammlapp Feb 28, 2023
a276522
add wandb.watch in CNN.train()
sammlapp Mar 3, 2023
35b27c3
change implementation of wandb.watch
sammlapp Mar 3, 2023
902d1b8
replace .forward() with __call__()
sammlapp Mar 3, 2023
f4eee16
correct comment steps-> batches
sammlapp Mar 14, 2023
afa4fd7
Merge pull request #675 from kitzeslab/feat_wandb_watch
sammlapp Mar 16, 2023
1af4dfc
Merge branch 'develop' into feat_gradcam_sl
sammlapp Mar 16, 2023
0f02502
working cam + gbp for multiple classes
sammlapp Mar 16, 2023
c820eae
full working cam implementation
sammlapp Mar 17, 2023
c353968
change bypass_augmentations default to True
sammlapp Mar 17, 2023
750d0c2
Audio class display and from_url
sammlapp Mar 21, 2023
f5a5556
add tests and default target layers
sammlapp Mar 22, 2023
f69b5e5
add identity helper function
sammlapp Mar 27, 2023
73d06ce
add pytorch_grad_cam dependency
sammlapp Mar 27, 2023
b6d2663
fix preprocessor trace test
sammlapp Mar 28, 2023
2d21e02
update poetry lock
sammlapp Mar 28, 2023
8a8da34
update pyproject.toml author list
sammlapp Mar 28, 2023
413cd24
change default resample type to 'soxr_hq'
sammlapp Mar 28, 2023
e26c367
Merge pull request #676 from kitzeslab/feat_gradcam_sl
sammlapp Mar 28, 2023
595bd8d
call librosa.filters.mel with argument names
sammlapp Mar 28, 2023
622406a
Merge branch 'develop' into issue_674_resampy
sammlapp Mar 28, 2023
7b9b451
implement save_torch_dict and load_torch_dict
sammlapp Mar 28, 2023
29df2dc
update check for warning
sammlapp Mar 28, 2023
ffac977
Merge branch 'develop' into issue_674_resampy
sammlapp Mar 28, 2023
cee66b1
Merge pull request #682 from kitzeslab/issue_674_resampy
sammlapp Mar 28, 2023
f80335e
rename `audiomoth` module to `aru`
sammlapp Mar 28, 2023
9f48f2b
refactor module structure
sammlapp Mar 28, 2023
c0eb280
rename helpers -> utils
sammlapp Mar 28, 2023
cc10dc7
update modules.rst
sammlapp Mar 28, 2023
d434dfc
remove audio_tools
sammlapp Mar 28, 2023
5448ee8
replace "to_img" references with "to_tensor"
sammlapp Mar 28, 2023
4746e2f
allow full_duration=None in .one_hot_clip_labels
sammlapp Mar 29, 2023
1b08899
update author list
sammlapp Mar 29, 2023
9036853
refactor BoxedAnnotations to support multiple files
sammlapp Mar 29, 2023
b0f558b
Merge pull request #683 from kitzeslab/feat_667_save
sammlapp Mar 30, 2023
4488d8e
Merge branch 'develop' into issue_rename_660_659
sammlapp Mar 30, 2023
0b1736a
remove audio_tools import
sammlapp Mar 30, 2023
8258ed3
warn usr if load_model loads model of old version
sammlapp Mar 30, 2023
3be36d7
use [col] instead of .loc[:,col]
sammlapp Mar 30, 2023
882b247
Merge pull request #686 from kitzeslab/issue_rename_660_659
sammlapp Mar 31, 2023
75182b1
Merge branch 'develop' into issue_661_load_across_versions
sammlapp Mar 31, 2023
4370f32
Merge branch 'develop' into feat_579_boxed_annotations
sammlapp Mar 31, 2023
d7a921a
implement Audio._spawn
sammlapp Mar 31, 2023
5e36348
Merge pull request #689 from kitzeslab/issue_661_load_across_versions
sammlapp Mar 31, 2023
30f572b
Merge branch 'develop' into issue_679_metadata
sammlapp Mar 31, 2023
27dab9d
remove file_subset option from to_raven_files
sammlapp Apr 1, 2023
a61520e
update tests for BoxedAnnotations
sammlapp Apr 1, 2023
b6f4f8e
add test for _spawn
sammlapp Apr 1, 2023
c73989a
fix incorrect trimming logic
sammlapp Apr 1, 2023
d597475
fix assertion error syntax in _spawn
sammlapp Apr 1, 2023
b81ad0c
Merge pull request #690 from kitzeslab/issue_679_metadata
sammlapp Apr 3, 2023
55ae48d
raise GetDurationExceptions in make_clip_df
sammlapp Apr 3, 2023
11b5dc8
avoid lambda fn in CNN
sammlapp Apr 4, 2023
b027e09
black format
sammlapp Apr 4, 2023
3fd1a40
resolve #664 get_duration(path=)
sammlapp Apr 4, 2023
2c7820b
change heading level in tutorial
sammlapp Apr 4, 2023
9f79810
Merge pull request #688 from kitzeslab/feat_579_boxed_annotations
sammlapp Apr 7, 2023
a8e0e21
add helpful input validation for CAM.plot
sammlapp Apr 7, 2023
8b982f2
Merge pull request #691 from kitzeslab/feat_audio_display
sammlapp Apr 7, 2023
372d8f7
add gcc (generalized cross correlation) function and tests
louisfh Apr 14, 2023
05cc38e
change gcc outputs order to match scipy
sammlapp Apr 15, 2023
4f52cbf
padding with zeros not necessary
sammlapp Apr 15, 2023
9ebf82f
fix implementations of HT and SCOT filters
sammlapp Apr 15, 2023
b95dfc9
docstring and tdoa function
sammlapp Apr 15, 2023
bcea8a8
speed optimization
sammlapp Apr 15, 2023
9f24465
use ideal fft length
sammlapp Apr 15, 2023
ed27b71
add helper for Audio tdoa
sammlapp Apr 15, 2023
4c0ee58
fix syntax error
sammlapp Apr 17, 2023
addf65a
update tests, docstrings, variable names
sammlapp Apr 17, 2023
7ff5bd9
add tests for audio.estimate_delay
sammlapp Apr 17, 2023
a21cd94
add test for tdoa(return_max=True)
sammlapp Apr 17, 2023
824502c
expose return_max in audio.estimate_delay
sammlapp Apr 17, 2023
29b25d5
correct the implementation of HT filter
sammlapp Apr 17, 2023
1ec2dbd
add epsilon to avoid div by 0 in gamma
sammlapp Apr 17, 2023
2c33ae6
Merge pull request #693 from kitzeslab/feat_generalized_cross_correla…
sammlapp Apr 18, 2023
4812bc4
add max_delay arg to tdoa function
louisfh Apr 18, 2023
d774aae
add documentation for max_delay
louisfh Apr 18, 2023
022ee81
add localizer test files
louisfh Apr 18, 2023
f7727e6
rename localize to soundfinder
louisfh Apr 18, 2023
adea12c
refactoring
louisfh Apr 18, 2023
e34dc7a
add calc_tdoa_residuals
louisfh Apr 19, 2023
6810781
more detailed documentation
sammlapp Apr 22, 2023
3835ba5
refactor in progress
sammlapp Apr 24, 2023
05a51f3
change self.detections to self.grouped_detections in Localizer class
louisfh Apr 24, 2023
6e0274f
change predictions to detections in Localizer
louisfh Apr 24, 2023
5e1cc3e
rewrite gillette and fix tests
louisfh Apr 24, 2023
87bb298
add 2d test for gillette
louisfh Apr 24, 2023
2b345ce
fix localizer test
louisfh Apr 24, 2023
957b106
modify gillette_localize test
louisfh Apr 25, 2023
ffe0dba
make localizer take binary detections as input, not CNN predictions
louisfh Apr 25, 2023
eb13505
incorporate gillette refactor
sammlapp Apr 25, 2023
3107fb5
check for min(abs(tdoa)) close to zero not min
sammlapp Apr 25, 2023
56b5f6b
update error msg
sammlapp Apr 25, 2023
6836dfb
correct min-> min(abs())
sammlapp Apr 25, 2023
14050b7
full refactor of localization working
sammlapp Apr 25, 2023
0c79a8d
update audio files for correct delays
sammlapp Apr 25, 2023
40f9c3a
Merge branch 'feat_loca_events' into feat_refact_localizer
sammlapp Apr 25, 2023
070e724
add missing 'order' arg to bandpass
sammlapp Apr 25, 2023
b7b0975
documentation of localization algorithms
sammlapp Apr 25, 2023
5453a57
Merge pull request #697 from kitzeslab/feat_refact_localizer
sammlapp Apr 25, 2023
6bf9359
docs/comments updates for localization module
sammlapp Apr 25, 2023
7cb4dcd
expose invert and colormap in SpectrogramToTensor
sammlapp Apr 26, 2023
876e87b
add pytorch_grad_cam to autodoc_mock_imports
sammlapp Apr 26, 2023
10cec99
update tutorials for 0.9.0
sammlapp Apr 26, 2023
e164811
update version number
sammlapp Apr 26, 2023
324c0ef
re-save notebooks
sammlapp Apr 26, 2023
a82706a
black formatting
sammlapp Apr 26, 2023
8fae612
update ribbit notebook
sammlapp Apr 26, 2023
cd170d2
update dependencies: no longer support python 3.7
sammlapp Apr 27, 2023
7ddb890
no longer support python 3.7
sammlapp Apr 27, 2023
7a0b09e
update version in suggested citation
sammlapp Apr 27, 2023
90a674c
correct path to sample module in modules.rst
sammlapp Apr 27, 2023
6329cad
add categorical_labels to sample, and add tests
sammlapp Apr 27, 2023
1ced644
update wandb_table
sammlapp Apr 27, 2023
a5ac95e
python version support correction in docs
sammlapp Apr 28, 2023
f73fd7b
add docs/tutorials/wandb to gitignore
sammlapp Apr 28, 2023
016d187
rerun cnn notebook
sammlapp Apr 28, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]
# Ensure that all flavours are run to completion even if an other flavor failed
fail-fast: false

Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]
# Ensure that all flavours are run to completion even if an other flavor failed
fail-fast: false
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ doc/_build/
*.DS_Store
docs/tutorials/woodcock_labeled_data
.vscode
docs/tutorials/wandb
11 changes: 5 additions & 6 deletions README.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: don't need a comma after 3.8 in line 20... doesn't matter much

Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ OpenSoundscape is currently in active development. If you find a bug, please sub

#### Suggested Citation
```
Lapp, Rhinehart, Freeland-Haynes, Khilnani, Syunkova, and Kitzes, 2022. "OpenSoundscape v0.8.0".
Lapp, Rhinehart, Freeland-Haynes, Khilnani, Syunkova, and Kitzes, 2023. "OpenSoundscape v0.9.0".
```

# Installation

OpenSoundscape can be installed on Windows, Mac, and Linux machines. It has been tested on Python 3.7, 3.8, and 3.9. For Apple Silicon (M1 chip) users, Python 3.9 is recommended and may be required to avoid dependency issues. Python version 3.7.0 causes dependency issues
and should be avoided.
OpenSoundscape can be installed on Windows, Mac, and Linux machines. It has been tested on Python 3.8, and 3.9. For Apple Silicon (M1 chip) users, Python 3.9 is recommended and may be required to avoid dependency issues.

Most users should install OpenSoundscape via pip: `pip install opensoundscape==0.8.0`. Contributors and advanced users can also use Poetry to install OpenSoundscape.
Most users should install OpenSoundscape via pip: `pip install opensoundscape==0.9.0`. Contributors and advanced users can also use Poetry to install OpenSoundscape.

For more detailed instructions on how to install OpenSoundscape and use it in Jupyter, see the [documentation](http://opensoundscape.org).

Expand Down Expand Up @@ -66,7 +65,7 @@ Audio.from_file(path, start_timestamp=start_time,duration=audio_length)

Using a pre-trained CNN to make predictions on long audio files
```python
from opensoundscape.torch.models.cnn import load_model
from opensoundscape import load_model

#get list of audio files
files = glob('./dir/*.WAV')
Expand All @@ -81,7 +80,7 @@ scores = model.predict(files)

Training a CNN with labeled audio data
```python
from opensoundscape.torch.models.cnn import CNN
from opensoundscape import CNN
from sklearn.model_selection import train_test_split

#load a DataFrame of one-hot audio clip labels
Expand Down
75 changes: 35 additions & 40 deletions docs/api/modules.rst
Original file line number Diff line number Diff line change
@@ -1,52 +1,42 @@
Annotations
^^^^^^^^^^^
.. automodule:: opensoundscape.annotations
:members:

Audio
Audio
^^^^^
.. automodule:: opensoundscape.audio
:members:


AudioMoth
^^^^^^^^^
.. automodule:: opensoundscape.audiomoth
:members:

Audio Tools
^^^^^^^^^^^
.. automodule:: opensoundscape.audio_tools
:members:

Spectrogram
^^^^^^^^^^^
.. automodule:: opensoundscape.spectrogram
:members:

CNN
^^^
.. automodule:: opensoundscape.torch.models.cnn
.. automodule:: opensoundscape.ml.cnn
:members:

torch.models.utils
^^^^^^^^^^^^^^^^^^
.. automodule:: opensoundscape.torch.models.utils
Annotations
^^^^^^^^^^^
.. automodule:: opensoundscape.annotations
:members:

ARU
^^^
.. automodule:: opensoundscape.aru
:members:

Machine Learning utils
^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: opensoundscape.ml.utils
:members:

CNN Architectures
^^^^^^^^^^^^^^^^^
.. automodule:: opensoundscape.torch.architectures.cnn_architectures
:members:

torch.architectures.utils
^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: opensoundscape.torch.architectures.utils
.. automodule:: opensoundscape.ml.cnn_architectures
:members:

WandB (Weights and Biases)
^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: opensoundscape.wandb
Logging with WandB (Weights and Biases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: opensoundscape.logging
:members:

Data Selection
Expand All @@ -56,27 +46,32 @@ Data Selection

Datasets
^^^^^^^^
.. automodule:: opensoundscape.torch.datasets
.. automodule:: opensoundscape.ml.datasets
:members:

GradCam
^^^^^^^
.. automodule:: opensoundscape.torch.grad_cam
CAM (Class Activation Maps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: opensoundscape.ml.cam
:members:

Loss
^^^^
.. automodule:: opensoundscape.torch.loss
.. automodule:: opensoundscape.ml.loss
:members:

Safe Dataset
^^^^^^^^^^^^
.. automodule:: opensoundscape.torch.safe_dataset
.. automodule:: opensoundscape.ml.safe_dataset
:members:

Sample
^^^^^^
.. automodule:: opensoundscape.sample
:members:

Sampling
^^^^^^^^
.. automodule:: opensoundscape.torch.sampling
.. automodule:: opensoundscape.ml.sampling
:members:

Metrics
Expand Down Expand Up @@ -129,7 +124,7 @@ Localization
.. automodule:: opensoundscape.localization
:members:

helpers
^^^^^^^
.. automodule:: opensoundscape.helpers
utils
^^^^^
.. automodule:: opensoundscape.utils
:members:
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = "Sam Lapp, Tessa Rhinehart, Louis Freeland-Haynes, Jatin Khilnani, Alexandra Syunkova, Justin Kitzes"

# The full version, including alpha/beta/rc tags
release = "0.8.0"
release = "0.9.0"


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -101,6 +101,7 @@ def setup(app):
"deprecated",
"skimage",
"wandb",
"pytorch_grad_cam",
]

master_doc = "index"
12 changes: 6 additions & 6 deletions docs/installation/mac_and_linux.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mac and Linux

OpenSoundscape can be installed on Mac and Linux machines with Python 3.7, 3.8, or 3.9 using the pip command `pip install opensoundscape==0.8.0`. We recommend installing OpenSoundscape in a virtual environment to prevent dependency conflicts.
OpenSoundscape can be installed on Mac and Linux machines with Python 3.8, or 3.9 using the pip command `pip install opensoundscape==0.9.0`. We recommend installing OpenSoundscape in a virtual environment to prevent dependency conflicts.

Below are instructions for installation with two package managers:
* `conda`: Python and package management through Anaconda, a package manager popular among scientific programmers
Expand All @@ -13,23 +13,23 @@ Feel free to use another virtual environment manager (e.g. `virtualenvwrapper`)
* Install Anaconda if you don't already have it.
* Download the installer [here](https://www.anaconda.com/products/individual), or
* follow the [installation instructions](https://docs.anaconda.com/anaconda/install/) for your operating system.
* Create a Python (3.7, 3.8, or 3.9) conda environment for opensoundscape: `conda create --name opensoundscape pip python=3.9`
* Create a Python (3.8, or 3.9) conda environment for opensoundscape: `conda create --name opensoundscape pip python=3.9`
* Activate the environment: `conda activate opensoundscape`
* Install opensoundscape using pip: `pip install opensoundscape==0.8.0`
* Install opensoundscape using pip: `pip install opensoundscape==0.9.0`
* Deactivate the environment when you're done using it: `conda deactivate`

## Installation via `venv`

Download Python 3.7, 3.8, or 3.8 from [this website](https://www.python.org/downloads/).
Download Python 3.8 or 3.9 from [this website](https://www.python.org/downloads/).

Run the following commands in your bash terminal:
* Check that you have installed Python 3.7, 3.8, or 3.9.\_: `python3 --version`
* Check that you have installed Python 3.8 or 3.9.\_: `python3 --version`
* Change directories to where you wish to store the environment: `cd [path for environments folder]`
* Tip: You can use this folder to store virtual environments for other projects as well, so put it somewhere that makes sense for you, e.g. in your home directory.
* Make a directory for virtual environments and `cd` into it: `mkdir .venv && cd .venv`
* Create an environment called `opensoundscape` in the directory: `python3 -m venv opensoundscape`
* Activate/use the environment: `source opensoundscape/bin/activate`
* Install OpenSoundscape in the environment: `pip install opensoundscape==0.8.0`
* Install OpenSoundscape in the environment: `pip install opensoundscape==0.9.0`
* Once you are done with OpenSoundscape, deactivate the environment: `deactivate`
* To use the environment again, you will have to refer to absolute path of the virtual environments folder. For instance, if I were on a Mac and created `.venv` inside a directory `/Users/MyFiles/Code` I would activate the virtual environment using: `source /Users/MyFiles/Code/.venv/opensoundscape/bin/activate`

Expand Down
6 changes: 3 additions & 3 deletions docs/installation/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ We recommend installing OpenSoundscape in a package manager. We find that the ea
You can now manage packages with `conda`.

## Install OpenSoundscape in virtual environment
- Create a Python (3.7, 3.8, or 3.9) conda environment for opensoundscape: `conda create --name opensoundscape pip python=3.9`
- Create a Python (3.8, or 3.9) conda environment for opensoundscape: `conda create --name opensoundscape pip python=3.9`
- Activate the environment: `conda activate opensoundscape`
- Install opensoundscape using pip: `pip install opensoundscape==0.8.0`
- Install opensoundscape using pip: `pip install opensoundscape==0.9.0`

If you see an error that says "No matching distribution found...", your
best bet is to use these commands to download then install the package:
Expand All @@ -64,7 +64,7 @@ pip install .

If you run into this error and you are on a Windows 10 machine:
```
(opensoundscape_environment) username@computername:~$ pip install opensoundscape==0.8.0
(opensoundscape_environment) username@computername:~$ pip install opensoundscape==0.9.0
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f7603c5da90>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/opensoundscape/
```
You may be able to solve it by going to System Settings, searching for “Proxy Settings,” and beneath “Automatic proxy setup,” turning “Automatically detect settings” OFF. Restart your terminal for changes to take effect. Then activate the environment and install OpenSoundscape using pip.
Loading