Instructions to use torchgeo/earthloc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TorchGeo
How to use torchgeo/earthloc with TorchGeo:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Model Weights extracted below:
import os
import hashlib
import torch
from model import EarthLoc
# Download the model checkpoint using the following command:
# rsync -rhz rsync://vandaldata.polito.it/sf_xl/EarthLoc/data/best_trained_model.pt .
path = "best_trained_model.pt"
model = EarthLoc(image_size=320, desc_dim=4096)
state_dict = torch.load(path, weights_only=True, map_location="cpu")
state_dict = {k.replace("backbone.model.", "backbone."): v for k, v in state_dict.items()}
model.load_state_dict(state_dict, strict=True)
filename = "earthloc.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"))
- Downloads last month
- 2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support