MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / draw_predictions

Function draw_predictions

examples/FasterRCNN/viz.py:57–68  ·  view source on GitHub ↗

Args: boxes: kx4 scores: kxC

(img, boxes, scores)

Source from the content-addressed store, hash-verified

55
56
57def draw_predictions(img, boxes, scores):
58 """
59 Args:
60 boxes: kx4
61 scores: kxC
62 """
63 if len(boxes) == 0:
64 return img
65 labels = scores.argmax(axis=1)
66 scores = scores.max(axis=1)
67 tags = ["{},{:.2f}".format(cfg.DATA.CLASS_NAMES[lb], score) for lb, score in zip(labels, scores)]
68 return viz.draw_boxes(img, boxes, tags)
69
70
71def draw_final_outputs(img, results):

Callers 1

do_visualizeFunction · 0.90

Calls 2

maxMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…