Made some changes

This commit is contained in:
Nazar Sturanec
2024-05-23 17:27:36 +03:00
parent c1d30d024d
commit 8529bd0c6f
2 changed files with 70 additions and 2 deletions
+1 -2
View File
@@ -42,7 +42,6 @@ def image_processing(img_ann: ImageAnnotation) -> [ImageAnnotation]:
transform = A.Compose([
A.HorizontalFlip(p=0.5),
A.RandomBrightnessContrast(p=0.2),
A.ShiftScaleRotate(shift_limit=0.1, scale_limit=0.2, rotate_limit=15, p=0.5),
], bbox_params=A.BboxParams(format='yolo', label_fields=['category_ids']))
bboxes = bboxes
@@ -56,7 +55,7 @@ def image_processing(img_ann: ImageAnnotation) -> [ImageAnnotation]:
return transformed_image, transformed_bboxes, transformed_category_ids
def write_results(img_ann: ImageAnnotation):
for i in range(10):
for i in range(100):
transformed_image, transformed_bboxes, transformed_category_ids, = image_processing(img_ann)
cv2.imwrite(os.path.join(current_dataset_dir, images_dir, str(i)+ImageAnnotation(img_ann).image_path + '.jpg'), transformed_image)
with open(os.path.join(current_dataset_dir, labels_dir, str(i)+ImageAnnotation(img_ann).image_path + '.txt'), 'w') as f: