Skip to content

Commit 8d906a4

Browse files
committed
Merge branch 'omrirz-master'
2 parents 70a1aea + 9f9be5d commit 8d906a4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

run.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ def increase_index(current_index, last_index):
8888
return current_index
8989

9090

91-
def draw_line(img, x, y, height, width):
92-
cv2.line(img, (x, 0), (x, height), (0, 255, 255), thickness=args.cross_thickness)
93-
cv2.line(img, (0, y), (width, y), (0, 255, 255), thickness=args.cross_thickness)
91+
def draw_line(img, x, y, height, width, color):
92+
cv2.line(img, (x, 0), (x, height), color, thickness=args.cross_thickness)
93+
cv2.line(img, (0, y), (width, y), color, thickness=args.cross_thickness)
9494

9595

9696
def yolo_format(class_index, point_1, point_2, width, height):
@@ -352,6 +352,7 @@ def draw_info_bb_selected(tmp_img):
352352
if not os.path.exists(bb_dir):
353353
os.makedirs(bb_dir)
354354

355+
color = class_rgb[class_index].tolist()
355356
# loop
356357
while True:
357358
# clone the img
@@ -361,7 +362,7 @@ def draw_info_bb_selected(tmp_img):
361362
# draw edges
362363
tmp_img = draw_edges(tmp_img)
363364
# draw vertical and horizong yellow guide lines
364-
draw_line(tmp_img, mouse_x, mouse_y, height, width)
365+
draw_line(tmp_img, mouse_x, mouse_y, height, width, color)
365366
img_path = image_list[img_index]
366367
txt_path = get_txt_path(img_path)
367368
# draw already done bounding boxes
@@ -409,6 +410,8 @@ def draw_info_bb_selected(tmp_img):
409410
# change up current class key listener
410411
elif pressed_key == ord('w'):
411412
class_index = increase_index(class_index, last_class_index)
413+
color = class_rgb[class_index].tolist()
414+
draw_line(tmp_img, mouse_x, mouse_y, height, width, color)
412415
cv2.setTrackbarPos(TRACKBAR_CLASS, WINDOW_NAME, class_index)
413416

414417
# help key listener

0 commit comments

Comments
 (0)