code: def evaluate(
      results, data_dir, data_name, ovthresh=0.5, verbose=True
  ):
      fileids, _ = get_files(data_dir, data_name)
      fileids = fileids[: len(results)]
      annotations = get_annotations(data_dir, data_name, fileids)
      aps = []
  
      for c in range(80):
          ids = []
          scores = []
          boxes = []
          for i, fileid in enumerate(fileids):
              pred = results[i][c]
              if pred.shape[0] > 0:
                  for k in xrange(pred.shape[0]):
                      ids.append(fileid)
                      scores.append(pred[k, -1])
                      boxes.append(pred[k, :4] + 1)
          ids = np.array(ids)
          scores = np.array(scores)
          boxes = np.array(boxes)
          _annotations = dict(
              (k, v[c]) for (k, v) in annotations.items()
          )
          ap, _, _ = evaluate_class(
              ids, scores, boxes, _annotations, fileids, ovthresh
          )
          aps += [ap]
  
      strs = ""
      for c in range(80):
          strs += "| %6s " % classnames[c][:6]
      strs += "|\n"
  
      for ap in aps:
          strs += "|--------"
      strs += "|\n"
  
      for ap in aps:
          strs += "| %.4f " % ap
      strs += "|\n"
  
      strs += "Mean = %.4f" % np.mean(aps)
      return strs
  
file_path: tensornets/tensornets/datasets/coco.py
imports: from __future__ import division
  import os
  import json
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: evaluate(results, data_dir, data_name, ovthresh, verbose) and returns: strs