add masks to dataset and bump version
Browse filesFiles changed (2)
- README.md+66-25
- basic_shapes_1000.py+11-5
9 unmodified lines101112131415161718192021221523242518262728212930232431323334354 unmodified lines404142434445464748495051523753545540565758435960454661626364654 unmodified lines707172737475767778798081825983848562868788658990676891929394954 unmodified lines10010110210310410510610710810911011111281113114115841161171188711912089901211221231241254 unmodified lines13013113213313413513613713813914014114210314314414510614614714810914915011111215115215315415560 unmodified lines2162172182192202212229 unmodified lines dtype: image - name: object_mask dtype: image - name: segments dtype: array3_d: shape: - 12 - 512 - 512 dtype: bool splits: - name: train num_bytes: 4500734 num_bytes: 825420657 num_examples: 3200 - name: validation num_bytes: 557191 num_bytes: 103491703 num_examples: 400 - name: test num_bytes: 438883 num_bytes: 167570883 num_examples: 400 download_size: 50730876 dataset_size: 5496808 download_size: 79499715 dataset_size: 1096483243- config_name: circles features: - name: svg4 unmodified lines dtype: image - name: object_mask dtype: image - name: segments dtype: array3_d: shape: - 12 - 512 - 512 dtype: bool splits: - name: train num_bytes: 1105745 num_bytes: 202172900 num_examples: 800 - name: validation num_bytes: 139640 num_bytes: 25380696 num_examples: 100 - name: test num_bytes: 106180 num_bytes: 41889893 num_examples: 100 download_size: 22076447 dataset_size: 1351565 download_size: 28664837 dataset_size: 269443489- config_name: squares features: - name: svg4 unmodified lines dtype: image - name: object_mask dtype: image - name: segments dtype: array3_d: shape: - 12 - 512 - 512 dtype: bool splits: - name: train num_bytes: 1136458 num_bytes: 209226435 num_examples: 800 - name: validation num_bytes: 139444 num_bytes: 26362720 num_examples: 100 - name: test num_bytes: 111843 num_bytes: 41892905 num_examples: 100 download_size: 3133869 dataset_size: 1387745 download_size: 10376213 dataset_size: 277482060- config_name: squares_and_circles features: - name: svg4 unmodified lines dtype: image - name: object_mask dtype: image - name: segments dtype: array3_d: shape: - 12 - 512 - 512 dtype: bool splits: - name: train num_bytes: 1143151 num_bytes: 207141741 num_examples: 800 - name: validation num_bytes: 140651 num_bytes: 25735545 num_examples: 100 - name: test num_bytes: 109733 num_bytes: 41892235 num_examples: 100 download_size: 12710152 dataset_size: 1393535 download_size: 20138547 dataset_size: 274769521- config_name: scer features: - name: svg4 unmodified lines dtype: image - name: object_mask dtype: image - name: segments dtype: array3_d: shape: - 12 - 512 - 512 dtype: bool splits: - name: train num_bytes: 1115380 num_bytes: 206879581 num_examples: 800 - name: validation num_bytes: 137462 num_bytes: 26012748 num_examples: 100 - name: test num_bytes: 111133 num_bytes: 41895856 num_examples: 100 download_size: 12810408 dataset_size: 1363975 download_size: 20320118 dataset_size: 274788185---
# Dataset Card for BasicShapes100060 unmodified lines* `png` - a raster rendering of the svg with a white background* `object_mask` - a black/white mask that defines the outlines of the svg objects* `layer_mask` - a greyscale mask that defines layers of svg objects - overlap regions are brighter. Created by making all the objects white and semi-transparent* `segments` - a numpy array in the shape `(N,512,512), dtype='bool'` where N is the number of svg objects. The array is a mask of each object with `True` in the area of the object
### Data Splits
18 unmodified lines1920212223242521 unmodified lines47484949505152505152535455561 unmodified line585960606162636418 unmodified lines8384858687888994 unmodified lines18418518618718818919019119219319418 unmodified linesimport jsonimport osfrom math import floorimport numpy as np
import datasets
21 unmodified lines# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)_URLS = { "circles": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1000_v1/circles.tgz", "squares": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1000_v1/squares.tgz", "squares_and_circles": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1000_v1/squares_and_circles.tgz", "scer": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1000_v1/scer.tgz" "circles": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1k_v2/circles.tgz", "squares": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1k_v2/squares.tgz", "squares_and_circles": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1k_v2/squares_and_circles.tgz", "scer": "https://eezy-data-bucket.s3.amazonaws.com/public-datasets/basic_shapes_1k_v2/scer.tgz"}
1 unmodified lineclass BasicShapes1000(datasets.GeneratorBasedBuilder): """A dataset consisting of simple vector shapes and various kinds of masks"""
VERSION = datasets.Version("1.0.0") VERSION = datasets.Version("2.0.0")
SPLIT_COUNTS = { 'train': (0 , 800),18 unmodified lines "png": datasets.Image(), "layer_mask": datasets.Image(), "object_mask": datasets.Image(), "segments": datasets.features.Array3D((12, 512, 512), dtype='bool') } ) return datasets.DatasetInfo(94 unmodified lines object_mask_path = os.path.join(data_dir[domain], domain, 'obj_mask', str(idx).zfill(6) + '.png') with open(object_mask_path, 'rb') as file: data['object_mask'] = {"path": object_mask_path, "bytes": file.read()} segments_path = os.path.join(data_dir[domain], domain, 'segments', str(idx).zfill(6) + '.npy') data['segments'] = np.load(segments_path)
else: data['layer_mask'] = '' data['object_mask'] = '' data['segments'] = np.zeros((12, 512, 512), dtype='bool') return dataREADME.md+66-25
basic_shapes_1000.py+11-5