Open errorHandling opened 4 years ago
Hey there, have you tried https://github.com/matterport/Mask_RCNN/issues/372 ?
Yeah , Its not working.
Hey there, have you tried #372 ?
Well, we'll need some details on what you really did. There's a few things to modify for multi-classes training:
Well, we'll need some details on what you really did. There's a few things to modify for multi-classes training:
- Change the number of classes in the config.py (1 + nb classes)
- Add these classes in load_ in the custom dataset class
- Add the class ids whenever you're reading an image and its GT mask, to pass it to load_mask, so load_mask can pass it to your model
The whole code is below:
can you please help me in fixing the error
if name == 'main': import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os import sys import json import datetime import numpy as np import skimage.io from imgaug import augmenters as iaa
ROOT_DIR = os.path.abspath("/content/drive/My Drive/endoscopy-artefact-detection-ead-dataset/trainingData_semanticSegmentation.zip (Unzipped Files)/train/5data/")
sys.path.append(ROOT_DIR) # To find local version of the library from mrcnn.config import Config from mrcnn import utils from mrcnn import model as modellib from mrcnn import visualize
COCO_WEIGHTS_PATH = os.path.join(ROOT_DIR, "mask_rcnn_coco.h5")
DEFAULT_LOGS_DIR = os.path.join(ROOT_DIR, "logs")
RESULTS_DIR = os.path.join(ROOT_DIR, "results/ead/")
VAL_IMAGE_IDS = []
############################################################
############################################################
class EadConfig(Config): """Configuration for training on the segmentation dataset."""
NAME = "ead"
# Adjust depending on your GPU memory
IMAGES_PER_GPU = 6
# Number of classes (including background)
NUM_CLASSES = 1 + 5 # Background + nucleus
# Number of training and validation steps per epoch
STEPS_PER_EPOCH = (657 - len(VAL_IMAGE_IDS)) // IMAGES_PER_GPU
VALIDATION_STEPS = max(1, len(VAL_IMAGE_IDS) // IMAGES_PER_GPU)
# Don't exclude based on confidence. Since we have two classes
# then 0.5 is the minimum anyway as it picks between nucleus and BG
DETECTION_MIN_CONFIDENCE = 0
# Backbone network architecture
# Supported values are: resnet50, resnet101
BACKBONE = "resnet50"
# Input image resizing
# Random crops of size 512x512
IMAGE_RESIZE_MODE = "crop"
IMAGE_MIN_DIM = 512
IMAGE_MAX_DIM = 512
IMAGE_MIN_SCALE = 2.0
# Length of square anchor side in pixels
RPN_ANCHOR_SCALES = (8, 16, 32, 64, 128)
# ROIs kept after non-maximum supression (training and inference)
POST_NMS_ROIS_TRAINING = 1000
POST_NMS_ROIS_INFERENCE = 2000
# Non-max suppression threshold to filter RPN proposals.
# You can increase this during training to generate more propsals.
RPN_NMS_THRESHOLD = 0.9
# How many anchors per image to use for RPN training
RPN_TRAIN_ANCHORS_PER_IMAGE = 64
# Image mean (RGB)
MEAN_PIXEL = np.array([43.53, 39.56, 48.22])
# If enabled, resizes instance masks to a smaller size to reduce
# memory load. Recommended when using high-resolution images.
USE_MINI_MASK = True
MINI_MASK_SHAPE = (56, 56) # (height, width) of the mini-mask
# Number of ROIs per image to feed to classifier/mask heads
# The Mask RCNN paper uses 512 but often the RPN doesn't generate
# enough positive proposals to fill this and keep a positive:negative
# ratio of 1:3. You can increase the number of proposals by adjusting
# the RPN NMS threshold.
TRAIN_ROIS_PER_IMAGE = 128
# Maximum number of ground truth instances to use in one image
MAX_GT_INSTANCES = 200
# Max number of final detections per image
DETECTION_MAX_INSTANCES = 400
class EadInferenceConfig(EadConfig):
GPU_COUNT = 1
IMAGES_PER_GPU = 1
# Don't resize imager for inferencing
IMAGE_RESIZE_MODE = "pad64"
# Non-max suppression threshold to filter RPN proposals.
# You can increase this during training to generate more propsals.
RPN_NMS_THRESHOLD = 0.7
############################################################
############################################################
class EadDataset(utils.Dataset):
def load_ead(self, dataset_dir, subset):
"""Load a subset of the nuclei dataset.
dataset_dir: Root directory of the dataset
subset: Subset to load. Either the name of the sub-directory,
such as stage1_train, stage1_test, ...etc. or, one of:
* train: stage1_train excluding validation images
* val: validation images from VAL_IMAGE_IDS
"""
# Add classes. We have one class.
# Naming the dataset nucleus, and the class nucleus
self.add_class("ead",1, "Intrument")
self.add_class("ead",2,"Specularity")
self.add_class("ead",3,"Artefact")
self.add_class("ead",4,"Bubbles")
self.add_class("ead",5,"Saturation")
# Which subset?
# "val": use hard-coded list above
# "train": use data from stage1_train minus the hard-coded list above
# else: use the data from the specified sub-directory
assert subset in ["train", "val"]
subset_dir = "0_original_images" if subset in ["train", "val"] else subset
dataset_dir = os.path.join(dataset_dir, subset_dir)
if subset == "val":
image_ids = VAL_IMAGE_IDS
else:
# Get image ids from directory names
image_ids = next(os.walk(dataset_dir))[2]
image_ids = [sub[ : -4] for sub in image_ids]
print(image_ids)
if subset == "train":
image_ids = list(set(image_ids) - set(VAL_IMAGE_IDS))
# Add images
for image_id in image_ids:
self.add_image(
"ead",
image_id=image_id,
path=os.path.join(dataset_dir, "{}.jpg".format(image_id)),
class_ids=class_ids
)
def load_mask(self, image_id):
"""Generate instance masks for an image.
Returns:
masks: A bool array of shape [height, width, instance count] with
one mask per instance.
class_ids: a 1D array of class IDs of the instance masks.
"""
info = self.image_info[image_id]
# Get mask directory from image path
mask_dir = os.path.join(ROOT_DIR, "masks")
# Read mask files from .png image
mask = []
class_ids=[]
for f in next(os.walk(mask_dir))[2]:
if f.endswith(".tif"):
m = skimage.io.imread(os.path.join(mask_dir, f)).astype(np.bool)
mask.append(m)
mask = np.stack(mask, axis=-1)
# Return mask, and array of class IDs of each instance. Since we have
# one class ID, we return an array of ones
return mask, info['class_ids']
def image_reference(self, image_id):
"""Return the path of the image."""
info = self.image_info[image_id]
if info["source"] == "ead":
return info["id"]
else:
super(self.__class__, self).image_reference(image_id)
############################################################
############################################################
def train(model, dataset_dir, subset): """Train the model."""
dataset_train = EadDataset()
dataset_train.load_ead(dataset_dir, subset)
dataset_train.prepare()
# Validation dataset
dataset_val = EadDataset()
dataset_val.load_ead(dataset_dir, "val")
dataset_val.prepare()
# Image augmentation
# http://imgaug.readthedocs.io/en/latest/source/augmenters.html
augmentation = iaa.SomeOf((0, 2), [
iaa.Fliplr(0.5),
iaa.Flipud(0.5),
iaa.OneOf([iaa.Affine(rotate=90),
iaa.Affine(rotate=180),
iaa.Affine(rotate=270)]),
iaa.Multiply((0.8, 1.5)),
iaa.GaussianBlur(sigma=(0.0, 5.0))
])
# *** This training schedule is an example. Update to your needs ***
# If starting from imagenet, train heads only for a bit
# since they have random weights
print("Train network heads")
model.train(dataset_train, dataset_val,
learning_rate=config.LEARNING_RATE,
epochs=20,
augmentation=augmentation,
layers='heads')
print("Train all layers")
model.train(dataset_train, dataset_val,
learning_rate=config.LEARNING_RATE,
epochs=40,
augmentation=augmentation,
layers='all')
############################################################
############################################################
def rle_encode(mask): """Encodes a mask in Run Length Encoding (RLE). Returns a string of space-separated values. """ assert mask.ndim == 2, "Mask must be of shape [Height, Width]"
m = mask.T.flatten()
# Compute gradient. Equals 1 or -1 at transition points
g = np.diff(np.concatenate([[0], m, [0]]), n=1)
# 1-based indicies of transition points (where gradient != 0)
rle = np.where(g != 0)[0].reshape([-1, 2]) + 1
# Convert second index in each pair to lenth
rle[:, 1] = rle[:, 1] - rle[:, 0]
return " ".join(map(str, rle.flatten()))
def rle_decode(rle, shape): """Decodes an RLE encoded list of space separated numbers and returns a binary mask.""" rle = list(map(int, rle.split())) rle = np.array(rle, dtype=np.int32).reshape([-1, 2]) rle[:, 1] += rle[:, 0] rle -= 1 mask = np.zeros([shape[0] * shape[1]], np.bool) for s, e in rle: assert 0 <= s < mask.shape[0] assert 1 <= e <= mask.shape[0], "shape: {} s {} e {}".format(shape, s, e) mask[s:e] = 1
mask = mask.reshape([shape[1], shape[0]]).T
return mask
def mask_to_rle(image_id, mask, scores): "Encodes instance masks to submission format." assert mask.ndim == 3, "Mask must be [H, W, count]"
if mask.shape[-1] == 0:
return "{},".format(image_id)
# Remove mask overlaps
# Multiply each instance mask by its score order
# then take the maximum across the last dimension
order = np.argsort(scores)[::-1] + 1 # 1-based descending
mask = np.max(mask * np.reshape(order, [1, 1, -1]), -1)
# Loop over instance masks
lines = []
for o in order:
m = np.where(mask == o, 1, 0)
# Skip if empty
if m.sum() == 0.0:
continue
rle = rle_encode(m)
lines.append("{}, {}".format(image_id, rle))
return "\n".join(lines)
############################################################
############################################################
def detect(model, dataset_dir, subset): """Run detection on images in the given directory.""" print("Running on {}".format(dataset_dir))
# Create directory
if not os.path.exists(RESULTS_DIR):
os.makedirs(RESULTS_DIR)
submit_dir = "submit_{:%Y%m%dT%H%M%S}".format(datetime.datetime.now())
submit_dir = os.path.join(RESULTS_DIR, submit_dir)
os.makedirs(submit_dir)
# Read dataset
dataset = EadDataset()
dataset.load_ead(dataset_dir, subset)
dataset.prepare()
# Load over images
submission = []
for image_id in dataset.image_ids:
# Load image and run detection
image = dataset.load_image(image_id)
# Detect objects
r = model.detect([image], verbose=0)[0]
# Encode image to RLE. Returns a string of multiple lines
source_id = dataset.image_info[image_id]["id"]
rle = mask_to_rle(source_id, r["masks"], r["scores"])
submission.append(rle)
# Save image with masks
visualize.display_instances(
image, r['rois'], r['masks'], r['class_ids'],
dataset.class_names, r['scores'],
show_bbox=False, show_mask=False,
title="Predictions")
plt.savefig("{}/{}.png".format(submit_dir, dataset.image_info[image_id]["id"]))
# Save to csv file
submission = "ImageId,EncodedPixels\n" + "\n".join(submission)
file_path = os.path.join(submit_dir, "submit.csv")
with open(file_path, "w") as f:
f.write(submission)
print("Saved to ", submit_dir)
############################################################
############################################################
if name == 'main': import argparse
# Parse command line arguments
parser = argparse.ArgumentParser(
description='Mask R-CNN for ead detection and segmentation')
parser.add_argument("command",
metavar="<command>",
help="'train' or 'detect'")
parser.add_argument('--dataset', required=False,
metavar="/path/to/dataset/",
help='Root directory of the dataset')
parser.add_argument('--weights', required=True,
metavar="/path/to/weights.h5",
help="Path to weights .h5 file or 'coco'")
parser.add_argument('--logs', required=False,
default=DEFAULT_LOGS_DIR,
metavar="/path/to/logs/",
help='Logs and checkpoints directory (default=logs/)')
parser.add_argument('--subset', required=False,
metavar="Dataset sub-directory",
help="Subset of dataset to run prediction on")
args = parser.parse_args()
# Validate arguments
if args.command == "train":
assert args.dataset, "Argument --dataset is required for training"
elif args.command == "detect":
assert args.subset, "Provide --subset to run prediction on"
print("Weights: ", args.weights)
print("Dataset: ", args.dataset)
if args.subset:
print("Subset: ", args.subset)
print("Logs: ", args.logs)
# Configurations
if args.command == "train":
config = EadConfig()
else:
config = EadInferenceConfig()
config.display()
# Create model
if args.command == "train":
model = modellib.MaskRCNN(mode="training", config=config,
model_dir=args.logs)
else:
model = modellib.MaskRCNN(mode="inference", config=config,
model_dir=args.logs)
# Select weights file to load
if args.weights.lower() == "coco":
weights_path = COCO_WEIGHTS_PATH
# Download weights file
if not os.path.exists(weights_path):
utils.download_trained_weights(weights_path)
elif args.weights.lower() == "last":
# Find last trained weights
weights_path = model.find_last()
elif args.weights.lower() == "imagenet":
# Start from ImageNet trained weights
weights_path = model.get_imagenet_weights()
else:
weights_path = args.weights
# Load weights
print("Loading weights ", weights_path)
if args.weights.lower() == "coco":
# Exclude the last layers because they require a matching
# number of classes
model.load_weights(weights_path, by_name=True, exclude=[
"mrcnn_class_logits", "mrcnn_bbox_fc",
"mrcnn_bbox", "mrcnn_mask"])
else:
model.load_weights(weights_path, by_name=True)
# Train or evaluate
if args.command == "train":
train(model, args.dataset, args.subset)
elif args.command == "detect":
detect(model, args.dataset, args.subset)
else:
print("'{}' is not recognized. "
"Use 'train' or 'detect'".format(args.command))
def load_ead(self, dataset_dir, subset): """Load a subset of the nuclei dataset. dataset_dir: Root directory of the dataset subset: Subset to load. Either the name of the sub-directory, such as stage1_train, stage1_test, ...etc. or, one of:
val: validation images from VAL_IMAGE_IDS """
self.add_class("ead",1, "Intrument") self.add_class("ead",2,"Specularity") self.add_class("ead",3,"Artefact") self.add_class("ead",4,"Bubbles") self.add_class("ead",5,"Saturation")
assert subset in ["train", "val"] subset_dir = "0_original_images" if subset in ["train", "val"] else subset dataset_dir = os.path.join(dataset_dir, subset_dir) if subset == "val": image_ids = VAL_IMAGE_IDS else:
image_ids = next(os.walk(dataset_dir))[2]
image_ids = [sub[ : -4] for sub in image_ids]
print(image_ids)
if subset == "train":
image_ids = list(set(image_ids) - set(VAL_IMAGE_IDS))
for image_id in image_ids: self.add_image( "ead", image_id=image_id, path=os.path.join(dataset_dir, "{}.jpg".format(image_id)), class_ids=class_ids )
In this function, you should declare an empty list class_ids ---> class_ids = [ ]. And then append the corresponding class of each instance in the current image.
I don't really know how your dataset is settle so I don't really know how you're actually reading labeled imaged. But basically what this function should do is:
For example: IMG_1.jpg contains 3 nucleus: "Intrument", "Specularity", "Intrument" While making up your mask, you will load those nucleus mask in that exact order. So your class_ids should be: class_ids = [1,2,1].
What I would do in your case is: class_ids = [] for nucleus in current_img: if nucleus == "Intrument": class_ids.append(1) elif nucleus == "Specularity": class_ids.append(2) elif nucleus == "Artefact": class_ids.append(3) elif nucleus == "Bubbles": class_ids.append(4) elif nucleus == "Saturation": class_ids.append(5)
Hope it helps....
I have annotation file like this- _via_img_metadata":{ "00188.jpg123393":{"filename":"00188.jpg","size":123393, "regions":[{ "shape_attributes":{ "name":"polygon", "all_points_x":[1177,1167,1178,1184,1183,1177], "all_points_y":[334,345,353,343,337,336]}, "region_attributes":{ "EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}}, {"shape_attributes":{"name":"polygon", "all_points_x":[1229,1224,1232,1240,1241,1235,1229], "all_points_y":[273,282,283,285,277,273,273]}, "region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}}, {"shape_attributes":{ "name":"polygon", "all_points_x":[1170,1169,1177,1181,1177,1169], "all_points_y":[564,574,579,573,568,564]}, "region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}}, {"shape_attributes":{"name":"polygon","all_points_x":[1101,1098,1104,1113,1112,1104],"all_points_y":[437,450,454,450,442,437]}, "region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[1167,1158,1167,1177,1170],"all_points_y":[427,436,442,437,427]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[922,916,922,930,927,924],"all_points_y":[451,460,471,464,456,453]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[1027,1024,1039,1039,1035],"all_points_y":[423,436,436,430,427]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[1095,1081,1087,1096,1100,1096],"all_points_y":[354,357,367,363,354,354]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[1167,1155,1161,1173,1170],"all_points_y":[291,294,303,302,293]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[627,627,644,644,630],"all_points_y":[197,214,208,200,196]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[962,973,978,978,969,966],"all_points_y":[249,243,248,257,259,256]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[990,986,987,995,999,998],"all_points_y":[112,119,126,126,122,117]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[990,982,986,999,996],"all_points_y":[142,148,156,152,145]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[942,933,936,947,950,947],"all_points_y":[243,246,254,251,245,243]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[548,541,537,541,551,556,553,550],"all_points_y":[65,72,77,86,79,71,65,63]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},{"shape_attributes":{"name":"polygon","all_points_x":[926,913,918,927,932],"all_points_y":[26,31,37,37,34]},"region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}}},
From here, I have to read "region_attributes " and append in class_ids with the number for which attrebute is true . for example for this region_attributes":{"EAD-Challenge2019":{"Instrument":false,"Specularity":true,"Artefact":false,"Bubbles":false,"Saturation":false}
class_ids should append with 2
How can i do this ?
Oh so you have a json file afterwards ! Just follow the balloon one :/. I'm not good at json either haha. But you should look for it. Try out:
annotations = json.load(open(os.path.join(dataset_dir, "Labels.json")))
annotations = [a for a in annotations if a['regions']]
for a in annotations:
polygons = [r['shape_attributes'] for r in a['regions']]
objects = [s['region_attributes'] for s in a['regions']]
class_ids_string = [o['EAD-Challenge2019'] for o in objects]
class_ids = []
for c in class_ids_string:
if c['Intrusment'] == True:
class_ids.append(1)
elif c['Specularity'] == True:
class_ids.append(2)
elif c['Artefact'] == True:
class_ids.append(3)
elif c['Bubbles'] == True:
class_ids.append(4)
class_ids = np.array(class_ids, dtype=np.int32)
after running this code i m getting this error :
Traceback (most recent call last):
File "ead.py", line 391, in
Do you know if the json file from VIA-GG has been exported to json or just saved the project into a json ? Anyway, try to add: annotations = json.load(open(os.path.join(dataset_dir, "Labels.json"))) annotations = list(annotations['_via_img_metadata'].values())
Thanks for your Help. JSON related problem is solved. but now when i am running my code i am getting following error -
Epoch 1/30
Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1265, in load_image_gt class_ids = class_ids[_idx] IndexError: boolean index did not match indexed array along dimension 0; dimension is 2426 but corresponding boolean dimension is 127 multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 641, in next_sample return six.next(_SHARED_SEQUENCES[uid]) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1265, in load_image_gt class_ids = class_ids[_idx] IndexError: boolean index did not match indexed array along dimension 0; dimension is 2426 but corresponding boolean dimension is 127 """
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "ead.py", line 433, in train(model, args.dataset, args.subset) File "ead.py", line 237, in train layers='heads') File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 2374, in train File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(*args, kwargs) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1658, in fit_generator initial_epoch=initial_epoch) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training_generator.py", line 181, in fit_generator generator_output = next(output_generator) File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 733, in get six.reraise(sys.exc_info()) File "/usr/local/lib/python3.6/dist-packages/six.py", line 693, in reraise raise value File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 702, in get inputs = future.get(timeout=30) File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(args, kwds)) File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 641, in next_sample return six.next(_SHARED_SEQUENCES[uid]) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1265, in load_image_gt IndexError: boolean index did not match indexed array along dimension 0; dimension is 2426 but corresponding boolean dimension is 127
Not familiar with all this are you ? As it's said, the indexes with the class ids and the masks don't match. But our class ids shall be good from now on, so let's take a look for the masks. The only thing you do is loading and appending only 1 mask for each image, whereas our class ids can contains several objects. Let's take my previous example:
IMG_1.jpg contains 3 nucleus: "Intrument", "Specularity", "Intrument" While making up your mask, you will load those nucleus mask in that exact order. So your class_ids should be: class_ids = [1,2,1].
So the image contains 3 nucleus, we succeed to generate our class ids like [1,2,1]. Now in load_mask, you should generate an array of mask of size (N, WIDTH, HEIGHT) where N is the number of nucleus is this image. Because each nucleus shall have its own mask. That is why I said it should be loaded in the exact same order as the class ids, so the indexes can match. Then we can know which mask is assigned to which nucleus. Basically, imaging I am to process the Specularity nucleus, then I know that I have to look up for "2" in my class id, which is at index 1, so I can get its mask by calling mask[1].
The thing I dont understand is, you have a json file with the location of each nucleus, but you also have their mask images apart ? If this is the case, we are mixing 2 different methods... You rather have to choose to do it with JSON or by loading mask images ... But let's not mix both. (well this is possible but nonsense)
Actually initially I did not understand how will i find class ids as i have multiple classes , in case of mask images.
So ,now I am not using masks images. Currently , I am using json file and original images to train my dataset.
Good morning !
Alrigth, it will be easier then, you can rely on the load_mask function from Balloon, which is generating mask by reading the json. There you can see he is appending all the mask of the image in one big array:
for i, p in enumerate(info["polygons"]):
# Get indexes of pixels inside the polygon and set them to 1
rr, cc = skimage.draw.polygon(p['all_points_y'], p['all_points_x'])
mask[rr, cc, i] = 1
my load_mask code is :
def load_mask(self, image_id): """Generate instance masks for an image. Returns: masks: A bool array of shape [height, width, instance count] with one mask per instance. class_ids: a 1D array of class IDs of the instance masks. """
image_info = self.image_info[image_id]
if image_info["source"] != "ead":
return super(self.__class__, self).load_mask(image_id)
# Convert polygons to a bitmap mask of shape
# [height, width, instance_count]
info = self.image_info[image_id]
#print(info)
#print("height weight len ==",info["height"], info["width"], len(info["polygons"]['shape_attributes']))
mask = np.zeros([info["height"], info["width"], len(info["polygons"])],
dtype=np.uint8)
for i, p in enumerate(info["polygons"]):
# Get indexes of pixels inside the polygon and set them to 1
#print(p)
for k,l in enumerate(p['shape_attributes']['all_points_y']):
if(l>720):
p['shape_attributes']['all_points_y'][k]=719
rr, cc = skimage.draw.polygon(p['shape_attributes']['all_points_y'], p['shape_attributes']['all_points_x'])
#print("mask.shape, min(mask),max(mask): {}, {},{}".format(mask.shape, np.min(mask),np.max(mask)))
#print("rr.shape, min(rr),max(rr): {}, {},{}".format(rr.shape, np.min(rr),np.max(rr)))
#print("cc.shape, min(cc),max(cc): {}, {},{}".format(cc.shape, np.min(cc),np.max(cc)))
## Note that this modifies the existing array arr, instead of creating a result array
## Ref: https://stackoverflow.com/questions/19666626/replace-all-elements-of-python-numpy-array-that-are-greater-than-some-value
rr[rr > mask.shape[0]-1] = mask.shape[0]-1
cc[cc > mask.shape[1]-1] = mask.shape[1]-1
#print("After fixing the dirt mask, new values:")
#print("rr.shape, min(rr),max(rr): {}, {},{}".format(rr.shape, np.min(rr),np.max(rr)))
#print("cc.shape, min(cc),max(cc): {}, {},{}".format(cc.shape, np.min(cc),np.max(cc)))
mask[rr, cc, i] = 1
#mask[rr, cc, i] = 1
# Return mask, and array of class IDs of each instance. Since we have
# one class ID only, we return an array of 1s
return mask.astype(np.bool), info["class_ids"]
but when i am training my dataset i am gettig following error -
Using TensorFlow backend. Weights: imagenet Dataset: /content/drive/My Drive/endoscopy-artefact-detection-ead-dataset/trainingData_semanticSegmentation.zip (Unzipped Files)/ Subset: train Logs: /content/drive/My Drive/endoscopy-artefact-detection-ead-dataset/trainingData_semanticSegmentation.zip (Unzipped Files)/logs
Configurations: BACKBONE resnet101 BACKBONE_STRIDES [4, 8, 16, 32, 64] BATCH_SIZE 2 BBOX_STD_DEV [0.1 0.1 0.2 0.2] COMPUTE_BACKBONE_SHAPE None DETECTION_MAX_INSTANCES 100 DETECTION_MIN_CONFIDENCE 0.9 DETECTION_NMS_THRESHOLD 0.3 FPN_CLASSIF_FC_LAYERS_SIZE 1024 GPU_COUNT 1 GRADIENT_CLIP_NORM 5.0 IMAGES_PER_GPU 2 IMAGE_CHANNEL_COUNT 3 IMAGE_MAX_DIM 1024 IMAGE_META_SIZE 18 IMAGE_MIN_DIM 800 IMAGE_MIN_SCALE 0 IMAGE_RESIZE_MODE square IMAGE_SHAPE [1024 1024 3] LEARNING_MOMENTUM 0.9 LEARNING_RATE 0.001 LOSS_WEIGHTS {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0} MASK_POOL_SIZE 14 MASK_SHAPE [28, 28] MAX_GT_INSTANCES 100 MEAN_PIXEL [123.7 116.8 103.9] MINI_MASK_SHAPE (56, 56) NAME ead NUM_CLASSES 6 POOL_SIZE 7 POST_NMS_ROIS_INFERENCE 1000 POST_NMS_ROIS_TRAINING 2000 PRE_NMS_LIMIT 6000 ROI_POSITIVE_RATIO 0.33 RPN_ANCHOR_RATIOS [0.5, 1, 2] RPN_ANCHOR_SCALES (32, 64, 128, 256, 512) RPN_ANCHOR_STRIDE 1 RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2] RPN_NMS_THRESHOLD 0.7 RPN_TRAIN_ANCHORS_PER_IMAGE 256 STEPS_PER_EPOCH 100 TOP_DOWN_PYRAMID_SIZE 256 TRAIN_BN False TRAIN_ROIS_PER_IMAGE 200 USE_MINI_MASK True USE_RPN_ROIS True VALIDATION_STEPS 50 WEIGHT_DECAY 0.0001
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:2139: The name tf.nn.fused_batch_norm is deprecated. Please use tf.compat.v1.nn.fused_batch_norm instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4267: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:2239: The name tf.image.resize_nearest_neighbor is deprecated. Please use tf.compat.v1.image.resize_nearest_neighbor instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/array_ops.py:1475: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py:553: The name tf.random_shuffle is deprecated. Please use tf.random.shuffle instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/utils.py:202: The name tf.log is deprecated. Please use tf.math.log instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py:600: calling crop_and_resize_v1 (from tensorflow.python.ops.image_ops_impl) with box_ind is deprecated and will be removed in a future version. Instructions for updating: box_ind is deprecated, use box_indices instead Loading weights /root/.keras/models/resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5 WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:190: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:197: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:203: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
2020-02-27 10:08:25.087204: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz 2020-02-27 10:08:25.090050: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0xfb2ba40 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-02-27 10:08:25.090090: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2020-02-27 10:08:25.112411: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1 2020-02-27 10:08:25.309760: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-02-27 10:08:25.310437: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0xfb2bc00 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: 2020-02-27 10:08:25.310465: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Tesla T4, Compute Capability 7.5 2020-02-27 10:08:25.310712: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-02-27 10:08:25.311340: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: name: Tesla T4 major: 7 minor: 5 memoryClockRate(GHz): 1.59 pciBusID: 0000:00:04.0 2020-02-27 10:08:25.316125: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2020-02-27 10:08:25.333069: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10 2020-02-27 10:08:25.431155: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10 2020-02-27 10:08:25.438533: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10 2020-02-27 10:08:25.474952: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10 2020-02-27 10:08:25.482529: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10 2020-02-27 10:08:25.580649: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2020-02-27 10:08:25.580854: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-02-27 10:08:25.581674: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-02-27 10:08:25.582250: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0 2020-02-27 10:08:25.586261: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2020-02-27 10:08:25.588665: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-02-27 10:08:25.588706: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0 2020-02-27 10:08:25.588728: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N 2020-02-27 10:08:25.591452: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-02-27 10:08:25.592144: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-02-27 10:08:25.592763: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0. 2020-02-27 10:08:25.592823: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 14221 MB memory) -> physical GPU (device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5) WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:207: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:216: The name tf.is_variable_initialized is deprecated. Please use tf.compat.v1.is_variable_initialized instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:223: The name tf.variables_initializer is deprecated. Please use tf.compat.v1.variables_initializer instead.
attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present attribute not present Training network heads
Starting at epoch 0. LR=0.001
Checkpoint Path: /content/drive/My Drive/endoscopy-artefact-detection-ead-dataset/trainingData_semanticSegmentation.zip (Unzipped Files)/logs/ead20200227T1008/mask_rcnnead{epoch:04d}.h5 Selecting layers to train fpn_c5p5 (Conv2D) fpn_c4p4 (Conv2D) fpn_c3p3 (Conv2D) fpn_c2p2 (Conv2D) fpn_p5 (Conv2D) fpn_p2 (Conv2D) fpn_p3 (Conv2D) fpn_p4 (Conv2D) In model: rpn_model rpn_conv_shared (Conv2D) rpn_class_raw (Conv2D) rpn_bbox_pred (Conv2D) mrcnn_mask_conv1 (TimeDistributed) mrcnn_mask_bn1 (TimeDistributed) mrcnn_mask_conv2 (TimeDistributed) mrcnn_mask_bn2 (TimeDistributed) mrcnn_class_conv1 (TimeDistributed) mrcnn_class_bn1 (TimeDistributed) mrcnn_mask_conv3 (TimeDistributed) mrcnn_mask_bn3 (TimeDistributed) mrcnn_class_conv2 (TimeDistributed) mrcnn_class_bn2 (TimeDistributed) mrcnn_mask_conv4 (TimeDistributed) mrcnn_mask_bn4 (TimeDistributed) mrcnn_bbox_fc (TimeDistributed) mrcnn_mask_deconv (TimeDistributed) mrcnn_class_logits (TimeDistributed) mrcnn_mask (TimeDistributed) WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/optimizers.py:793: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:424: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:424: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:424: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:1033: The name tf.assign_add is deprecated. Please use tf.compat.v1.assign_add instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:1020: The name tf.assign is deprecated. Please use tf.compat.v1.assign instead.
/usr/local/lib/python3.6/dist-packages/keras/engine/training_generator.py:49: UserWarning: Using a generator with use_multiprocessing=True
and multiple workers may duplicate your data. Please consider using the keras.utils.Sequence class. UserWarning('Using a generator with
use_multiprocessing=True`'
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/callbacks.py:1122: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/callbacks.py:1125: The name tf.summary.FileWriter is deprecated. Please use tf.compat.v1.summary.FileWriter instead.
Epoch 1/30 ERROR:root:Error processing image {'id': '00191_batch2.jpg', 'source': 'ead', 'path': '/content/drive/My Drive/endoscopy-artefact-detection-ead-dataset/trainingData_semanticSegmentation.zip (Unzipped Files)/train/trainingData_semanticSegmentation/original_images/00191_batch2.jpg', 'width': 1244, 'height': 1079, 'polygons': [{'shape_attributes': {'name': 'polygon', 'all_points_x': [1177, 1167, 1178, 1184, 1183, 1177], 'all_points_y': [334, 345, 353, 343, 337, 336]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1229, 1224, 1232, 1240, 1241, 1235, 1229], 'all_points_y': [273, 282, 283, 285, 277, 273, 273]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1170, 1169, 1177, 1181, 1177, 1169], 'all_points_y': [564, 574, 579, 573, 568, 564]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1101, 1098, 1104, 1113, 1112, 1104], 'all_points_y': [437, 450, 454, 450, 442, 437]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1167, 1158, 1167, 1177, 1170], 'all_points_y': [427, 436, 442, 437, 427]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [922, 916, 922, 930, 927, 924], 'all_points_y': [451, 460, 471, 464, 456, 453]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1027, 1024, 1039, 1039, 1035], 'all_points_y': [423, 436, 436, 430, 427]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1095, 1081, 1087, 1096, 1100, 1096], 'all_points_y': [354, 357, 367, 363, 354, 354]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1167, 1155, 1161, 1173, 1170], 'all_points_y': [291, 294, 303, 302, 293]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [627, 627, 644, 644, 630], 'all_points_y': [197, 214, 208, 200, 196]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [962, 973, 978, 978, 969, 966], 'all_points_y': [249, 243, 248, 257, 259, 256]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [990, 986, 987, 995, 999, 998], 'all_points_y': [112, 119, 126, 126, 122, 117]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [990, 982, 986, 999, 996], 'all_points_y': [142, 148, 156, 152, 145]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [942, 933, 936, 947, 950, 947], 'all_points_y': [243, 246, 254, 251, 245, 243]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [548, 541, 537, 541, 551, 556, 553, 550], 'all_points_y': [65, 72, 77, 86, 79, 71, 65, 63]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [926, 913, 918, 927, 932], 'all_points_y': [26, 31, 37, 37, 34]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [516, 513, 519, 527, 531, 530, 530], 'all_points_y': [5, 20, 20, 22, 6, 2, 3]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [562, 554, 559, 571, 579, 579], 'all_points_y': [91, 102, 109, 119, 108, 102]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [596, 607, 610, 602], 'all_points_y': [37, 26, 38, 42]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [579, 576, 587, 596, 591, 577], 'all_points_y': [219, 226, 226, 226, 219, 217]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [484, 493, 507, 499, 485], 'all_points_y': [257, 266, 268, 254, 254]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [545, 557, 565, 559, 548, 551], 'all_points_y': [317, 316, 320, 326, 326, 326]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [882, 876, 879, 887, 887], 'all_points_y': [37, 42, 48, 48, 38]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [699, 701, 687, 690, 705, 718, 710, 704, 699], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [614, 611, 616, 624, 627, 624], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [932, 930, 938, 939, 936, 930, 933], 'all_points_y': [383, 393, 393, 387, 382, 385, 387]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [827, 819, 832, 836, 832, 832], 'all_points_y': [23, 32, 38, 31, 22, 23]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [938, 926, 930, 941, 946, 946], 'all_points_y': [38, 40, 51, 51, 45, 46]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [420, 410, 422, 448, 445], 'all_points_y': [248, 260, 269, 266, 251]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [183, 115, 2, 0, 28, 46, 79, 105, 122, 123, 151, 182, 171, 200, 206, 209, 192, 216, 245, 257, 280, 276, 282, 269, 256, 236, 223, 225, 242, 248, 246, 236, 222, 226, 229, 219, 226, 219, 226, 231, 246, 240, 240, 246, 256, 259, 268, 277, 276, 256, 265, 280, 286, 280, 296, 308, 313, 296, 291, 283, 269, 257, 240, 240, 214, 200, 185, 168, 160, 149, 132, 115, 114, 115, 128, 145, 165, 180, 196, 185], 'all_points_y': [0, 83, 220, 442, 487, 502, 505, 482, 473, 493, 494, 476, 437, 444, 460, 494, 511, 528, 534, 525, 531, 517, 507, 493, 491, 493, 480, 460, 467, 456, 422, 413, 410, 399, 391, 377, 363, 346, 339, 323, 330, 348, 362, 374, 393, 416, 420, 419, 439, 460, 479, 484, 468, 454, 460, 436, 417, 387, 337, 300, 283, 271, 268, 279, 280, 293, 308, 322, 348, 353, 330, 308, 286, 253, 226, 162, 92, 29, 3, 0]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [410, 402, 405, 423, 434, 427, 402, 396, 370, 356, 342, 346, 363, 362, 390, 405, 419, 431, 439, 436, 442, 457, 465, 467, 471, 488, 510, 490, 459, 425], 'all_points_y': [480, 491, 507, 511, 536, 547, 553, 576, 579, 601, 622, 654, 667, 687, 696, 685, 702, 698, 681, 658, 645, 630, 624, 601, 588, 582, 574, 537, 508, 487]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [487, 476, 476, 488, 494, 493], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [393, 383, 390, 403, 410, 397], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [333, 316, 323, 311, 273, 276, 299, 317, 323, 345, 348, 363, 354, 334, 306, 320, 350, 365, 345, 356, 345, 351, 374, 394, 397, 397, 410, 420, 428, 430, 428, 439, 457, 459, 447, 442, 430, 422, 408, 430, 397, 391, 377, 367, 334], 'all_points_y': [708, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 715, 708]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [211, 231, 251, 262, 265, 237, 216, 199, 176, 169, 179, 194, 211, 219, 222, 213], 'all_points_y': [633, 630, 627, 634, 645, 656, 661, 673, 673, 665, 659, 656, 656, 651, 642, 634]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [95, 83, 89, 103, 115, 122, 111, 100, 92], 'all_points_y': [648, 658, 664, 664, 658, 654, 647, 644, 645]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [339, 330, 314, 305, 296, 294, 305, 316, 325, 333, 339, 350, 340], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [739, 748, 764, 781, 784, 741], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [634, 624, 633, 645, 638], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [68, 71, 69, 89, 94, 94, 88], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [177, 194, 209, 211, 197, 185, 177], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [290, 277, 294, 308, 305], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [208, 188, 194, 211, 222, 228, 245, 239, 239, 229, 214], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [361, 342, 327, 314, 295, 263, 158, 186, 449, 450, 443, 437, 429, 416, 408, 396, 392], 'all_points_y': [693, 702, 716, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 716, 713]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': True, 'Specularity': False, 'Artefact': False, 'Bubbles': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1241, 1190, 1146, 1142, 1119, 1108, 1081, 1065, 1048, 1035, 1018, 964, 953, 929, 924, 1061, 1200, 1241, 1243], 'all_points_y': [714, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [942, 917, 909, 924, 936, 943, 942], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [302, 282, 269, 264, 267, 280, 279, 279], 'all_points_y': [276, 284, 302, 326, 339, 336, 334, 335]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [389, 384, 390, 399, 409, 411, 408, 397, 395, 394], 'all_points_y': [143, 158, 181, 194, 197, 184, 173, 148, 140, 141]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [871, 905, 922, 912, 890, 879, 883, 882], 'all_points_y': [459, 446, 446, 459, 469, 473, 474, 473]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [37, 21, 24, 51, 62, 47, 44], 'all_points_y': [206, 204, 226, 217, 207, 202, 204]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [20, 37, 48, 48, 36, 26, 18, 20], 'all_points_y': [173, 166, 156, 172, 179, 187, 183, 185]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [660, 629, 594, 567, 564, 533, 506, 480, 454, 419, 352, 325, 301, 260, 229, 244, 278, 312, 324, 320, 328, 314, 324, 347, 386, 606, 616, 599, 602, 588, 591, 625, 648, 676, 700, 714, 706, 702, 694, 679, 677], 'all_points_y': [476, 479, 518, 572, 598, 640, 672, 694, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 714, 656, 622, 615, 558, 535, 510, 493, 483, 480, 480]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': True, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1, 3, 26, 57, 92, 111, 132, 172, 200, 190, 165, 145, 105, 60], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [253, 233, 223, 220, 230, 246, 268, 285, 321, 347, 371, 358, 349, 331, 310, 284, 274], 'all_points_y': [328, 335, 364, 402, 440, 476, 483, 517, 551, 550, 531, 481, 453, 415, 383, 356, 352]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [3, 3, 60, 186, 186, 308, 329, 320, 305, 287, 260, 224, 199, 192, 200, 196, 131, 102, 91], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1208, 1200, 1210, 1218, 1217, 1218], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [900, 916, 934, 939, 936, 919, 907, 900, 899], 'all_points_y': [476, 464, 459, 459, 467, 477, 484, 480, 476]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [476, 425, 392, 361, 324, 262, 204, 177, 552, 555, 554, 554, 545, 545, 555, 572, 575, 552, 538, 516, 473, 469], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': True}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [923, 918, 926, 940, 962, 971, 983, 978, 959, 954, 933, 923], 'all_points_y': [523, 549, 580, 597, 590, 569, 559, 536, 524, 536, 519, 523]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [827, 831, 851, 831, 823], 'all_points_y': [589, 604, 593, 579, 584]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [460, 460, 492, 498, 512, 494, 481, 473, 460], 'all_points_y': [399, 430, 425, 413, 396, 395, 410, 393, 402]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [66, 29, 46, 95, 152, 190, 209, 142, 123, 121], 'all_points_y': [273, 291, 358, 478, 480, 424, 392, 310, 282, 286]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [75, 67, 99, 126, 121, 105, 95], 'all_points_y': [552, 589, 615, 614, 575, 551, 554]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [810, 795, 790, 807, 812], 'all_points_y': [525, 531, 544, 542, 527]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [819, 812, 818, 827, 827, 821], 'all_points_y': [556, 567, 570, 565, 554, 556]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [782, 795, 804, 815, 805, 788, 787], 'all_points_y': [576, 564, 568, 579, 590, 596, 590]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [775, 781, 785, 770, 750, 735, 727, 727, 751, 759], 'all_points_y': [599, 607, 616, 624, 625, 621, 610, 598, 590, 585]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [798, 790, 792, 776, 775, 782, 802, 819, 822, 818], 'all_points_y': [368, 373, 382, 397, 405, 416, 408, 399, 382, 380]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [633, 647, 647, 659, 673, 685, 676, 658, 647], 'all_points_y': [571, 571, 565, 564, 554, 544, 537, 548, 553]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [722, 724, 722, 735, 741, 748, 741], 'all_points_y': [556, 568, 584, 581, 574, 559, 556]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [695, 688, 690, 699, 704], 'all_points_y': [537, 544, 551, 551, 542]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [687, 682, 688, 698, 690], 'all_points_y': [564, 574, 579, 574, 564]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [684, 679, 676, 681, 685, 693, 702, 704, 702], 'all_points_y': [122, 129, 142, 148, 156, 166, 159, 143, 140]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [738, 730, 730, 739, 744, 744], 'all_points_y': [103, 115, 120, 122, 112, 114]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [584, 573, 579, 596, 613, 607], 'all_points_y': [223, 236, 245, 243, 237, 233]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [627, 616, 625, 631, 638], 'all_points_y': [239, 248, 256, 249, 245]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [716, 705, 708, 721, 725, 722], 'all_points_y': [334, 342, 348, 348, 343, 333]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [186, 182, 169, 169, 183, 191, 196, 191], 'all_points_y': [176, 185, 183, 200, 203, 192, 182, 176]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [339, 339, 354, 360, 354, 356], 'all_points_y': [59, 80, 83, 68, 57, 57]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [425, 411, 408, 419, 428, 436, 423, 425], 'all_points_y': [8, 12, 26, 32, 26, 12, 5, 8]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [122, 132, 139, 151, 128], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [119, 114, 125, 123, 136, 140, 132, 117, 117], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [91, 88, 102, 111, 112, 92, 91], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [117, 117, 136, 140, 132], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [32, 26, 23, 35, 43, 45, 45, 43], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [277, 271, 268, 280, 283, 283], 'all_points_y': [102, 105, 112, 115, 105, 103]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [253, 251, 265, 265, 263], 'all_points_y': [114, 126, 129, 119, 115]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [516, 514, 528, 534, 533, 525, 524], 'all_points_y': [114, 131, 137, 131, 117, 112, 111]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [43, 40, 51, 55, 48], 'all_points_y': [297, 311, 313, 299, 294]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [85, 71, 68, 80, 91, 91, 89], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [202, 185, 189, 174, 183, 171, 174, 186, 197, 217, 222, 214, 208], 'all_points_y': [508, 517, 536, 551, 570, 581, 593, 594, 585, 570, 553, 521, 508]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [240, 226, 243, 257, 260, 269, 290, 288, 276], 'all_points_y': [539, 562, 571, 585, 602, 613, 604, 579, 557]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [246, 229, 237, 259, 279, 274, 265, 265], 'all_points_y': [641, 661, 684, 687, 685, 664, 644, 647]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [134, 122, 132, 145, 151], 'all_points_y': [642, 654, 668, 661, 651]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [111, 100, 105, 119, 123, 123], 'all_points_y': [675, 684, 699, 701, 682, 679]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [183, 166, 146, 134, 163, 180, 196, 208, 225, 213, 208], 'all_points_y': [297, 310, 317, 342, 359, 353, 336, 326, 316, 300, 300]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [342, 339, 351, 334, 310, 297, 314, 333, 348, 359, 368, 380, 385, 397, 391, 376, 362], 'all_points_y': [320, 333, 346, 360, 377, 400, 411, 411, 403, 394, 368, 362, 348, 339, 322, 313, 313]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [282, 279, 290, 316, 322, 346, 359, 376, 419, 451, 485, 499, 547, 576, 608, 622, 618, 647, 639, 602, 568, 567, 542, 521, 516, 496, 496, 476, 474, 453, 442, 434, 391, 360, 346, 339, 336, 323, 325], 'all_points_y': [172, 186, 188, 192, 174, 174, 163, 174, 168, 156, 162, 191, 196, 183, 160, 122, 102, 82, 55, 45, 45, 75, 51, 51, 75, 74, 52, 54, 71, 65, 74, 92, 111, 109, 120, 137, 139, 139, 142]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [5, 28, 46, 65, 86, 103, 114, 99, 77, 75, 97, 79, 94, 69, 42, 26, 34, 2, 3], 'all_points_y': [373, 357, 348, 336, 337, 353, 382, 408, 423, 444, 445, 459, 480, 480, 491, 500, 542, 562, 444]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [444, 442, 456, 465, 459, 459, 459], 'all_points_y': [413, 428, 433, 428, 411, 414, 413]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [642, 633, 633, 648, 658, 659, 658, 656, 661], 'all_points_y': [285, 294, 302, 306, 303, 291, 291, 291, 294]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1773, 1744, 1729, 1694, 1671, 1631, 1566, 1566, 1723, 1892, 1877], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [4, 137, 406, 893, 891, 4, 2], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [340, 363, 383, 401, 420, 435, 460, 478, 482, 475, 456, 384, 353, 340, 337, 335], 'all_points_y': [250, 220, 205, 192, 195, 190, 186, 198, 227, 251, 266, 289, 291, 273, 260, 251]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [196, 186, 174, 175, 186, 212, 228, 244, 257, 285, 296, 331, 363, 432, 462, 491, 505, 520, 513, 511, 497, 473, 461, 442, 405, 377, 353, 343, 328, 312, 298, 292, 276, 251, 233, 191], 'all_points_y': [238, 247, 260, 279, 285, 287, 297, 289, 282, 267, 263, 271, 294, 272, 258, 222, 198, 177, 158, 142, 137, 134, 124, 116, 130, 154, 153, 154, 171, 179, 179, 191, 201, 201, 212, 240]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [426, 423, 418, 417, 430, 456, 479, 491, 487, 483, 460, 437, 435], 'all_points_y': [328, 347, 362, 377, 387, 378, 363, 334, 315, 308, 304, 308, 310]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [498, 492, 492, 504, 512, 518, 516, 509, 498], 'all_points_y': [375, 383, 389, 394, 392, 384, 374, 371, 371]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [174, 171, 175, 185, 192, 195, 187, 175, 174], 'all_points_y': [435, 443, 448, 448, 439, 429, 426, 430, 432]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [246, 242, 245, 255, 263, 264, 261, 254], 'all_points_y': [518, 529, 536, 535, 528, 524, 518, 516]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1302, 1293, 1282, 1274, 1274, 1285, 1298, 1312, 1319, 1322, 1325, 1326, 1318], 'all_points_y': [664, 671, 690, 719, 719, 719, 719, 719, 715, 700, 685, 669, 664]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1333, 1322, 1312, 1311, 1314, 1329, 1345, 1344, 1347, 1347, 1347], 'all_points_y': [706, 719, 719, 719, 719, 719, 719, 719, 708, 704, 703]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [524, 531, 542, 548, 542, 525, 520, 517, 523], 'all_points_y': [260, 255, 257, 248, 241, 244, 252, 260, 263]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [529, 534, 542, 544, 537, 529, 524, 524], 'all_points_y': [226, 222, 221, 229, 238, 239, 235, 234]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [555, 563, 571, 577, 584, 592, 599, 606, 616, 615, 598, 596, 596, 581, 573, 575, 571, 572, 569], 'all_points_y': [636, 634, 637, 642, 639, 633, 642, 640, 640, 649, 653, 666, 684, 685, 677, 669, 663, 657, 652]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [451, 443, 448, 449, 451, 458, 460, 468, 463, 462, 452, 460], 'all_points_y': [561, 565, 573, 586, 592, 589, 584, 581, 572, 562, 560, 563]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [616, 627, 635, 639, 655, 654, 655, 648, 643, 637, 633, 630, 620, 610, 612], 'all_points_y': [497, 493, 492, 498, 491, 483, 473, 470, 457, 455, 469, 479, 479, 481, 492]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [29, 20, 20, 16, 10, 8, 16, 24, 29, 37, 44, 36, 33], 'all_points_y': [647, 655, 665, 675, 690, 701, 709, 694, 682, 669, 654, 642, 643]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [67, 69, 61, 56, 50, 50, 43, 35, 30, 36, 45, 50, 53, 63], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [8, 17, 19, 30, 37, 47, 31, 24, 16, 13, 17, 11, 10], 'all_points_y': [386, 387, 375, 377, 376, 363, 363, 361, 357, 366, 372, 376, 376]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [220, 228, 220, 212, 211, 218, 220], 'all_points_y': [183, 175, 166, 173, 180, 183, 183]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [261, 270, 264, 255, 251, 251, 260], 'all_points_y': [153, 143, 136, 136, 140, 148, 153]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [462, 467, 472, 485, 495, 500, 505, 501, 478, 463, 461], 'all_points_y': [640, 643, 634, 628, 624, 623, 612, 612, 621, 627, 640]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [519, 526, 522, 517, 515, 510, 516], 'all_points_y': [629, 617, 610, 610, 617, 623, 627]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [504, 512, 516, 509, 503, 505], 'all_points_y': [651, 649, 639, 635, 639, 643]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1263, 1267, 1274, 1285, 1317, 1341, 1348, 1348, 1348, 1348, 1343, 1347, 1343, 1331, 1325, 1307, 1308, 1298, 1288, 1282, 1282, 1287, 1276, 1263], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1307, 1324, 1333, 1333, 1344, 1347, 1348, 1323, 1348, 1325, 1325, 1317, 1300, 1286, 1295, 1306, 1306, 1306], 'all_points_y': [572, 569, 568, 579, 571, 589, 646, 712, 704, 712, 677, 660, 661, 659, 628, 610, 589, 589]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [191, 147, 90, 49, 1, 1, 38, 72, 112, 127, 137, 162, 191, 201, 236, 273, 324, 326], 'all_points_y': [1, 44, 113, 167, 224, 331, 302, 258, 210, 199, 173, 147, 123, 93, 75, 50, 19, 2]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}], 'class_ids': array([2, 2, 2, ..., 2, 2, 2], dtype=int32)} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1265, in load_image_gt class_ids = class_ids[_idx] IndexError: boolean index did not match indexed array along dimension 0; dimension is 2426 but corresponding boolean dimension is 127 ERROR:root:Error processing image {'id': '00191_batch2.jpg', 'source': 'ead', 'path': '/content/drive/My Drive/endoscopy-artefact-detection-ead-dataset/trainingData_semanticSegmentation.zip (Unzipped Files)/train/trainingData_semanticSegmentation/original_images/00191_batch2.jpg', 'width': 1244, 'height': 1079, 'polygons': [{'shape_attributes': {'name': 'polygon', 'all_points_x': [1177, 1167, 1178, 1184, 1183, 1177], 'all_points_y': [334, 345, 353, 343, 337, 336]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1229, 1224, 1232, 1240, 1241, 1235, 1229], 'all_points_y': [273, 282, 283, 285, 277, 273, 273]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1170, 1169, 1177, 1181, 1177, 1169], 'all_points_y': [564, 574, 579, 573, 568, 564]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1101, 1098, 1104, 1113, 1112, 1104], 'all_points_y': [437, 450, 454, 450, 442, 437]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1167, 1158, 1167, 1177, 1170], 'all_points_y': [427, 436, 442, 437, 427]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [922, 916, 922, 930, 927, 924], 'all_points_y': [451, 460, 471, 464, 456, 453]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1027, 1024, 1039, 1039, 1035], 'all_points_y': [423, 436, 436, 430, 427]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1095, 1081, 1087, 1096, 1100, 1096], 'all_points_y': [354, 357, 367, 363, 354, 354]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1167, 1155, 1161, 1173, 1170], 'all_points_y': [291, 294, 303, 302, 293]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [627, 627, 644, 644, 630], 'all_points_y': [197, 214, 208, 200, 196]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [962, 973, 978, 978, 969, 966], 'all_points_y': [249, 243, 248, 257, 259, 256]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [990, 986, 987, 995, 999, 998], 'all_points_y': [112, 119, 126, 126, 122, 117]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [990, 982, 986, 999, 996], 'all_points_y': [142, 148, 156, 152, 145]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [942, 933, 936, 947, 950, 947], 'all_points_y': [243, 246, 254, 251, 245, 243]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [548, 541, 537, 541, 551, 556, 553, 550], 'all_points_y': [65, 72, 77, 86, 79, 71, 65, 63]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [926, 913, 918, 927, 932], 'all_points_y': [26, 31, 37, 37, 34]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [516, 513, 519, 527, 531, 530, 530], 'all_points_y': [5, 20, 20, 22, 6, 2, 3]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [562, 554, 559, 571, 579, 579], 'all_points_y': [91, 102, 109, 119, 108, 102]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [596, 607, 610, 602], 'all_points_y': [37, 26, 38, 42]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [579, 576, 587, 596, 591, 577], 'all_points_y': [219, 226, 226, 226, 219, 217]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [484, 493, 507, 499, 485], 'all_points_y': [257, 266, 268, 254, 254]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [545, 557, 565, 559, 548, 551], 'all_points_y': [317, 316, 320, 326, 326, 326]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [882, 876, 879, 887, 887], 'all_points_y': [37, 42, 48, 48, 38]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [699, 701, 687, 690, 705, 718, 710, 704, 699], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [614, 611, 616, 624, 627, 624], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [932, 930, 938, 939, 936, 930, 933], 'all_points_y': [383, 393, 393, 387, 382, 385, 387]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [827, 819, 832, 836, 832, 832], 'all_points_y': [23, 32, 38, 31, 22, 23]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [938, 926, 930, 941, 946, 946], 'all_points_y': [38, 40, 51, 51, 45, 46]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [420, 410, 422, 448, 445], 'all_points_y': [248, 260, 269, 266, 251]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [183, 115, 2, 0, 28, 46, 79, 105, 122, 123, 151, 182, 171, 200, 206, 209, 192, 216, 245, 257, 280, 276, 282, 269, 256, 236, 223, 225, 242, 248, 246, 236, 222, 226, 229, 219, 226, 219, 226, 231, 246, 240, 240, 246, 256, 259, 268, 277, 276, 256, 265, 280, 286, 280, 296, 308, 313, 296, 291, 283, 269, 257, 240, 240, 214, 200, 185, 168, 160, 149, 132, 115, 114, 115, 128, 145, 165, 180, 196, 185], 'all_points_y': [0, 83, 220, 442, 487, 502, 505, 482, 473, 493, 494, 476, 437, 444, 460, 494, 511, 528, 534, 525, 531, 517, 507, 493, 491, 493, 480, 460, 467, 456, 422, 413, 410, 399, 391, 377, 363, 346, 339, 323, 330, 348, 362, 374, 393, 416, 420, 419, 439, 460, 479, 484, 468, 454, 460, 436, 417, 387, 337, 300, 283, 271, 268, 279, 280, 293, 308, 322, 348, 353, 330, 308, 286, 253, 226, 162, 92, 29, 3, 0]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [410, 402, 405, 423, 434, 427, 402, 396, 370, 356, 342, 346, 363, 362, 390, 405, 419, 431, 439, 436, 442, 457, 465, 467, 471, 488, 510, 490, 459, 425], 'all_points_y': [480, 491, 507, 511, 536, 547, 553, 576, 579, 601, 622, 654, 667, 687, 696, 685, 702, 698, 681, 658, 645, 630, 624, 601, 588, 582, 574, 537, 508, 487]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [487, 476, 476, 488, 494, 493], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [393, 383, 390, 403, 410, 397], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [333, 316, 323, 311, 273, 276, 299, 317, 323, 345, 348, 363, 354, 334, 306, 320, 350, 365, 345, 356, 345, 351, 374, 394, 397, 397, 410, 420, 428, 430, 428, 439, 457, 459, 447, 442, 430, 422, 408, 430, 397, 391, 377, 367, 334], 'all_points_y': [708, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 715, 708]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [211, 231, 251, 262, 265, 237, 216, 199, 176, 169, 179, 194, 211, 219, 222, 213], 'all_points_y': [633, 630, 627, 634, 645, 656, 661, 673, 673, 665, 659, 656, 656, 651, 642, 634]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [95, 83, 89, 103, 115, 122, 111, 100, 92], 'all_points_y': [648, 658, 664, 664, 658, 654, 647, 644, 645]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [339, 330, 314, 305, 296, 294, 305, 316, 325, 333, 339, 350, 340], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [739, 748, 764, 781, 784, 741], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [634, 624, 633, 645, 638], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [68, 71, 69, 89, 94, 94, 88], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [177, 194, 209, 211, 197, 185, 177], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [290, 277, 294, 308, 305], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [208, 188, 194, 211, 222, 228, 245, 239, 239, 229, 214], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [361, 342, 327, 314, 295, 263, 158, 186, 449, 450, 443, 437, 429, 416, 408, 396, 392], 'all_points_y': [693, 702, 716, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 716, 713]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': True, 'Specularity': False, 'Artefact': False, 'Bubbles': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1241, 1190, 1146, 1142, 1119, 1108, 1081, 1065, 1048, 1035, 1018, 964, 953, 929, 924, 1061, 1200, 1241, 1243], 'all_points_y': [714, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [942, 917, 909, 924, 936, 943, 942], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [302, 282, 269, 264, 267, 280, 279, 279], 'all_points_y': [276, 284, 302, 326, 339, 336, 334, 335]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [389, 384, 390, 399, 409, 411, 408, 397, 395, 394], 'all_points_y': [143, 158, 181, 194, 197, 184, 173, 148, 140, 141]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [871, 905, 922, 912, 890, 879, 883, 882], 'all_points_y': [459, 446, 446, 459, 469, 473, 474, 473]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [37, 21, 24, 51, 62, 47, 44], 'all_points_y': [206, 204, 226, 217, 207, 202, 204]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [20, 37, 48, 48, 36, 26, 18, 20], 'all_points_y': [173, 166, 156, 172, 179, 187, 183, 185]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [660, 629, 594, 567, 564, 533, 506, 480, 454, 419, 352, 325, 301, 260, 229, 244, 278, 312, 324, 320, 328, 314, 324, 347, 386, 606, 616, 599, 602, 588, 591, 625, 648, 676, 700, 714, 706, 702, 694, 679, 677], 'all_points_y': [476, 479, 518, 572, 598, 640, 672, 694, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 714, 656, 622, 615, 558, 535, 510, 493, 483, 480, 480]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': True, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1, 3, 26, 57, 92, 111, 132, 172, 200, 190, 165, 145, 105, 60], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [253, 233, 223, 220, 230, 246, 268, 285, 321, 347, 371, 358, 349, 331, 310, 284, 274], 'all_points_y': [328, 335, 364, 402, 440, 476, 483, 517, 551, 550, 531, 481, 453, 415, 383, 356, 352]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [3, 3, 60, 186, 186, 308, 329, 320, 305, 287, 260, 224, 199, 192, 200, 196, 131, 102, 91], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1208, 1200, 1210, 1218, 1217, 1218], 'all_points_y': [719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [900, 916, 934, 939, 936, 919, 907, 900, 899], 'all_points_y': [476, 464, 459, 459, 467, 477, 484, 480, 476]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [476, 425, 392, 361, 324, 262, 204, 177, 552, 555, 554, 554, 545, 545, 555, 572, 575, 552, 538, 516, 473, 469], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': True}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [923, 918, 926, 940, 962, 971, 983, 978, 959, 954, 933, 923], 'all_points_y': [523, 549, 580, 597, 590, 569, 559, 536, 524, 536, 519, 523]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [827, 831, 851, 831, 823], 'all_points_y': [589, 604, 593, 579, 584]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True}}}, {'shape_attributes': {'name': 'polyline', 'all_points_x': [460, 460, 492, 498, 512, 494, 481, 473, 460], 'all_points_y': [399, 430, 425, 413, 396, 395, 410, 393, 402]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [66, 29, 46, 95, 152, 190, 209, 142, 123, 121], 'all_points_y': [273, 291, 358, 478, 480, 424, 392, 310, 282, 286]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [75, 67, 99, 126, 121, 105, 95], 'all_points_y': [552, 589, 615, 614, 575, 551, 554]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [810, 795, 790, 807, 812], 'all_points_y': [525, 531, 544, 542, 527]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [819, 812, 818, 827, 827, 821], 'all_points_y': [556, 567, 570, 565, 554, 556]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [782, 795, 804, 815, 805, 788, 787], 'all_points_y': [576, 564, 568, 579, 590, 596, 590]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [775, 781, 785, 770, 750, 735, 727, 727, 751, 759], 'all_points_y': [599, 607, 616, 624, 625, 621, 610, 598, 590, 585]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [798, 790, 792, 776, 775, 782, 802, 819, 822, 818], 'all_points_y': [368, 373, 382, 397, 405, 416, 408, 399, 382, 380]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [633, 647, 647, 659, 673, 685, 676, 658, 647], 'all_points_y': [571, 571, 565, 564, 554, 544, 537, 548, 553]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [722, 724, 722, 735, 741, 748, 741], 'all_points_y': [556, 568, 584, 581, 574, 559, 556]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [695, 688, 690, 699, 704], 'all_points_y': [537, 544, 551, 551, 542]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [687, 682, 688, 698, 690], 'all_points_y': [564, 574, 579, 574, 564]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [684, 679, 676, 681, 685, 693, 702, 704, 702], 'all_points_y': [122, 129, 142, 148, 156, 166, 159, 143, 140]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [738, 730, 730, 739, 744, 744], 'all_points_y': [103, 115, 120, 122, 112, 114]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [584, 573, 579, 596, 613, 607], 'all_points_y': [223, 236, 245, 243, 237, 233]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [627, 616, 625, 631, 638], 'all_points_y': [239, 248, 256, 249, 245]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [716, 705, 708, 721, 725, 722], 'all_points_y': [334, 342, 348, 348, 343, 333]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [186, 182, 169, 169, 183, 191, 196, 191], 'all_points_y': [176, 185, 183, 200, 203, 192, 182, 176]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [339, 339, 354, 360, 354, 356], 'all_points_y': [59, 80, 83, 68, 57, 57]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [425, 411, 408, 419, 428, 436, 423, 425], 'all_points_y': [8, 12, 26, 32, 26, 12, 5, 8]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [122, 132, 139, 151, 128], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [119, 114, 125, 123, 136, 140, 132, 117, 117], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [91, 88, 102, 111, 112, 92, 91], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [117, 117, 136, 140, 132], 'all_points_y': [719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [32, 26, 23, 35, 43, 45, 45, 43], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [277, 271, 268, 280, 283, 283], 'all_points_y': [102, 105, 112, 115, 105, 103]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [253, 251, 265, 265, 263], 'all_points_y': [114, 126, 129, 119, 115]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [516, 514, 528, 534, 533, 525, 524], 'all_points_y': [114, 131, 137, 131, 117, 112, 111]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [43, 40, 51, 55, 48], 'all_points_y': [297, 311, 313, 299, 294]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [85, 71, 68, 80, 91, 91, 89], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [202, 185, 189, 174, 183, 171, 174, 186, 197, 217, 222, 214, 208], 'all_points_y': [508, 517, 536, 551, 570, 581, 593, 594, 585, 570, 553, 521, 508]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [240, 226, 243, 257, 260, 269, 290, 288, 276], 'all_points_y': [539, 562, 571, 585, 602, 613, 604, 579, 557]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [246, 229, 237, 259, 279, 274, 265, 265], 'all_points_y': [641, 661, 684, 687, 685, 664, 644, 647]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [134, 122, 132, 145, 151], 'all_points_y': [642, 654, 668, 661, 651]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [111, 100, 105, 119, 123, 123], 'all_points_y': [675, 684, 699, 701, 682, 679]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [183, 166, 146, 134, 163, 180, 196, 208, 225, 213, 208], 'all_points_y': [297, 310, 317, 342, 359, 353, 336, 326, 316, 300, 300]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [342, 339, 351, 334, 310, 297, 314, 333, 348, 359, 368, 380, 385, 397, 391, 376, 362], 'all_points_y': [320, 333, 346, 360, 377, 400, 411, 411, 403, 394, 368, 362, 348, 339, 322, 313, 313]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [282, 279, 290, 316, 322, 346, 359, 376, 419, 451, 485, 499, 547, 576, 608, 622, 618, 647, 639, 602, 568, 567, 542, 521, 516, 496, 496, 476, 474, 453, 442, 434, 391, 360, 346, 339, 336, 323, 325], 'all_points_y': [172, 186, 188, 192, 174, 174, 163, 174, 168, 156, 162, 191, 196, 183, 160, 122, 102, 82, 55, 45, 45, 75, 51, 51, 75, 74, 52, 54, 71, 65, 74, 92, 111, 109, 120, 137, 139, 139, 142]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [5, 28, 46, 65, 86, 103, 114, 99, 77, 75, 97, 79, 94, 69, 42, 26, 34, 2, 3], 'all_points_y': [373, 357, 348, 336, 337, 353, 382, 408, 423, 444, 445, 459, 480, 480, 491, 500, 542, 562, 444]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [444, 442, 456, 465, 459, 459, 459], 'all_points_y': [413, 428, 433, 428, 411, 414, 413]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [642, 633, 633, 648, 658, 659, 658, 656, 661], 'all_points_y': [285, 294, 302, 306, 303, 291, 291, 291, 294]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1773, 1744, 1729, 1694, 1671, 1631, 1566, 1566, 1723, 1892, 1877], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [4, 137, 406, 893, 891, 4, 2], 'all_points_y': [719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [340, 363, 383, 401, 420, 435, 460, 478, 482, 475, 456, 384, 353, 340, 337, 335], 'all_points_y': [250, 220, 205, 192, 195, 190, 186, 198, 227, 251, 266, 289, 291, 273, 260, 251]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [196, 186, 174, 175, 186, 212, 228, 244, 257, 285, 296, 331, 363, 432, 462, 491, 505, 520, 513, 511, 497, 473, 461, 442, 405, 377, 353, 343, 328, 312, 298, 292, 276, 251, 233, 191], 'all_points_y': [238, 247, 260, 279, 285, 287, 297, 289, 282, 267, 263, 271, 294, 272, 258, 222, 198, 177, 158, 142, 137, 134, 124, 116, 130, 154, 153, 154, 171, 179, 179, 191, 201, 201, 212, 240]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [426, 423, 418, 417, 430, 456, 479, 491, 487, 483, 460, 437, 435], 'all_points_y': [328, 347, 362, 377, 387, 378, 363, 334, 315, 308, 304, 308, 310]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [498, 492, 492, 504, 512, 518, 516, 509, 498], 'all_points_y': [375, 383, 389, 394, 392, 384, 374, 371, 371]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [174, 171, 175, 185, 192, 195, 187, 175, 174], 'all_points_y': [435, 443, 448, 448, 439, 429, 426, 430, 432]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [246, 242, 245, 255, 263, 264, 261, 254], 'all_points_y': [518, 529, 536, 535, 528, 524, 518, 516]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1302, 1293, 1282, 1274, 1274, 1285, 1298, 1312, 1319, 1322, 1325, 1326, 1318], 'all_points_y': [664, 671, 690, 719, 719, 719, 719, 719, 715, 700, 685, 669, 664]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1333, 1322, 1312, 1311, 1314, 1329, 1345, 1344, 1347, 1347, 1347], 'all_points_y': [706, 719, 719, 719, 719, 719, 719, 719, 708, 704, 703]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Artefact': False, 'Bubbles': True, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [524, 531, 542, 548, 542, 525, 520, 517, 523], 'all_points_y': [260, 255, 257, 248, 241, 244, 252, 260, 263]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [529, 534, 542, 544, 537, 529, 524, 524], 'all_points_y': [226, 222, 221, 229, 238, 239, 235, 234]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [555, 563, 571, 577, 584, 592, 599, 606, 616, 615, 598, 596, 596, 581, 573, 575, 571, 572, 569], 'all_points_y': [636, 634, 637, 642, 639, 633, 642, 640, 640, 649, 653, 666, 684, 685, 677, 669, 663, 657, 652]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [451, 443, 448, 449, 451, 458, 460, 468, 463, 462, 452, 460], 'all_points_y': [561, 565, 573, 586, 592, 589, 584, 581, 572, 562, 560, 563]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [616, 627, 635, 639, 655, 654, 655, 648, 643, 637, 633, 630, 620, 610, 612], 'all_points_y': [497, 493, 492, 498, 491, 483, 473, 470, 457, 455, 469, 479, 479, 481, 492]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [29, 20, 20, 16, 10, 8, 16, 24, 29, 37, 44, 36, 33], 'all_points_y': [647, 655, 665, 675, 690, 701, 709, 694, 682, 669, 654, 642, 643]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [67, 69, 61, 56, 50, 50, 43, 35, 30, 36, 45, 50, 53, 63], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [8, 17, 19, 30, 37, 47, 31, 24, 16, 13, 17, 11, 10], 'all_points_y': [386, 387, 375, 377, 376, 363, 363, 361, 357, 366, 372, 376, 376]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [220, 228, 220, 212, 211, 218, 220], 'all_points_y': [183, 175, 166, 173, 180, 183, 183]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [261, 270, 264, 255, 251, 251, 260], 'all_points_y': [153, 143, 136, 136, 140, 148, 153]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [462, 467, 472, 485, 495, 500, 505, 501, 478, 463, 461], 'all_points_y': [640, 643, 634, 628, 624, 623, 612, 612, 621, 627, 640]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [519, 526, 522, 517, 515, 510, 516], 'all_points_y': [629, 617, 610, 610, 617, 623, 627]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [504, 512, 516, 509, 503, 505], 'all_points_y': [651, 649, 639, 635, 639, 643]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': True, 'Artefact': False, 'Bubbles': False, 'Saturation': False}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1263, 1267, 1274, 1285, 1317, 1341, 1348, 1348, 1348, 1348, 1343, 1347, 1343, 1331, 1325, 1307, 1308, 1298, 1288, 1282, 1282, 1287, 1276, 1263], 'all_points_y': [719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [1307, 1324, 1333, 1333, 1344, 1347, 1348, 1323, 1348, 1325, 1325, 1317, 1300, 1286, 1295, 1306, 1306, 1306], 'all_points_y': [572, 569, 568, 579, 571, 589, 646, 712, 704, 712, 677, 660, 661, 659, 628, 610, 589, 589]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': False, 'Bubbles': False, 'Saturation': True}}}, {'shape_attributes': {'name': 'polygon', 'all_points_x': [191, 147, 90, 49, 1, 1, 38, 72, 112, 127, 137, 162, 191, 201, 236, 273, 324, 326], 'all_points_y': [1, 44, 113, 167, 224, 331, 302, 258, 210, 199, 173, 147, 123, 93, 75, 50, 19, 2]}, 'region_attributes': {'EAD-Challenge2019': {'Instrument': False, 'Specularity': False, 'Artefact': True, 'Bubbles': False, 'Saturation': False}}}], 'class_ids': array([2, 2, 2, ..., 2, 2, 2], dtype=int32)} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1265, in load_image_gt class_ids = class_ids[_idx] IndexError: boolean index did not match indexed array along dimension 0; dimension is 2426 but corresponding boolean dimension is 127
in load_ead you should add width and height information to pass it to load_mask. Man, you should really start over again on the base of balloon.py. You have so much troubles for nothing !
This one is my ead.py file I am not able to understand where i am doing wrong.
import os import sys import json import datetime import numpy as np import skimage.draw
ROOT_DIR = os.path.abspath("/content/drive/My Drive/endoscopy-artefact-detection-ead-dataset/trainingData_semanticSegmentation.zip (Unzipped Files)/")
sys.path.append(ROOT_DIR) # To find local version of the library from mrcnn.config import Config from mrcnn import model as modellib, utils
COCO_WEIGHTS_PATH = os.path.join(ROOT_DIR, "mask_rcnn_coco.h5")
DEFAULT_LOGS_DIR = os.path.join(ROOT_DIR, "logs")
############################################################
############################################################
class EadConfig(Config): """Configuration for training on the toy dataset. Derives from the base Config class and overrides some values. """
NAME = "ead"
# We use a GPU with 12GB memory, which can fit two images.
# Adjust down if you use a smaller GPU.
IMAGES_PER_GPU = 2
# Number of classes (including background)
NUM_CLASSES = 1 + 5 # Background + ead
# Number of training steps per epoch
STEPS_PER_EPOCH = 100
# Skip detections with < 90% confidence
DETECTION_MIN_CONFIDENCE = 0.9
############################################################
############################################################
class EadDataset(utils.Dataset):
def load_ead(self, dataset_dir, subset):
"""Load a subset of the Balloon dataset.
dataset_dir: Root directory of the dataset.
subset: Subset to load: train or val
"""
# Add classes. We have only one class to add.
self.add_class("ead",1, "Intrument")
self.add_class("ead",2,"Specularity")
self.add_class("ead",3,"Artefact")
self.add_class("ead",4,"Bubbles")
self.add_class("ead",5,"Saturation")
# Train or validation dataset?
assert subset in ["train","val"]
dataset_dir = os.path.join(dataset_dir, subset)
# Load annotations
# VGG Image Annotator (up to version 1.6) saves each image in the form:
# { 'filename': '28503151_5b5b7ec140_b.jpg',
# 'regions': {
# '0': {
# 'region_attributes': {},
# 'shape_attributes': {
# 'all_points_x': [...],
# 'all_points_y': [...],
# 'name': 'polygon'}},
# ... more regions ...
# },
# 'size': 100202
# }
# We mostly care about the x and y coordinates of each region
# Note: In VIA 2.0, regions was changed from a dict to a list.
annotations = json.load(open(os.path.join(dataset_dir, "via_EAD_Challenge2019.json")))
anno_new = annotations['_via_img_metadata']
#print(anno_new['regions'])
class_ids=[]
polygons=[]
for i,a in enumerate(anno_new.values()):
#print(a['regions'])
#print(i)
for j in a['regions']:
for c in j['region_attributes'].values():
#print(c)
try :
if c['Instrument'] == True:
class_ids.append(1)
elif c['Specularity'] == True:
class_ids.append(2)
elif c['Artefact'] == True:
class_ids.append(3)
elif c['Bubbles'] == True:
class_ids.append(4)
elif c['Saturation']== True:
class_ids.append(5)
except KeyError as e:
print("attribute not present")
#print(class_ids)
for i,a in enumerate(anno_new.values()):
#print(a['regions'])
# print(i)
for j in a['regions']:
#for c in j['shape_attributes']:
#print(j)
#print("-----------------------")
try :
polygons.append(j);
except KeyError as e:
print("attribute not present")
#print(polygons)
# The VIA tool saves images in the JSON even if they don't have any
# annotations. Skip unannotated images.
# load_mask() needs the image size to convert polygons to masks.
# Unfortunately, VIA doesn't include it in JSON, so we must read
# the image. This is only managable since the dataset is tiny.
image_path = os.path.join(dataset_dir,"trainingData_semanticSegmentation/original_images", a['filename'])
try:
image = skimage.io.imread(image_path)
except:
return
height, width = image.shape[:2]
class_ids = np.array(class_ids, dtype=np.int32)
self.add_image(
"ead",
image_id=a['filename'], # use file name as a unique image id
path=image_path,
width=width, height=height,
polygons=polygons,
class_ids=class_ids)
def load_mask(self, image_id):
"""Generate instance masks for an image.
Returns:
masks: A bool array of shape [height, width, instance count] with
one mask per instance.
class_ids: a 1D array of class IDs of the instance masks.
"""
# If not a balloon dataset image, delegate to parent class.
image_info = self.image_info[image_id]
if image_info["source"] != "ead":
return super(self.__class__, self).load_mask(image_id)
# Convert polygons to a bitmap mask of shape
# [height, width, instance_count]
info = self.image_info[image_id]
#print(info)
#print("height weight len ==",info["height"], info["width"], len(info["polygons"]['shape_attributes']))
mask = np.zeros([info["height"], info["width"], len(info["polygons"])],
dtype=np.uint8)
for i, p in enumerate(info["polygons"]):
# Get indexes of pixels inside the polygon and set them to 1
#print(p)
for k,l in enumerate(p['shape_attributes']['all_points_y']):
if(l>720):
p['shape_attributes']['all_points_y'][k]=719
rr, cc = skimage.draw.polygon(p['shape_attributes']['all_points_y'], p['shape_attributes']['all_points_x'])
#print("mask.shape, min(mask),max(mask): {}, {},{}".format(mask.shape, np.min(mask),np.max(mask)))
#print("rr.shape, min(rr),max(rr): {}, {},{}".format(rr.shape, np.min(rr),np.max(rr)))
#print("cc.shape, min(cc),max(cc): {}, {},{}".format(cc.shape, np.min(cc),np.max(cc)))
## Note that this modifies the existing array arr, instead of creating a result array
## Ref: https://stackoverflow.com/questions/19666626/replace-all-elements-of-python-numpy-array-that-are-greater-than-some-value
rr[rr > mask.shape[0]-1] = mask.shape[0]-1
cc[cc > mask.shape[1]-1] = mask.shape[1]-1
#print("After fixing the dirt mask, new values:")
#print("rr.shape, min(rr),max(rr): {}, {},{}".format(rr.shape, np.min(rr),np.max(rr)))
#print("cc.shape, min(cc),max(cc): {}, {},{}".format(cc.shape, np.min(cc),np.max(cc)))
mask[rr, cc, i] = 1
#mask[rr, cc, i] = 1
# Return mask, and array of class IDs of each instance. Since we have
# one class ID only, we return an array of 1s
return mask.astype(np.bool), info["class_ids"]
def image_reference(self, image_id):
"""Return the path of the image."""
info = self.image_info[image_id]
if info["source"] == "ead":
return info["path"]
else:
super(self.__class__, self).image_reference(image_id)
def train(model, dataset_dir, subset): """Train the model."""
dataset_train = EadDataset()
dataset_train.load_ead(dataset_dir, subset)
dataset_train.prepare()
# Validation dataset
'''dataset_val = EadDataset()
dataset_val.load_ead(dataset_dir, "val")
dataset_val.prepare()'''
# *** This training schedule is an example. Update to your needs ***
# Since we're using a very small dataset, and starting from
# COCO trained weights, we don't need to train too long. Also,
# no need to train all layers, just the heads should do it.
'''print("Training network heads")
model.train(dataset_train, dataset_val,
learning_rate=config.LEARNING_RATE,
epochs=30,
layers='heads')
print("Train all layers")
model.train(dataset_train, dataset_val,
learning_rate=config.LEARNING_RATE,
epochs=40,
augmentation=augmentation,
layers='all')'''
print("Training network heads")
model.train(dataset_train,None,
learning_rate=config.LEARNING_RATE,
epochs=30,
layers='heads')
print("Train all layers")
model.train(dataset_train,None,
learning_rate=config.LEARNING_RATE,
epochs=40,
augmentation=augmentation,
layers='all')
############################################################
############################################################
def rle_encode(mask): """Encodes a mask in Run Length Encoding (RLE). Returns a string of space-separated values. """ assert mask.ndim == 2, "Mask must be of shape [Height, Width]"
m = mask.T.flatten()
# Compute gradient. Equals 1 or -1 at transition points
g = np.diff(np.concatenate([[0], m, [0]]), n=1)
# 1-based indicies of transition points (where gradient != 0)
rle = np.where(g != 0)[0].reshape([-1, 2]) + 1
# Convert second index in each pair to lenth
rle[:, 1] = rle[:, 1] - rle[:, 0]
return " ".join(map(str, rle.flatten()))
def rle_decode(rle, shape): """Decodes an RLE encoded list of space separated numbers and returns a binary mask.""" rle = list(map(int, rle.split())) rle = np.array(rle, dtype=np.int32).reshape([-1, 2]) rle[:, 1] += rle[:, 0] rle -= 1 mask = np.zeros([shape[0] * shape[1]], np.bool) for s, e in rle: assert 0 <= s < mask.shape[0] assert 1 <= e <= mask.shape[0], "shape: {} s {} e {}".format(shape, s, e) mask[s:e] = 1
mask = mask.reshape([shape[1], shape[0]]).T
return mask
def mask_to_rle(image_id, mask, scores): "Encodes instance masks to submission format." assert mask.ndim == 3, "Mask must be [H, W, count]"
if mask.shape[-1] == 0:
return "{},".format(image_id)
# Remove mask overlaps
# Multiply each instance mask by its score order
# then take the maximum across the last dimension
order = np.argsort(scores)[::-1] + 1 # 1-based descending
mask = np.max(mask * np.reshape(order, [1, 1, -1]), -1)
# Loop over instance masks
lines = []
for o in order:
m = np.where(mask == o, 1, 0)
# Skip if empty
if m.sum() == 0.0:
continue
rle = rle_encode(m)
lines.append("{}, {}".format(image_id, rle))
return "\n".join(lines)
############################################################
############################################################
def detect(model, dataset_dir, subset): """Run detection on images in the given directory.""" print("Running on {}".format(dataset_dir))
# Create directory
if not os.path.exists(RESULTS_DIR):
os.makedirs(RESULTS_DIR)
submit_dir = "submit_{:%Y%m%dT%H%M%S}".format(datetime.datetime.now())
submit_dir = os.path.join(RESULTS_DIR, submit_dir)
os.makedirs(submit_dir)
# Read dataset
dataset = EadDataset()
dataset.load_ead(dataset_dir, subset)
dataset.prepare()
# Load over images
submission = []
for image_id in dataset.image_ids:
# Load image and run detection
image = dataset.load_image(image_id)
# Detect objects
r = model.detect([image], verbose=0)[0]
# Encode image to RLE. Returns a string of multiple lines
source_id = dataset.image_info[image_id]["id"]
rle = mask_to_rle(source_id, r["masks"], r["scores"])
submission.append(rle)
# Save image with masks
visualize.display_instances(
image, r['rois'], r['masks'], r['class_ids'],
dataset.class_names, r['scores'],
show_bbox=False, show_mask=False,
title="Predictions")
plt.savefig("{}/{}.png".format(submit_dir, dataset.image_info[image_id]["id"]))
# Save to csv file
submission = "ImageId,EncodedPixels\n" + "\n".join(submission)
file_path = os.path.join(submit_dir, "submit.csv")
with open(file_path, "w") as f:
f.write(submission)
print("Saved to ", submit_dir)
############################################################
############################################################
if name == 'main': import argparse
# Parse command line arguments
parser = argparse.ArgumentParser(
description='Mask R-CNN for nuclei counting and segmentation')
parser.add_argument("command",
metavar="<command>",
help="'train' or 'detect'")
parser.add_argument('--dataset', required=False,
metavar="/path/to/dataset/",
help='Root directory of the dataset')
parser.add_argument('--weights', required=True,
metavar="/path/to/weights.h5",
help="Path to weights .h5 file or 'coco'")
parser.add_argument('--logs', required=False,
default=DEFAULT_LOGS_DIR,
metavar="/path/to/logs/",
help='Logs and checkpoints directory (default=logs/)')
parser.add_argument('--subset', required=False,
metavar="Dataset sub-directory",
help="Subset of dataset to run prediction on")
args = parser.parse_args()
# Validate arguments
if args.command == "train":
assert args.dataset, "Argument --dataset is required for training"
elif args.command == "detect":
assert args.subset, "Provide --subset to run prediction on"
print("Weights: ", args.weights)
print("Dataset: ", args.dataset)
if args.subset:
print("Subset: ", args.subset)
print("Logs: ", args.logs)
# Configurations
if args.command == "train":
config = EadConfig()
else:
config = EadInferenceConfig()
config.display()
# Create model
if args.command == "train":
model = modellib.MaskRCNN(mode="training", config=config,
model_dir=args.logs)
else:
model = modellib.MaskRCNN(mode="inference", config=config,
model_dir=args.logs)
# Select weights file to load
if args.weights.lower() == "coco":
weights_path = COCO_WEIGHTS_PATH
# Download weights file
if not os.path.exists(weights_path):
utils.download_trained_weights(weights_path)
elif args.weights.lower() == "last":
# Find last trained weights
weights_path = model.find_last()
elif args.weights.lower() == "imagenet":
# Start from ImageNet trained weights
weights_path = model.get_imagenet_weights()
else:
weights_path = args.weights
# Load weights
print("Loading weights ", weights_path)
if args.weights.lower() == "coco":
# Exclude the last layers because they require a matching
# number of classes
model.load_weights(weights_path, by_name=True, exclude=[
"mrcnn_class_logits", "mrcnn_bbox_fc",
"mrcnn_bbox", "mrcnn_mask"])
else:
model.load_weights(weights_path, by_name=True)
# Train or evaluate
if args.command == "train":
train(model, args.dataset, args.subset)
elif args.command == "detect":
detect(model, args.dataset, args.subset)
else:
print("'{}' is not recognized. "
"Use 'train' or 'detect'".format(args.command))
I have dataset witch is not in annotated format. it have directory like this - training_images //(folder name) 1.jpg 1.txt (bounding box information) 2.jpg 2.txt semantic_segmentayion //(folder name) original_images(contains all jpg images) training_data semantic_segmentation(contains .tif images i.e. masks of images)
I need to train for more class and I did try to modify funtions: load_objects() and load_mask() without success. i did not understand how i need to modify class_id in load_mask function .
So please help. I really appreciate your reading and help!