From bed2c86ed358ac64f34f63b1097e85c0f7905b69 Mon Sep 17 00:00:00 2001 From: Stephane Chavin <stephanechvn@gmail.com> Date: Wed, 5 Jul 2023 12:31:23 +0200 Subject: [PATCH] modify --- get_train_annot_YOLO.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/get_train_annot_YOLO.py b/get_train_annot_YOLO.py index 0980f0a..19d4b1c 100644 --- a/get_train_annot_YOLO.py +++ b/get_train_annot_YOLO.py @@ -185,7 +185,7 @@ def process(x): H,W = im.shape[0], im.shape[1] for l in range(len(fin)): - x, y, w, h = fin.x.iloc[l]*W , fin.y.iloc[l]*H , fin.w.iloc[l]*W , fin.h.iloc[l]*H + x, y, w, h = fin.x.iloc[l]*W , fin.y.iloc[l]*H , fin.width.iloc[l]*W , fin.height.iloc[l]*H shape1 = (int(x-(0.5*w)), int(y+(0.5*h))) shape2 = (int(x+(0.5*w)), int(y+(0.5*h))) @@ -210,6 +210,7 @@ def process(x): cv2.putText(im, label, text_shape, cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255,255,255), 1) plt.imshow(im) + plt.subplots_adjust(top=1, bottom=0, left=0, right=1) try: plt.savefig(os.path.join(directory, str('images_annotes_'+str(today.day)+'_'+str(today.month)),str(name+'.jpg'))) -- GitLab