title: Tensorflow dataset - map json
body: <p>I'm trying to build a dataset with the dataset api, my situation is the following:</p>
  
  <ol>
  <li>I have a set of json indicating for each instance a couple of images (in my case image and its mask)</li>
  <li>I want to map every json and return the couple of images as tensors</li>
  </ol>
  
  <p>In pure python I'd do something like</p>
  
  <pre><code>import json
  import tensorflow as tf
  def parse_json(json_path):
    json_file = json.load(open(json_path))
    img = tf.io.read_file(json_file['img'])
    mask = tf.io.read_file(json_file['mask']
  
    return img, mask
  </code></pre>
  
  <p>How can I achieve the same result with Tensorflow API? 
  Thanks for your help!</p>