File size: 1,412 Bytes
79855f2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
---
license: cc-by-nc-4.0
dataset_info:
features:
- name: image
dtype: string
- name: label
dtype: string
splits:
- name: train
num_bytes: 17286021131
num_examples: 405055
download_size: 17266005314
dataset_size: 17286021131
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
---
### Install datasets package
First, make sure you have the datasets library installed. If not, you can install it using:
```bash
pip install datasets
```
### Load Dataset from Arrow File
Download all arrow files to local_path. The follow is how to load arrow files and decode image:
```python
from datasets import load_from_disk
from io import BytesIO
import base64
from PIL import Image
import mmengine
# Path to your Arrow dataset directory
arrow_dataset_path = 'path_to_your_arrow_dataset_directory'
# Load the dataset
dataset = load_from_disk(arrow_dataset_path)
cat_tree = mmengine.load('v3det_2023_v1_category_tree.json')
# Each dataset entry is composed of an image in the format of base64 string and its corresponding imagenet label id
# Here is an example of how to decode image, and convert imagenet label id to v3det class name
# You can download v3det_2023_v1_category_tree.json here: https://v3det.openxlab.org.cn/download
image = Image.open(BytesIO(base64.b64decode(dataset[0]['image'])))
cat_name = cat_tree['id2name'][dataset[0]['label']]
``` |