title: Accessing data in SVHN dataset in python
body: <p>I tried to extract data from tar.gz file which contains digitStruct.mat file.
  I used the following code snippet:</p>
  
  <pre><code>train_dataset = h5py.File('./train/digitStruct.mat')
  </code></pre>
  
  <p>I want to access the bbox and name details from this object itself. 
  for eg:</p>
  
  <pre><code>train_dataset[0]
  </code></pre>
  
  <p>Should output something like:</p>
  
  <pre><code>{'boxes': [{'height': 219.0,
  'label': 1.0,
  'left': 246.0,
  'top': 77.0,
  'width': 81.0},
  {'height': 219.0, 'label': 9.0, 'left': 323.0, 'top': 81.0, 'width': 96.0}],
   'filename': '1.png'}
  </code></pre>
  
  <p>I searched for it and found the some help on this link:</p>
  
  <p><a href="https://stackoverflow.com/questions/41176258/h5py-access-data-in-datasets-in-svhn">h5py, access data in Datasets in SVHN</a></p>
  
  <p>But the above link involves creating seperate functions get_box_data(index, hdf5_data) and get_name(index, hdf5_data) to retrieve value for the corresponding index.
  However, I want access it directly from the variable name train_dataset[index].</p>