If your algorithm does not need any customized dataset, you can use these off-the-shelf datasets under [datasets](../../mmselfsup/datasets). But to use these existing datasets, you have to convert your dataset to existing dataset format.
### An example of customized dataset
Assuming the format of your dataset's annotation file is:
```text
000001.jpg 0
000002.jpg 1
```
To write a new dataset, you need to implement:
-`DataSource`: inherited from `BaseDataSource` and responsible for loading the annotation files and reading images.
Assume the name of your `DataSource` is `NewDataSource`, you can create a file, named `new_data_source.py` under `mmselfsup/datasets/data_sources` and implement `NewDataSource` in it.
Assume the name of your `Dataset` is `NewDataset`, you can create a file, named `new_dataset.py` under `mmselfsup/datasets` and implement `NewDataset` in it.