@classmethod
def from_coco(cls, coco, dataset=None):
    """
        Creates an :class:`Image` from a dict in COCO formatted image

        :param coco: COCO formatted image
        :type coco: dict
        :rtype: :class:`Image`
        """
    metadata = coco.get('metadata', {})
    metadata.update({'license': coco.get('license'), 'flickr_url': coco.get
        ('flickr_url'), 'coco_url': coco.get('coco_url'), 'date_captured':
        coco.get('date_captured')})
    data = {'id': coco.get('id', 0), 'width': coco.get('width', 0),
        'height': coco.get('height', 0), 'path': coco.get('path', coco.get(
        'file_name', '')), 'metadata': metadata, 'dataset': dataset}
    return cls(**data)
