Skip to content

Commit

Permalink
merge conflict fixing continued
Browse files Browse the repository at this point in the history
  • Loading branch information
amogh7joshi committed Aug 20, 2022
2 parents cf1184c + bd34f48 commit 0bd70bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agml/_assets/public_datasources.json
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,8 @@
]
}
},
=======
>>>>>>> bd34f48d69083223529321985cf3b8b353113718
"sugarbeet_weed_segmentation_europe": {
"classes": {
"1": "background",
Expand Down
12 changes: 12 additions & 0 deletions agml/_internal/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,18 @@ def getImages(root, files):
(0, 0, 255) : 2, # red is weed
}

for image_type in image_types:
processed_image_dir = os.path.join(processed_dir, image_type[0])
os.makedirs(processed_image_dir, exist_ok = True)
for image_path in image_type[1:]:
shutil.copyfile(image_path[0], os.path.join(processed_image_dir, image_path[1]))

color2index = {
(0, 0, 0) : 0, # black is background
(0, 255, 0) : 1, # green is sugarbeet
(0, 0, 255) : 2, # red is weed
}

for rgb_mask in rgb_masks:
rgb_mask_img = cv2.imread(rgb_mask[0])
index_mask = rgb2mask(rgb_mask_img, color2index)
Expand Down

0 comments on commit 0bd70bc

Please sign in to comment.