Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image segmentation module #6

Merged
merged 4 commits into from
Jul 27, 2024
Merged

Add image segmentation module #6

merged 4 commits into from
Jul 27, 2024

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Jul 27, 2024

images_dir = "../datasets/Water-Bodies-Dataset/Images"
masks_dir = "../datasets/Water-Bodies-Dataset/Masks"
transform = get_transform()
train_dataset, val_dataset = prepare_datasets(images_dir, masks_dir, transform)

model_save_path = "./fine_tuned_model"
train_model(train_dataset, val_dataset, model_save_path)

image_path = "../datasets/Water-Bodies-Dataset/Images/water_body_44.jpg"
reference_image_path = image_path.replace("Images", "Masks")
segmented_mask = segment_image(image_path, model_save_path)

visualize_predictions(image_path, segmented_mask, reference_image_path=reference_image_path)

Copy link

github-actions bot commented Jul 27, 2024

@github-actions github-actions bot temporarily deployed to pull request July 27, 2024 16:39 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 27, 2024 16:47 Inactive
@giswqs giswqs merged commit da2e1c8 into main Jul 27, 2024
9 checks passed
@giswqs giswqs deleted the segmentation branch July 27, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant