h ims might not be a uint8 array. 
              
              # Do the prediction.
              preds = self.model(preprocessed_ims)
              
              # If the outputs are heatmaps, conver them to x,y loctions.
              pred_locs, pred_scores = self.convert_heatmaps_to_xy(preds)
              # For single animal networks: pred_locs and pred_scores shape must be conf.batch_size x conf.n_classes x 2 and conf.batch_size x conf.n_classes 
              # For multi-animal networks: pred_locs a