Stay organized with collections
Save and categorize content based on your preferences.
Description:
SA-1B Download
Segment Anything 1 Billion (SA-1B) is a dataset designed for training
general-purpose object segmentation models from open world images. The dataset
was introduced in the paper
"Segment Anything".
The SA-1B dataset consists of 11M diverse, high-resolution, licensed, and
privacy-protecting images and 1.1B mask annotations. Masks are given in the COCO
run-length encoding (RLE) format, and do not have classes.
Manual download instructions: This dataset requires you to
download the source data manually into download_config.manual_dir
(defaults to ~/tensorflow_datasets/downloads/manual/):
Download the links file from https://ai.facebook.com/datasets/segment-anything-downloadsmanual_dir should contain the links file saved as segment_anything_links.txt.
FeaturesDict({'annotations':Sequence({'area':Scalar(shape=(),dtype=uint64,description=Theareainpixelsofthemask.),'bbox':BBoxFeature(shape=(4,),dtype=float32,description=Theboxaroundthemask,inTFDSformat.),'crop_box':BBoxFeature(shape=(4,),dtype=float32,description=Thecropoftheimageusedtogeneratethemask,inTFDSformat.),'id':Scalar(shape=(),dtype=uint64,description=Identifierfortheannotation.),'point_coords':Tensor(shape=(1,2),dtype=float64,description=Thepointcoordinatesinputtothemodeltogeneratethemask.),'predicted_iou':Scalar(shape=(),dtype=float64,description=Themodel's own prediction of the mask'squality.),'segmentation':FeaturesDict({'counts':string,'size':Tensor(shape=(2,),dtype=uint64),}),'stability_score':Scalar(shape=(),dtype=float64,description=Ameasureofthemask's quality.),}),'image':FeaturesDict({'content':Image(shape=(None,None,3),dtype=uint8,description=Contentoftheimage.),'file_name':string,'height':uint64,'image_id':uint64,'width':uint64,}),})
Feature documentation:
Feature
Class
Shape
Dtype
Description
FeaturesDict
annotations
Sequence
annotations/area
Scalar
uint64
The area in pixels of the mask.
annotations/bbox
BBoxFeature
(4,)
float32
The box around the mask, in TFDS format.
annotations/crop_box
BBoxFeature
(4,)
float32
The crop of the image used to generate the mask, in TFDS format.
annotations/id
Scalar
uint64
Identifier for the annotation.
annotations/point_coords
Tensor
(1, 2)
float64
The point coordinates input to the model to generate the mask.
annotations/predicted_iou
Scalar
float64
The model's own prediction of the mask's quality.
annotations/segmentation
FeaturesDict
Encoded segmentation mask in COCO RLE format (dict with keys size and counts).
[null,null,["Last updated 2024-12-11 UTC."],[],[],null,["# segment_anything\n\n\u003cbr /\u003e\n\n| **Warning:** Manual download required. See instructions below.\n\n- **Description**:\n\nSA-1B Download\n==============\n\nSegment Anything 1 Billion (SA-1B) is a dataset designed for training\ngeneral-purpose object segmentation models from open world images. The dataset\nwas introduced in the paper\n[\"Segment Anything\"](https://arxiv.org/abs/2304.02643).\n\nThe SA-1B dataset consists of 11M diverse, high-resolution, licensed, and\nprivacy-protecting images and 1.1B mask annotations. Masks are given in the COCO\nrun-length encoding (RLE) format, and do not have classes.\n\nThe license is custom. Please, read the full terms and conditions on\n\u003chttps://ai.facebook.com/datasets/segment-anything-downloads\u003e\n\nAll the features are in the original dataset except `image.content` (content of\nthe image).\n\nYou can decode segmentation masks with: \n\n import tensorflow_datasets as tfds\n\n pycocotools = tfds.core.lazy_imports.pycocotools\n\n ds = tfds.load('segment_anything', split='train')\n for example in tfds.as_numpy(ds):\n segmentation = example['annotations']['segmentation']\n for counts, size in zip(segmentation['counts'], segmentation['size']):\n encoded_mask = {'size': size, 'counts': counts}\n mask = pycocotools.decode(encoded_mask) # np.array(dtype=uint8) mask\n ...\n\n- **Homepage** :\n \u003chttps://ai.facebook.com/datasets/segment-anything-downloads\u003e\n\n- **Source code** :\n [`tfds.datasets.segment_anything.Builder`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/datasets/segment_anything/segment_anything_dataset_builder.py)\n\n- **Versions**:\n\n - **`1.0.0`** (default): Initial release.\n- **Download size** : `10.28 TiB`\n\n- **Dataset size** : `10.59 TiB`\n\n- **Manual download instructions** : This dataset requires you to\n download the source data manually into `download_config.manual_dir`\n (defaults to `~/tensorflow_datasets/downloads/manual/`): \n\n Download the links file from \u003chttps://ai.facebook.com/datasets/segment-anything-downloads\u003e `manual_dir` should contain the links file saved as segment_anything_links.txt.\n\n- **Auto-cached**\n ([documentation](https://www.tensorflow.org/datasets/performances#auto-caching)):\n No\n\n- **Splits**:\n\n| Split | Examples |\n|-----------|------------|\n| `'train'` | 11,185,362 |\n\n- **Feature structure**:\n\n FeaturesDict({\n 'annotations': Sequence({\n 'area': Scalar(shape=(), dtype=uint64, description=The area in pixels of the mask.),\n 'bbox': BBoxFeature(shape=(4,), dtype=float32, description=The box around the mask, in TFDS format.),\n 'crop_box': BBoxFeature(shape=(4,), dtype=float32, description=The crop of the image used to generate the mask, in TFDS format.),\n 'id': Scalar(shape=(), dtype=uint64, description=Identifier for the annotation.),\n 'point_coords': Tensor(shape=(1, 2), dtype=float64, description=The point coordinates input to the model to generate the mask.),\n 'predicted_iou': Scalar(shape=(), dtype=float64, description=The model's own prediction of the mask's quality.),\n 'segmentation': FeaturesDict({\n 'counts': string,\n 'size': Tensor(shape=(2,), dtype=uint64),\n }),\n 'stability_score': Scalar(shape=(), dtype=float64, description=A measure of the mask's quality.),\n }),\n 'image': FeaturesDict({\n 'content': Image(shape=(None, None, 3), dtype=uint8, description=Content of the image.),\n 'file_name': string,\n 'height': uint64,\n 'image_id': uint64,\n 'width': uint64,\n }),\n })\n\n- **Feature documentation**:\n\n| Feature | Class | Shape | Dtype | Description |\n|---------------------------------|--------------|-----------------|---------|------------------------------------------------------------------------------------|\n| | FeaturesDict | | | |\n| annotations | Sequence | | | |\n| annotations/area | Scalar | | uint64 | The area in pixels of the mask. |\n| annotations/bbox | BBoxFeature | (4,) | float32 | The box around the mask, in TFDS format. |\n| annotations/crop_box | BBoxFeature | (4,) | float32 | The crop of the image used to generate the mask, in TFDS format. |\n| annotations/id | Scalar | | uint64 | Identifier for the annotation. |\n| annotations/point_coords | Tensor | (1, 2) | float64 | The point coordinates input to the model to generate the mask. |\n| annotations/predicted_iou | Scalar | | float64 | The model's own prediction of the mask's quality. |\n| annotations/segmentation | FeaturesDict | | | Encoded segmentation mask in COCO RLE format (dict with keys `size` and `counts`). |\n| annotations/segmentation/counts | Tensor | | string | |\n| annotations/segmentation/size | Tensor | (2,) | uint64 | |\n| annotations/stability_score | Scalar | | float64 | A measure of the mask's quality. |\n| image | FeaturesDict | | | |\n| image/content | Image | (None, None, 3) | uint8 | Content of the image. |\n| image/file_name | Tensor | | string | |\n| image/height | Tensor | | uint64 | |\n| image/image_id | Tensor | | uint64 | |\n| image/width | Tensor | | uint64 | |\n\n- **Supervised keys** (See\n [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):\n `None`\n\n- **Figure**\n ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):\n Not supported.\n\n- **Examples**\n ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):\n\nDisplay examples... \n\n- **Citation**:\n\n @misc{kirillov2023segment,\n title={Segment Anything},\n author={Alexander Kirillov and Eric Mintun and Nikhila Ravi and Hanzi Mao and Chloe Rolland and Laura Gustafson and Tete Xiao and Spencer Whitehead and Alexander C. Berg and Wan-Yen Lo and Piotr Dollár and Ross Girshick},\n year={2023},\n eprint={2304.02643},\n archivePrefix={arXiv},\n primaryClass={cs.CV}\n }"]]