Mirror official DFormer weights (DFormer-T, SUN RGB-D)

#1
by dronefreak - opened
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
+ - sunrgbd
11
+ - community-mirror
12
+ datasets:
13
+ - dronefreak/SUN-RGBD
14
+ ---
15
+
16
+ # DFormer-T trained on SUN RGB-D
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:** [SUN RGB-D](https://huggingface.co/datasets/dronefreak/SUN-RGBD) (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 (SUN RGB-D, single-scale) | 48.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
+ | `SUNRGBD_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-sunrgbd"
56
+ config = json.load(open(hf_hub_download(repo, "config.json")))
57
+ ckpt = hf_hub_download(repo, "SUNRGBD_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
+ `SUNRGBD_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.
SUNRGBD_DFormer_Tiny.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1dcd0d4112e1255fb5c30650fbf5d51ee7d16ee1866d9f58ac0090c706405af
3
+ size 72473395
config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "DFormer",
3
+ "variant": "DFormer-T",
4
+ "task": "RGB-D semantic segmentation",
5
+ "dataset": "SUN RGB-D",
6
+ "num_classes": 37,
7
+ "checkpoint": "SUNRGBD_DFormer_Tiny.pth",
8
+ "weights_key": "model",
9
+ "official_repository": "https://github.com/VCIP-RGBD/DFormer",
10
+ "source": "Google Drive folder 1b005OUO8QXzh0sJM4iykns_UdlbMNZb8",
11
+ "license": "mit",
12
+ "reported_results": {
13
+ "mIoU (SUN RGB-D, single-scale)": 48.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:745b967d17ad32fa3cdf265d201161b5819190a4bded9ce8e91337e11b83ca67
3
+ size 24100820
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