Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import cv2
  2. import tools as tl
  3. import numpy as np
  4.  
  5. data_file = "Dataset"
  6. file = open("./"+data_file+"/input_seg.txt", 'r')
  7.  
  8. # Enter your name
  9. out_file = open("./results/Artur_Abdalimov_KBTU.txt", 'w')
  10.  
  11. for line in file:
  12. if ".jpg" in line:
  13. imgPath = "./"+data_file+"/" + line[:-1]
  14. img = cv2.imread(imgPath)
  15. line1 = line
  16. else:
  17. cords = line[:-1].split(" ")
  18. y1 = int(cords[0])
  19. x1 = int(cords[1])
  20. y2 = int(cords[2])
  21. x2 = int(cords[3])
  22.  
  23.  
  24. out_file.write(line1)
  25. out_file.write(line)
  26.  
  27. ###################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement