#!/usr/bin/env python3

"""
Test loading Pascal VOC 2012.
"""


from __future__ import print_function
import os
import dbcollection.manager as dbc

# storage dir
data_dir = os.path.join(os.path.expanduser("~"), 'tmp', 'download_data')


# delete all cache data + dir
print('\n==> dbcollection: config_cache()')
dbc.config_cache(delete_cache=True, is_test=True)

# download/setup dataset
print('\n==> dbcollection: load()')
voc2012 = dbc.load(name='pascal_voc_2012', task='detection', data_dir=data_dir, verbose=True, is_test=True)

# print data from the loader
print('\n==> dbcollection: info()')
dbc.info(is_test=True)

# print data from the loader
print('\n######### info #########')
print('Dataset: ' + voc2012.name)
print('Task: ' + voc2012.task)
print('Data path: ' + voc2012.data_dir)
print('Metadata cache path: ' + voc2012.cache_path)

# delete all cache data + dir
print('\n==> dbcollection: config_cache()')
dbc.config_cache(delete_cache=True, is_test=True)
Add load test for the pascal voc 2012 dataset
tests: Add load test for the pascal voc 2012 dataset
