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

Media conversion in audb.load() does not load from cache #324

Closed
hagenw opened this issue Aug 4, 2023 · 1 comment · Fixed by #471
Closed

Media conversion in audb.load() does not load from cache #324

hagenw opened this issue Aug 4, 2023 · 1 comment · Fixed by #471
Assignees
Labels
bug Something isn't working load

Comments

@hagenw
Copy link
Member

hagenw commented Aug 4, 2023

When loading data the second time with audb.load() it will be much faster as the data is loaded from cache:

import audb

audb.config.SHARED_CACHE_ROOT ='./cache'
audb.config.CACHE_ROOT ='./cache'

table = 'emotion.categories.test.gold_standard'

db = audb.load('emodb', version='1.4.1', tables=table)  # ~90 s
db = audb.load('emodb', version='1.4.1', tables=table)  # ~ 1 s

It also works when requesting the same media format as the original one:

db = audb.load('emodb', version='1.4.1', tables=table, format='wav')  # ~90 s
db = audb.load('emodb', version='1.4.1', tables=table, format='wav')  # ~1 s

But this is no longer true when requesting a media format that is different from the original one (even though it is using the same cache folder in both calls):

db = audb.load('emodb', version='1.4.1', tables=table, format='flac')  # ~90 s
db = audb.load('emodb', version='1.4.1', tables=table, format='flac')  # ~90 s
@hagenw hagenw added bug Something isn't working load labels Aug 4, 2023
@hagenw
Copy link
Member Author

hagenw commented Nov 29, 2024

At the moment it fails to find the cached files as we are looking for missing files in audb.core.load._missing_files() with

audb/audb/core/load.py

Lines 876 to 877 in f8e992d

if not os.path.exists(os.path.join(db_root, file)):
missing_files.append(file)

But when we request format="flac", the cached file is file.flac and we are looking if file.wav exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working load
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant