Soundscape Generation
Generate soundscapes from images.
Table of Contents
Installation
Scaper Installation
The sound generation module was developed using Scaper. Given a collection of isolated sound events, Scaper acts as a high-level sequencer that can generate multiple soundscapes from a single probabilistically defined specification.
Follow the instructions give in the following link:
Install Dependencies
pip install -r requirements.txt
Download Cityscapes Dataset
To download the dataset, a cityscapes account is required for the authentification. Such an account can be created
on www.cityscapes-dataset.com. After the registration, run the download_data.sh
script. During the download, it will ask you to provide your email and password for authentification.
./scripts/download_data.sh
Usage
For the object detection module a pre-trained ERFNet is used, which is then finetuned on the Cityscapes dataset.
Train Object Segmentation Network
To train the network, run the follwing command. The hyperparameters epoch and batch size can be configured in the docker-compose.yml file. To load a pre-trained model specify its path in the MODEL_TO_LOAD variable, if the variable is None the model is trained from scratch.
docker-compose up train_object_detection
Test the Segmentation Network
Run the following command to predict the semantic segmentation of every image in the --test_images directory (note:
predictions are saved with the same name and a _pred.jpg suffix). Ensure that you specify the correct image's file type in --test_images_type.
docker-compose up predict_object_detection
Evaluate the Segmentation Network
To evaluate the segmentation network run the command below.
docker-compose up evaluation
Generate soundscapes
To generate soundscapes of every image in the --test_images directory run the following command. The generated audios will be saved in data/soundscapes. Ensure that you specify the correct image's file type in --test_images_type.
docker-compose up sound_generation
Results
Object Detection
The above predictions are produced by a network trained for 67 epochs that achieves a mean class IoU score of 0.7084 on the validation set. The inference time on a Tesla P100 GPU is around 0.2 seconds per image. The model was trained for 70 epochs on a single Tesla P100. After the training, the checkpoint that yielded to highest validation IoU score was selected. The progression of the IoU metric is shown below.
References
- J. Salamon, D. MacConnell, M. Cartwright, P. Li and J. P. Bello, "Scaper: A library for soundscape synthesis and augmentation," 2017 IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (WASPAA), 2017, pp. 344-348, DOI: 10.1109/WASPAA.2017.8170052.
- E. Romera et al., "ERFNet: Efficient Residual Factorized ConvNet for Real-time Semantic Segmentation", 2017
- Official PyTorch implementation of ERFNet
Metadata
Release files for soundscape-generation 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| soundscape_generation-0.1.1.tar.gz | 15.9 kB | Without provenance | Details for soundscape_generation-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| soundscape_generation-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for soundscape_generation-0.1.1-py3-none-any.whl |
Total release size: 34.3 kB
Release files / soundscape_generation-0.1.1.tar.gz
| Download URL | soundscape_generation-0.1.1.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11d4ac9fb05112ef3dc9e280566bd3129c4d1612a0bffcbe0a07463b862e14f6
|
|
BLAKE2b-256 checksum How to use checksums |
72eda709f22f86bb3916d13a280e4acf1fa510dabbfdd9a323340f982c4da235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11
|
Release files / soundscape_generation-0.1.1-py3-none-any.whl
| Download URL | soundscape_generation-0.1.1-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50a5ef191431d3279afb11aeb22c96d141ff963c5aa40930fa8f6986be6d2d95
|
|
BLAKE2b-256 checksum How to use checksums |
840c79b1f01f792399ba077f9ef88fed0d67206904af33681606438b4d00ee91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11
|
Security for soundscape-generation 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.