Mirror official DFormer weights (DFormer-T, NYUv2)
#1
by dronefreak - opened
- NYUv2_DFormer_Tiny.pth +3 -0
- README.md +82 -0
- config.json +16 -0
- model.safetensors +3 -0
- pretrained/DFormer_Tiny.pth.tar +3 -0
NYUv2_DFormer_Tiny.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3a717128a16a77e742e42a5c5de5fa563bcc38dce37a21ec78714ddb3445c24
|
| 3 |
+
size 72490867
|
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: image-segmentation
|
| 5 |
+
tags:
|
| 6 |
+
- rgb-d
|
| 7 |
+
- semantic-segmentation
|
| 8 |
+
- indoor-scene-understanding
|
| 9 |
+
- dformer
|
| 10 |
+
- nyuv2
|
| 11 |
+
- community-mirror
|
| 12 |
+
datasets:
|
| 13 |
+
- dronefreak/NYUv2
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# DFormer-T trained on NYUv2
|
| 17 |
+
|
| 18 |
+
> **Unofficial mirror** of the official DFormer weights from [VCIP-RGBD/DFormer](https://github.com/VCIP-RGBD/DFormer). The weights are **unchanged**; this repository adds a weights-only `model.safetensors` copy and a `config.json`.
|
| 19 |
+
|
| 20 |
+
## Model
|
| 21 |
+
|
| 22 |
+
- **Architecture:** DFormer: DFormer-T
|
| 23 |
+
- **Task:** RGB-D semantic segmentation
|
| 24 |
+
- **Trained on:** [NYUv2](https://huggingface.co/datasets/dronefreak/NYUv2) (mirror on the Hub)
|
| 25 |
+
- **Parameters:** 6.0M
|
| 26 |
+
- **Paper:** [DFormer: Rethinking RGBD Representation Learning for Semantic Segmentation](https://arxiv.org/abs/2309.09668) (ICLR 2024)
|
| 27 |
+
- **Code:** https://github.com/VCIP-RGBD/DFormer
|
| 28 |
+
- **License:** MIT (from the official repository)
|
| 29 |
+
|
| 30 |
+
RGB-D pretrained encoder (ImageNet-1K with depth) plus a lightweight decoder head. The encoder used for initialisation is included under `pretrained/` (its `.pth.tar` stores training args, so load it with `weights_only=False`).
|
| 31 |
+
|
| 32 |
+
## Results (reported by the authors)
|
| 33 |
+
|
| 34 |
+
| Metric | Value |
|
| 35 |
+
|---|---|
|
| 36 |
+
| mIoU (NYUv2, single-scale) | 51.8 |
|
| 37 |
+
|
| 38 |
+
See the [official repository](https://github.com/VCIP-RGBD/DFormer) for full tables and evaluation details.
|
| 39 |
+
|
| 40 |
+
## Files
|
| 41 |
+
|
| 42 |
+
| File | Content |
|
| 43 |
+
|---|---|
|
| 44 |
+
| `NYUv2_DFormer_Tiny.pth` | original checkpoint, exactly as released |
|
| 45 |
+
| `model.safetensors` | the model weights only (bit-exact copy of the checkpoint's `model` tensors; no optimizer state) |
|
| 46 |
+
| `config.json` | architecture, dataset, results and provenance |
|
| 47 |
+
| `pretrained/DFormer_Tiny.pth.tar` | DFormer-T encoder, RGB-D pretrained on ImageNet-1K |
|
| 48 |
+
|
| 49 |
+
## Usage
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
import json
|
| 53 |
+
from huggingface_hub import hf_hub_download
|
| 54 |
+
|
| 55 |
+
repo = "dronefreak/dformer-tiny-nyuv2"
|
| 56 |
+
config = json.load(open(hf_hub_download(repo, "config.json")))
|
| 57 |
+
ckpt = hf_hub_download(repo, "NYUv2_DFormer_Tiny.pth") # original format: use it with the official code
|
| 58 |
+
print(config["architecture"], config["dataset"], ckpt)
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
Build the network with the official code (https://github.com/VCIP-RGBD/DFormer) using the matching config for this variant, then load
|
| 62 |
+
`NYUv2_DFormer_Tiny.pth` exactly as you would the original download, or load `model.safetensors` with
|
| 63 |
+
`safetensors.torch.load_file` into the same model.
|
| 64 |
+
|
| 65 |
+
## Citation
|
| 66 |
+
|
| 67 |
+
If you use these weights, please cite the original work:
|
| 68 |
+
|
| 69 |
+
```bibtex
|
| 70 |
+
@inproceedings{yin2024dformer,
|
| 71 |
+
title = {DFormer: Rethinking RGBD Representation Learning for Semantic Segmentation},
|
| 72 |
+
author = {Yin, Bowen and Zhang, Xuying and Li, Zhong-Yu and Liu, Li and Cheng, Ming-Ming and Hou, Qibin},
|
| 73 |
+
booktitle = {ICLR},
|
| 74 |
+
year = {2024}
|
| 75 |
+
}
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
## Disclaimer
|
| 79 |
+
|
| 80 |
+
This is not an official release. All credit goes to the original authors (Bowen Yin, Xuying Zhang, Zhong-Yu Li, Li Liu, Ming-Ming Cheng, Qibin Hou; Nankai University (VCIP)). The weights are
|
| 81 |
+
redistributed under the MIT license of the official repository. If you are an author and want this mirror changed or
|
| 82 |
+
removed, please open a discussion.
|
config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architecture": "DFormer",
|
| 3 |
+
"variant": "DFormer-T",
|
| 4 |
+
"task": "RGB-D semantic segmentation",
|
| 5 |
+
"dataset": "NYUv2",
|
| 6 |
+
"num_classes": 40,
|
| 7 |
+
"checkpoint": "NYUv2_DFormer_Tiny.pth",
|
| 8 |
+
"weights_key": "model",
|
| 9 |
+
"official_repository": "https://github.com/VCIP-RGBD/DFormer",
|
| 10 |
+
"source": "Google Drive folder 1P5HwnAvifEI6xiTAx6id24FUCt_i7GH8",
|
| 11 |
+
"license": "mit",
|
| 12 |
+
"reported_results": {
|
| 13 |
+
"mIoU (NYUv2, single-scale)": 51.8
|
| 14 |
+
},
|
| 15 |
+
"paper": "https://arxiv.org/abs/2309.09668"
|
| 16 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49218096732254f5c8b78e3bdd49a6ecef2f3623d9e330423b114cc83aeafd7b
|
| 3 |
+
size 24106976
|
pretrained/DFormer_Tiny.pth.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f5c0bb9771150373ab4b9178f1623cce5574d9afa1039ccd01828cfa9272d5d
|
| 3 |
+
size 67415939
|