ONNX export of cm93/resnet50-eurosat, a ResNet-50 model fine-tuned on the EuroSAT satellite imagery dataset for land-use and land-cover (LULC) classification.
Model source
Source description
ONNX export of cm93/resnet50-eurosat, a ResNet-50 model fine-tuned on the EuroSAT satellite imagery dataset for land-use and land-cover (LULC) classification.
Sources
1 sourceVerified Sep 10
Model artifacts
1 artifactSource excerpts
2 excerpts| Property | Value |
|---|
| Architecture | ResNet-50 (ImageNet-1k pretrained) |
| Task | Image Classification |
| Classes | 10 |
| Format | ONNX |
| Source model | cm93/resnet50-eurosat |
| Source library | timm |
| License | MIT |
| Index | Label |
|---|---|
| 0 | AnnualCrop |
| 1 | Forest |
| 2 | HerbaceousVegetation |
| 3 | Highway |
| 4 | Industrial |
| 5 | Pasture |
| 6 | PermanentCrop |
| 7 | Residential |
| 8 | River |
| 9 | SeaLake |
Note: Index order reflects
id2labelfrom the source model config. Always load it viaAutoConfig.from_pretrained("cm93/resnet50-eurosat")rather than assuming alphabetical order.
Evaluated on the cm93/eurosat test split. Preprocessing applied using the source model's TimmWrapperImageProcessor via AutoImageProcessor.from_pretrained("cm93/resnet50-eurosat").
| Metric | Score |
|---|---|
| Accuracy | 0.9670 |
| Precision (macro) | 0.9662 |
| Recall (macro) | 0.9669 |
| F1 (macro) | 0.9662 |
Source model reported metrics (from cm93/resnet50-eurosat):
| Split | Accuracy | F1 |
|---|---|---|
| Train | 0.9756 | — |
| Validation | 0.9830 | — |
| Test | 0.9807 | 0.9807 |
pip install onnxruntime huggingface_hub transformers
import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
from transformers import AutoImageProcessor, AutoConfig
from PIL import Image
# Load ONNX session
model_path = hf_hub_download("krylox/resnet50-eurosat-onnx", filename="model.onnx")
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
# Load processor and label map from the source model
processor = AutoImageProcessor.from_pretrained("cm93/resnet50-eurosat")
id2label = AutoConfig.from_pretrained("cm93/resnet50-eurosat").id2label
# Preprocess and infer
image = Image.open("your_image.jpg").convert("RGB")
pixel_values = processor(images=image, return_tensors="pt")["pixel_values"].numpy().astype(np.float32)
input_name = session.get_inputs()[0].name
output_name = session.get_outputs()[0].name
logits = session.run([output_name], {input_name: pixel_values})[0]
predicted_label = id2label[int(np.argmax(logits, axis=1)[0])]
print(f"Predicted class: {predicted_label}")
Important: Use
AutoImageProcessor.from_pretrained("cm93/resnet50-eurosat")for preprocessing — the source model usesTimmWrapperImageProcessor, which may differ from standard ImageNet normalization. Using hardcoded stats will degrade accuracy significantly.
| Parameter | Value |
|---|---|
| Base weights | ResNet-50 pretrained on ImageNet-1k |
| Optimizer | AdamW (β1=0.9, β2=0.999) |
| Learning rate | 3e-5 |
| Weight decay | 0.01 |
| Batch size | 64 |
| Scheduler | PolynomialLR |
| Loss | CrossEntropyLoss |
| Epochs | 20 |
| Augmentation | RandomHorizontalFlip, RandomVerticalFlip |
| Preprocessing | Resize → CenterCrop → Normalize |
The source model was trained on EuroSAT, which contains 27,000 labeled, geo-referenced Sentinel-2 satellite image patches (JPEG, 64×64 px) across 10 LULC classes.
--- license: mit library_name: onnx base_model: cm93/resnet50-eurosat datasets: - cm93/eurosat pipeline_tag: image-classification tags: - onnx - resnet50 - timm - remote-sensing - satellite-imagery - eurosat - image-classification model-index: - name: resnet50-eurosat-onnx results: - task: type: image-classification dataset: name: EuroSAT type: cm93/eurosat split: test metrics: - name: Accuracy type: accuracy value: 0.9670 - name: Precision (macro) type: precision value: 0.9662 - name: Recall (macro) type: recall value: 0.9669 - name: F1 (macro) type: f1 value: 0.9662 --- # ResNet-50 EuroSAT — ONNX Export ONNX export of [cm93/resnet50-eurosat](https://huggingface.co/cm93/resnet50-eurosat), a ResNet-50 model fine-tuned on the [EuroSAT](https://huggingface.co/datasets/cm93/eurosat) satellite imagery dataset for land-use and land-cover (LULC) classification. ## Model Details | Property | Value | |---|---| | Architecture | ResNet-50 (ImageNet-1k pretrained) | | Task | Image Classification | | Classes | 10 | | Format | ONNX | | Source model | [cm93/resnet50-eurosat](https://huggingface.co/cm93/resnet50-eurosat) | | Source library | timm | | License | MIT | ### Classes | Index | Label | |---|---| | 0 | AnnualCrop | | 1 | Forest | | 2 | HerbaceousVegetation | | 3 | Highway | | 4 | Industrial | | 5 | Pasture | | 6 | PermanentCrop | | 7 | Residential | | 8 | River | | 9 | SeaLake | > **Note:** Index order reflects `id2label` from the source model config. Always load it via `AutoConfig.from_pretrained("cm93/resnet50-eurosat")` rather than assuming alphabetical order. ## Evaluation Results Evaluated on the `cm93/eurosat` test split. Preprocessing applied using the source model's `TimmWrapperImageProcessor` via `AutoImageProcessor.from_pretrained("cm93/resnet50-eurosat")`. | Metric | Score | |---|---| | Accuracy | **0.9670** | | Precision (macro) | 0.9662 | | Recall (macro) | 0.9669 | | F1 (macro) | 0.9662 | Source model reported metrics (from [cm93/resnet50-eurosat](https://huggingface.co/cm93/resnet50-eurosat)): | Split | Accuracy | F1 | |---|---|---| | Train | 0.9756 | — | | Validation | 0.9830 | — | | Test | 0.9807 | 0.9807 | ## Usage ### Installation ```bash pip install onnxruntime huggingface_hub transformers ``` ### Inference ```python import numpy as np import onnxruntime as ort from huggingface_hub import hf_hub_...
Source context: 8 downloads · 0 likes · Pipeline image-classification · Library onnx · Repo krylox/resnet50-eurosat-onnx