(x, batches, results, colors, classes)
| 97 | |
| 98 | |
| 99 | def write(x, batches, results, colors, classes): |
| 100 | c1 = tuple(x[1:3].int()) |
| 101 | c2 = tuple(x[3:5].int()) |
| 102 | img = results[int(x[0])] |
| 103 | cls = int(x[-1]) |
| 104 | label = "{0}".format(classes[cls]) |
| 105 | color = random.choice(colors) |
| 106 | cv2.rectangle(img, c1, c2,color, 1) |
| 107 | t_size = cv2.getTextSize(label, cv2.FONT_HERSHEY_PLAIN, 1 , 1)[0] |
| 108 | c2 = c1[0] + t_size[0] + 3, c1[1] + t_size[1] + 4 |
| 109 | cv2.rectangle(img, c1, c2,color, -1) |
| 110 | cv2.putText(img, label, (c1[0], c1[1] + t_size[1] + 4), cv2.FONT_HERSHEY_PLAIN, 1, [225,255,255], 1); |
| 111 | return img |
nothing calls this directly
no outgoing calls
no test coverage detected