class_docstr: Berkeley (BAIR) robot pushing dataset.
class_docstr_tok: ["Berkeley","(","BAIR",")","robot","pushing","dataset","."]
code: def parse_frames(self, filenames):
      image_key = "{}/image_aux1/encoded"
      action_key = "{}/action"
      state_key = "{}/endeffector_pos"
  
      for f in filenames:
          print("Parsing ", f)
          for serialized_example in tf.python_io.tf_record_iterator(f):
              x = tf.train.Example()
              x.ParseFromString(serialized_example)
              # there are 4 features per frame
              # main image, aux image, actions and states
              nf = len(x.features.feature.keys()) // 4
  
              for i in range(nf):
                  image_name = image_key.format(i)
                  action_name = action_key.format(i)
                  state_name = state_key.format(i)
  
                  byte_str = x.features.feature[
                      image_name
                  ].bytes_list.value[0]
                  img = PIL_Image().frombytes(
                      "RGB",
                      (self.frame_width, self.frame_height),
                      byte_str,
                  )
                  arr = np.array(img.getdata())
                  frame = arr.reshape(
                      self.frame_width,
                      self.frame_height,
                      self.num_channels,
                  )
  
                  state = x.features.feature[
                      state_name
                  ].float_list.value
                  action = x.features.feature[
                      action_name
                  ].float_list.value
  
                  yield i, frame, state, action
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import tarfile
  import numpy
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import video_utils
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 13 for calling the VideoBairRobotPushing obj's underlying member method code with example usage: obj.parse_frames(filenames) without return types