My project on image segmentation for tile spalling detection at NTUCE CAE Division / NCREE Internship.
The aim is to provide a image segmentation mask for tile spalling of building exterior. We use U-Net, a Deep Learning-based model architecture for the job.
![](https://private-user-images.githubusercontent.com/5615415/266555726-92627bf5-0ecd-4263-8bde-2249b36b409d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjI3OTMsIm5iZiI6MTczOTU2MjQ5MywicGF0aCI6Ii81NjE1NDE1LzI2NjU1NTcyNi05MjYyN2JmNS0wZWNkLTQyNjMtOGJkZS0yMjQ5YjM2YjQwOWQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMTk0ODEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDY2N2EyNzMwODljNjNjZGJhODg1NTkxZTJhNWM0NWVkMGRhMmViMGMwZWJkOTQ5MjFkYzNiODA0MzZjM2VlZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.9L_fNrhyZ_9WJDi0dPAMgcFr3loFwZz10X1gidJ0QWI)
- myunet.py: The code for the altered model architecture. It is modified from segmentation-models-pytorch.
- auto_evaluate.py: A script to automate the evaluation of trained models using testing data.
- Unet-efficientnet-b6-CrossEntropyLoss-4.pt: A sample of the model trained by us. You can check its prediction result by the following sample code:
def predict_image_mask_miou(model, image, mask, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]):
model.eval()
t = T.Compose([T.ToTensor(), T.Normalize(mean, std)])
image = t(image)
model.to(device); image=image.to(device)
mask = mask.to(device)
with torch.no_grad():
image = image.unsqueeze(0)
mask = mask.unsqueeze(0)
output = model(image)
masked = torch.argmax(output, dim=1)
masked = masked.cpu().squeeze(0)
return masked
Some base code here has originated from tanishqgautam/Drone-Image-Semantic-Segmentation.