Skip to content

Commit 0bd70bc

Browse files
committed
merge conflict fixing continued
2 parents cf1184c + bd34f48 commit 0bd70bc

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

agml/_assets/public_datasources.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,8 @@
10401040
]
10411041
}
10421042
},
1043+
=======
1044+
>>>>>>> bd34f48d69083223529321985cf3b8b353113718
10431045
"sugarbeet_weed_segmentation_europe": {
10441046
"classes": {
10451047
"1": "background",

agml/_internal/preprocess.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,18 @@ def getImages(root, files):
10101010
(0, 0, 255) : 2, # red is weed
10111011
}
10121012

1013+
for image_type in image_types:
1014+
processed_image_dir = os.path.join(processed_dir, image_type[0])
1015+
os.makedirs(processed_image_dir, exist_ok = True)
1016+
for image_path in image_type[1:]:
1017+
shutil.copyfile(image_path[0], os.path.join(processed_image_dir, image_path[1]))
1018+
1019+
color2index = {
1020+
(0, 0, 0) : 0, # black is background
1021+
(0, 255, 0) : 1, # green is sugarbeet
1022+
(0, 0, 255) : 2, # red is weed
1023+
}
1024+
10131025
for rgb_mask in rgb_masks:
10141026
rgb_mask_img = cv2.imread(rgb_mask[0])
10151027
index_mask = rgb2mask(rgb_mask_img, color2index)

0 commit comments

Comments
 (0)