Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # loop over the detections
- for (box, score, label) in zip(boxes[0], scores[0], labels[0]):
- # filter out weak detections
- if score < args["confidence"]:
- continue
- # convert the bounding box coordinates from floats to integers
- box = box.astype("int")
- # Create the row for each prediction in the format:
- # <classname> <confidence> <ymin> <xmin> <ymax> <xmax>
- row = " ".join([LABELS[label], str(score),
- str(box[1]), str(box[0]), str(box[3]), str(box[2])])
- # Write each row of prediction in the corresponding txt file
- file.write("{}\n".format(row))
- # Close the file
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement