<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_depth(self, idx):
 """ Load pre-processed depth for NYUDv2 segmentation set. """

        im = Image.open('{}/data/depth/img_{}.png'.format(self.nyud_dir, idx))
        d = np.array(im, dtype=np.float32)
        d = np.log(d)
        d -= self.mean_logd
        d = d[np.newaxis, ...]
        return d