Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. # loop over the detections
  2. for (box, score, label) in zip(boxes[0], scores[0], labels[0]):
  3. # filter out weak detections
  4. if score < args["confidence"]:
  5. continue
  6.  
  7. # convert the bounding box coordinates from floats to integers
  8. box = box.astype("int")
  9.  
  10. # Create the row for each prediction in the format:
  11. # <classname> <confidence> <ymin> <xmin> <ymax> <xmax>
  12. row = " ".join([LABELS[label], str(score),
  13. str(box[1]), str(box[0]), str(box[3]), str(box[2])])
  14. # Write each row of prediction in the corresponding txt file
  15. file.write("{}\n".format(row))
  16.  
  17. # Close the file
  18. file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement