add masks to dataset and bump version
Browse filesFiles changed (2)
- README.md+66-25
- basic_shapes_1000.py+11-5
9 unmodified lines1011121314151617181920212223242526274 unmodified lines3233343536373839404142434445464748494 unmodified lines5455565758596061626364656667686970714 unmodified lines7677787980818283848586878889909192934 unmodified lines989910010110210310410510610710810911011111211311411560 unmodified lines1761771781791801819 unmodified linesdtype: image- name: object_maskdtype: imagesplits:- name: trainnum_bytes: 4500734num_examples: 3200- name: validationnum_bytes: 557191num_examples: 400- name: testnum_bytes: 438883num_examples: 400download_size: 50730876dataset_size: 5496808- config_name: circlesfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: imagesplits:- name: trainnum_bytes: 1105745num_examples: 800- name: validationnum_bytes: 139640num_examples: 100- name: testnum_bytes: 106180num_examples: 100download_size: 22076447dataset_size: 1351565- config_name: squaresfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: imagesplits:- name: trainnum_bytes: 1136458num_examples: 800- name: validationnum_bytes: 139444num_examples: 100- name: testnum_bytes: 111843num_examples: 100download_size: 3133869dataset_size: 1387745- config_name: squares_and_circlesfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: imagesplits:- name: trainnum_bytes: 1143151num_examples: 800- name: validationnum_bytes: 140651num_examples: 100- name: testnum_bytes: 109733num_examples: 100download_size: 12710152dataset_size: 1393535- config_name: scerfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: imagesplits:- name: trainnum_bytes: 1115380num_examples: 800- name: validationnum_bytes: 137462num_examples: 100- name: testnum_bytes: 111133num_examples: 100download_size: 12810408dataset_size: 1363975---# 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### Data Splits9 unmodified lines10111213141516171819202122232425262728293031323334354 unmodified lines40414243444546474849505152535455565758596061626364654 unmodified lines70717273747576777879808182838485868788899091929394954 unmodified lines1001011021031041051061071081091101111121131141151161171181191201211221231241254 unmodified lines13013113213313413513613713813914014114214314414514614714814915015115215315415560 unmodified lines2162172182192202212229 unmodified linesdtype: image- name: object_maskdtype: image- name: segmentsdtype:array3_d:shape:- 12- 512- 512dtype: boolsplits:- name: trainnum_bytes: 825420657num_examples: 3200- name: validationnum_bytes: 103491703num_examples: 400- name: testnum_bytes: 167570883num_examples: 400download_size: 79499715dataset_size: 1096483243- config_name: circlesfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: image- name: segmentsdtype:array3_d:shape:- 12- 512- 512dtype: boolsplits:- name: trainnum_bytes: 202172900num_examples: 800- name: validationnum_bytes: 25380696num_examples: 100- name: testnum_bytes: 41889893num_examples: 100download_size: 28664837dataset_size: 269443489- config_name: squaresfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: image- name: segmentsdtype:array3_d:shape:- 12- 512- 512dtype: boolsplits:- name: trainnum_bytes: 209226435num_examples: 800- name: validationnum_bytes: 26362720num_examples: 100- name: testnum_bytes: 41892905num_examples: 100download_size: 10376213dataset_size: 277482060- config_name: squares_and_circlesfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: image- name: segmentsdtype:array3_d:shape:- 12- 512- 512dtype: boolsplits:- name: trainnum_bytes: 207141741num_examples: 800- name: validationnum_bytes: 25735545num_examples: 100- name: testnum_bytes: 41892235num_examples: 100download_size: 20138547dataset_size: 274769521- config_name: scerfeatures:- name: svg4 unmodified linesdtype: image- name: object_maskdtype: image- name: segmentsdtype:array3_d:shape:- 12- 512- 512dtype: boolsplits:- name: trainnum_bytes: 206879581num_examples: 800- name: validationnum_bytes: 26012748num_examples: 100- name: testnum_bytes: 41895856num_examples: 100download_size: 20320118dataset_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 lines19202122232421 unmodified lines464748495051525354551 unmodified line5758596061626318 unmodified lines82838485868794 unmodified lines18218318418518618718818 unmodified linesimport jsonimport osfrom math import floorimport datasets21 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"}1 unmodified lineclass BasicShapes1000(datasets.GeneratorBasedBuilder):"""A dataset consisting of simple vector shapes and various kinds of masks"""VERSION = datasets.Version("1.0.0")SPLIT_COUNTS = {'train': (0 , 800),18 unmodified lines"png": datasets.Image(),"layer_mask": datasets.Image(),"object_mask": datasets.Image(),})return datasets.DatasetInfo(94 unmodified linesobject_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()}else:data['layer_mask'] = ''data['object_mask'] = ''return data18 unmodified lines1920212223242521 unmodified lines474849505152535455561 unmodified line5859606162636418 unmodified lines8384858687888994 unmodified lines18418518618718818919019119219319418 unmodified linesimport jsonimport osfrom math import floorimport numpy as npimport datasets21 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_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("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 linesobject_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 data
README.md+66-25
basic_shapes_1000.py+11-5