mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 08:36:34 +00:00
Made some changes
This commit is contained in:
+1
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user