{"id":21638551,"url":"https://github.com/dbcollection/dbcollection-matlab","last_synced_at":"2025-10-29T05:43:36.851Z","repository":{"id":85482712,"uuid":"97699582","full_name":"dbcollection/dbcollection-matlab","owner":"dbcollection","description":"Matlab wrapper for dbcollection","archived":false,"fork":false,"pushed_at":"2018-09-24T20:25:26.000Z","size":39,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-30T11:47:10.724Z","etag":null,"topics":["api","datasets","dbcollection","matlab","wrapper-api"],"latest_commit_sha":null,"homepage":null,"language":"Matlab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbcollection.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-07-19T09:39:34.000Z","updated_at":"2018-09-24T20:25:28.000Z","dependencies_parsed_at":"2023-03-03T11:45:37.588Z","dependency_job_id":null,"html_url":"https://github.com/dbcollection/dbcollection-matlab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dbcollection/dbcollection-matlab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcollection%2Fdbcollection-matlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcollection%2Fdbcollection-matlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcollection%2Fdbcollection-matlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcollection%2Fdbcollection-matlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbcollection","download_url":"https://codeload.github.com/dbcollection/dbcollection-matlab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcollection%2Fdbcollection-matlab/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265222937,"owners_count":23730320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","datasets","dbcollection","matlab","wrapper-api"],"created_at":"2024-11-25T04:10:01.346Z","updated_at":"2025-10-29T05:43:36.561Z","avatar_url":"https://github.com/dbcollection.png","language":"Matlab","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbcollection for Matlab\n\n[![Build Status](https://travis-ci.org/dbcollection/dbcollection-matlab.svg?branch=master)](https://travis-ci.org/dbcollection/dbcollection-matlab)\n\nThis is a simple Matlab wrapper for the Python's [dbcollection](https://github.com/dbcollection/dbcollection) module. The functionality is almost the same, appart from some few minor differences related to Lua, namely regarding setting up ranges when fetching data.\n\nInternally it calls the Python's dbcollection module for data download/process/management. The, Matlab interacts solely with the metadata `hdf5` file to fetch data from disk.\n\n\n## Package installation\n\n## Requirements\n\nThis package requires:\n\n- dbcollection (Python).\n- Matlab \u003e= 2014a or octave \u003e= 4.0.0\n- [JSONlab](https://github.com/fangq/jsonlab)\n\n\u003e Note: This code may work on other previous versions of Matlab but, since it was developed and tested only on Matlab 2014a and octave \u003e= 4.0.0, I cannot provide any garantees concerning older version compatabilities.\n\n\n### Installation\n\nTo install the dbcollection's Matlab API you must first have the Python's version installed in your system. If you do not have it already installed, then you can install it either via `pip`, `conda` or from [source](https://github.com/dbcollection/dbcollection#package-installation). Here we'll use `pip` to install this package:\n\n```bash\n$ pip install dbcollection==0.2.6\n```\n\nAfter you have the Python's version installed in your system, get the Matlab's API via the following repository:\n\n```bash\n$ git clone https://github.com/dbcollection/dbcollection-matlab\n```\n\nThen, add `dbcollection-matlab/` to your Matlab's path:\n\n```matlab\naddpath('\u003cpath\u003e/dbcollection-matlab/');\n```\n\n\nAlso, this package requires the [JSONlab](https://github.com/fangq/jsonlab) json encoder/decoder to work. To install this package just download the repo to disk:\n\n```bash\n$ git clone https://github.com/fangq/jsonlab\n```\n\nand add it your Matlab's path:\n\n```matlab\naddpath('/path/to/jsonlab');\n```\n\n\n## Getting started\n\n### Usage\n\nThis package follows the same API as the Python version. Once installed, to use the package simply call the class *dbcollection*:\n\n```matlab\ndbc = dbcollection();\n```\n\nThen, just like in Python, to load a dataset you simply do:\n\n```matlab\nmnist = dbc.load('mnist');\n```\n\nYou can also select a specific task for any dataset by using the `task` option.\n\n```matlab\nmnist = dbc.load(struct('name', 'mnist', 'task', 'classification'));\n```\n\nThis API lets you download+extract most dataset's data directly from its source to the disk. For that, you can use the `download()` method to fetch data online from the dataset's source repository:\n\n```matlab\ndbc.download(struct('name', 'cifar10', 'data_dir', 'some/dir/path'));\n```\n\n### Data fetching\n\nOnce a dataset has been loaded, in order to retrieve data\nyou can either use Matlab's `HDF5` API or use the provided\nmethods to retrive data from the .h5 metadata file.\n\nFor example, to retrieve an image and its label from the `MNIST` dataset using the Matlab's `HDF5` API you can do the following:\n\n```matlab\nimgs = h5read(mnist.cache_path, 'default/train/images');  % fetch data\nimgs = permute(imgs, ndims(imgs):-1:1);  % permute dimensions to the original format\nimg = imgs(1,:,:,:);  % slice array\n\nlabels = h5read(mnist.cache_path, 'default/train/labels');  % fetch data\nlabels = permute(labels, ndims(labels):-1:1);  % permute dimensions to the original format\nlabel = labels(1,:);  % slice array\n```\n\nor you can use the API provided by this package:\n\n```matlab\nimg = mnist.get('train', 'images', 1)\nlabel = mnist.get('train', 'labels', 1)\n```\n\n\n## Documentation\n\nFor a more detailed view of the Matlab's API documentation see [here](DOCUMENTATION.md#db.documentation).\n\n\n## License\n\n[MIT license](LICESNE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbcollection%2Fdbcollection-matlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbcollection%2Fdbcollection-matlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbcollection%2Fdbcollection-matlab/lists"}