Skip to content

Commit

Permalink
Merge branch 'omrirz-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cartucho committed Mar 31, 2018
2 parents 70a1aea + 9f9be5d commit 8d906a4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def increase_index(current_index, last_index):
return current_index


def draw_line(img, x, y, height, width):
cv2.line(img, (x, 0), (x, height), (0, 255, 255), thickness=args.cross_thickness)
cv2.line(img, (0, y), (width, y), (0, 255, 255), thickness=args.cross_thickness)
def draw_line(img, x, y, height, width, color):
cv2.line(img, (x, 0), (x, height), color, thickness=args.cross_thickness)
cv2.line(img, (0, y), (width, y), color, thickness=args.cross_thickness)


def yolo_format(class_index, point_1, point_2, width, height):
Expand Down Expand Up @@ -352,6 +352,7 @@ def draw_info_bb_selected(tmp_img):
if not os.path.exists(bb_dir):
os.makedirs(bb_dir)

color = class_rgb[class_index].tolist()
# loop
while True:
# clone the img
Expand All @@ -361,7 +362,7 @@ def draw_info_bb_selected(tmp_img):
# draw edges
tmp_img = draw_edges(tmp_img)
# draw vertical and horizong yellow guide lines
draw_line(tmp_img, mouse_x, mouse_y, height, width)
draw_line(tmp_img, mouse_x, mouse_y, height, width, color)
img_path = image_list[img_index]
txt_path = get_txt_path(img_path)
# draw already done bounding boxes
Expand Down Expand Up @@ -409,6 +410,8 @@ def draw_info_bb_selected(tmp_img):
# change up current class key listener
elif pressed_key == ord('w'):
class_index = increase_index(class_index, last_class_index)
color = class_rgb[class_index].tolist()
draw_line(tmp_img, mouse_x, mouse_y, height, width, color)
cv2.setTrackbarPos(TRACKBAR_CLASS, WINDOW_NAME, class_index)

# help key listener
Expand Down

0 comments on commit 8d906a4

Please sign in to comment.