| 91 | print('update') |
| 92 | |
| 93 | def postprocess(boxes, scores, indices): |
| 94 | objects_identified = indices.shape[0] |
| 95 | out_boxes, out_scores, out_classes = [], [], [] |
| 96 | if objects_identified > 0: |
| 97 | for idx_ in indices: |
| 98 | out_classes.append(classes[idx_[1]]) |
| 99 | out_scores.append(scores[tuple(idx_)]) |
| 100 | idx_1 = (idx_[0], idx_[2]) |
| 101 | out_boxes.append(boxes[idx_1]) |
| 102 | print(objects_identified, "objects identified in source image.") |
| 103 | else: |
| 104 | print("No objects identified in source image.") |
| 105 | return out_boxes, out_scores, out_classes, objects_identified |
| 106 | |
| 107 | if tinyYOLOv3: |
| 108 | out_boxes, out_scores, out_classes, objects_identified = postprocess(boxes, scores, indices[0]) |