def generate_smm(observation, config=None,
                 channel_dimensions=(SMM_WIDTH, SMM_HEIGHT)):
  """Returns a list of minimap observations given the raw features for each
  active player.

  Args:
    observation: raw features from the environment
    config: environment config
    channel_dimensions: resolution of SMM to generate

  Returns:
    (N, H, W, C) - shaped np array representing SMM. N stands for the number of
    players we are controlling.
  """
  frame = np.zeros((len(observation), channel_dimensions[1],
                    channel_dimensions[0], len(get_smm_layers(config))),
                   dtype=np.uint8)

  for o_i, o in enumerate(observation):
    for index, layer in enumerate(get_smm_layers(config)):
      assert layer in o
      if layer == 'active':
        if o[layer] == -1:
          continue
        mark_points(frame[o_i, :, :, index],
                    np.array(o['left_team'][o[layer]]).reshape(-1))
      else:
        mark_points(frame[o_i, :, :, index], np.array(o[layer]).reshape(-1))
  return frame
Returns a list of minimap observations given the raw features for each
  active player.

  Args:
    observation: raw features from the environment
    config: environment config
    channel_dimensions: resolution of SMM to generate

  Returns:
    (N, H, W, C) - shaped np array representing SMM. N stands for the number of
    players we are controlling.
  
gfootball/env/observation_preprocessing.py