Comments (2)
The reason every distribution tuple is validated when an event is added is that it can be different each time.
In your case you always add the same list of source files, but in general each time you add an event you could specify a different list of source files (or a different distribution tuple altogether) meaning we must validate the distribution tuple every time we call add_event
.
I we don't validate the source files when an event is added it could cause Scaper to crash downstream. So from a design standpoint I believe what we are doing is the correct thing to do.
We could, potentially, add a flag to add_event
to disable source file validation (e.g. disable_source_file_validation=False
by default), since this is the only validation that involves file I/O - I believe all the other validation steps are insignificant computationally.
@moabaom To help us better understand how serious an issue this is, can you share a Minimal Working Example (MWE) and report the execution time with and without source file validation? Thanks!
from scaper.
p.s - actually another option would be to create a "cache" for validated files, such that if a scaper object has already validated that a file exists, it doesn't try to validate it again. This is probably safer than disabling validation and achieves the same speedup. If you create a new scaper object in a loop (like in the example), we could support providing a list of validated files as input, and the scaper object will not try to validate these source files.
Still, let's start with the MWE and timings to better scope the problem. thanks.
from scaper.
Related Issues (20)
- Test more platforms. HOT 1
- Write JAMS annotations in consistent order
- Scaper sometimes produces soundscapes with clipping if ref_db is set badly. HOT 1
- Remove ann.sandbox.scaper.soundscape_audio_path and isolated_events_audio_path
- Create more regression data for #132 + other test strengthening HOT 1
- Consolidate jams metadata saving for generate and generate_from_jams
- Reverb and clipping/peak normalization
- Change sox version pin in setup.py from ==1.4.0 to >=1.4.0
- General and speech recognition enhancement HOT 2
- scaper.scaper_exceptions.ScaperError: Label value must match one of the available labels: [] HOT 1
- Manage co-occurence of events HOT 2
- 'Choose' with non uniform distribution HOT 6
- Soxbindings problem python3.7 HOT 3
- Applying reverb to each source file HOT 1
- Multi-speaker mixture
- Sum-up of isolated events and soundscape are not equal, when Reverb=None
- Does fg_spec need to store all provided paths?
- Please expose the soundfile subtype parameter as a self parameter
- Unable to install scaper through pip on macOS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scaper.