Downloads · 30 days
29
5% of all-time downloads
isaaccorley/unet_resnet50_oam_rgb_tcd
unet_resnet50_oam_rgb_tcd is a machine learning model from isaaccorley. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for torchgeo. The card lists the license as cc-by-nc-4.0.
Binary Segmentation U-Net ResNet-50 model for tree segmentation in OpenAerialMap high-resolution aerial imagery. The model is trained on a mix of CC-BY and CC-BY-NC licensed aerial imagery.
Downloads · 30 days
29
5% of all-time downloads
All-time downloads
531
Public
Repo size
130 MB
Likes
0
Public
Click a slice to open those files.
.pth130 MB · 100%
From the Hugging Face model README
Binary Segmentation U-Net ResNet-50 model for tree segmentation in OpenAerialMap high-resolution aerial imagery. The model is trained on a mix of CC-BY and CC-BY-NC licensed aerial imagery.
See for details: github.com/restor-foundation/tcd
Model weights extracted below:
import os
import hashlib
import torch
import segmentation_models_pytorch as smp
url = "https://huggingface.co/restor/tcd-unet-r50/resolve/main/model.pt"
state_dict = torch.hub.load_state_dict_from_url(url, weights_only=False, map_location="cpu")
model = smp.Unet(
encoder_name="resnet50",
encoder_weights=None,
in_channels=3,
classes=2,
)
model.load_state_dict(state_dict, strict=True)
filename = "unet_resnet50_oam_rgb_tcd.pth"
torch.save(model.state_dict(), filename)
md5 = hashlib.md5(open(filename, "rb").read()).hexdigest()[:8]
os.rename(filename, filename.replace(".pth", f"-{md5}.pth"))