Xuban commited on
Commit
fedf2ee
·
verified ·
1 Parent(s): 4c17487

Add LibreSegformer ADE20K weights (non-commercial, NVIDIA Source Code License)

Browse files
Files changed (5) hide show
  1. .gitattributes +35 -35
  2. LICENSE +64 -0
  3. LibreSegformerb0-sem.pt +3 -0
  4. NOTICE +30 -0
  5. README.md +75 -0
.gitattributes CHANGED
@@ -1,35 +1,35 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NVIDIA Source Code License for SegFormer
2
+
3
+ 1. Definitions
4
+
5
+ “Licensor” means any person or entity that distributes its Work.
6
+
7
+ “Software” means the original work of authorship made available under this License.
8
+
9
+ “Work” means the Software and any additions to or derivative works of the Software that are made available under
10
+ this License.
11
+
12
+ The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the meaning as provided under
13
+ U.S. copyright law; provided, however, that for the purposes of this License, derivative works shall not include
14
+ works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work.
15
+
16
+ Works, including the Software, are “made available” under this License by including in or with the Work either
17
+ (a) a copyright notice referencing the applicability of this License to the Work, or (b) a copy of this License.
18
+
19
+ 2. License Grant
20
+
21
+ 2.1 Copyright Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual,
22
+ worldwide, non-exclusive, royalty-free, copyright license to reproduce, prepare derivative works of, publicly
23
+ display, publicly perform, sublicense and distribute its Work and any resulting derivative works in any form.
24
+
25
+ 3. Limitations
26
+
27
+ 3.1 Redistribution. You may reproduce or distribute the Work only if (a) you do so under this License, (b) you
28
+ include a complete copy of this License with your distribution, and (c) you retain without modification any
29
+ copyright, patent, trademark, or attribution notices that are present in the Work.
30
+
31
+ 3.2 Derivative Works. You may specify that additional or different terms apply to the use, reproduction, and
32
+ distribution of your derivative works of the Work (“Your Terms”) only if (a) Your Terms provide that the use
33
+ limitation in Section 3.3 applies to your derivative works, and (b) you identify the specific derivative works
34
+ that are subject to Your Terms. Notwithstanding Your Terms, this License (including the redistribution
35
+ requirements in Section 3.1) will continue to apply to the Work itself.
36
+
37
+ 3.3 Use Limitation. The Work and any derivative works thereof only may be used or intended for use
38
+ non-commercially. Notwithstanding the foregoing, NVIDIA and its affiliates may use the Work and any derivative
39
+ works commercially. As used herein, “non-commercially” means for research or evaluation purposes only.
40
+
41
+ 3.4 Patent Claims. If you bring or threaten to bring a patent claim against any Licensor (including any claim,
42
+ cross-claim or counterclaim in a lawsuit) to enforce any patents that you allege are infringed by any Work, then
43
+ your rights under this License from such Licensor (including the grant in Section 2.1) will terminate immediately.
44
+
45
+ 3.5 Trademarks. This License does not grant any rights to use any Licensor’s or its affiliates’ names, logos,
46
+ or trademarks, except as necessary to reproduce the notices described in this License.
47
+
48
+ 3.6 Termination. If you violate any term of this License, then your rights under this License (including the
49
+ grant in Section 2.1) will terminate immediately.
50
+
51
+ 4. Disclaimer of Warranty.
52
+
53
+ THE WORK IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
54
+ WARRANTIES OR CONDITIONS OF M ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT. YOU
55
+ BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER THIS LICENSE.
56
+
57
+ 5. Limitation of Liability.
58
+
59
+ EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING
60
+ NEGLIGENCE), CONTRACT, OR OTHERWISE SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
61
+ INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS LICENSE, THE USE OR
62
+ INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR
63
+ DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER COMM ERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN
64
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
LibreSegformerb0-sem.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37a5915c12d5b9feb36eed7f7b4711e51bbfe4ea69d2b62a2725d3c11e6d1bbf
3
+ size 15086397
NOTICE ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ LibreSegformer weights
2
+ ----------------------
3
+
4
+ These weights are derived from NVIDIA's SegFormer release
5
+ (https://github.com/NVlabs/SegFormer), specifically the checkpoint
6
+ published at https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512.
7
+ Copyright (c) 2021, NVIDIA Corporation & affiliates. All rights reserved.
8
+
9
+ Licensed under the NVIDIA Source Code License for SegFormer. A complete copy
10
+ of that license is included in this repository as LICENSE. The license permits
11
+ redistribution of the work and of derivative works, provided the license
12
+ travels with them and attribution notices are retained, but it LIMITS USE TO
13
+ NON-COMMERCIAL PURPOSES ("research or evaluation purposes only", Section 3.3),
14
+ and Section 3.2 carries that limitation forward into every derivative work.
15
+
16
+ These weights are therefore NON-COMMERCIAL ONLY. They are NOT covered by
17
+ LibreYOLO's permissive license.
18
+
19
+ Modification: state-dict key remapping only (the upstream `segformer.` encoder
20
+ prefix becomes `encoder.`), plus LibreYOLO checkpoint metadata. Learned
21
+ parameters are NVIDIA's, unchanged; the converted checkpoint reproduces
22
+ upstream logits bit-exactly.
23
+
24
+ The model was fine-tuned on ADE20K (scene parsing, 150 classes), whose own
25
+ image terms restrict use to non-commercial research and education.
26
+
27
+ Citation:
28
+ Xie, E., Wang, W., Yu, Z., Anandkumar, A., Alvarez, J. M., and Luo, P.
29
+ "SegFormer: Simple and Efficient Design for Semantic Segmentation with
30
+ Transformers." NeurIPS 2021.
README.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: nvidia-source-code-license-segformer
4
+ license_link: https://github.com/NVlabs/SegFormer/blob/master/LICENSE
5
+ library_name: libreyolo
6
+ pipeline_tag: image-segmentation
7
+ datasets:
8
+ - scene_parse_150
9
+ tags:
10
+ - semantic-segmentation
11
+ - segformer
12
+ - ade20k
13
+ - non-commercial
14
+ ---
15
+
16
+ # LibreSegformerb0-sem
17
+
18
+ SegFormer MiT-b0 (3.8M params) with the all-MLP decode head, fine-tuned on
19
+ ADE20K (150 classes) at 512x512, repackaged for
20
+ [LibreYOLO](https://github.com/LibreYOLO/libreyolo).
21
+
22
+ > ## ⚠️ NON-COMMERCIAL WEIGHTS
23
+ >
24
+ > These weights are **not** covered by LibreYOLO's permissive license. They
25
+ > derive from NVIDIA's SegFormer release, licensed under the
26
+ > [NVIDIA Source Code License](https://github.com/NVlabs/SegFormer/blob/master/LICENSE),
27
+ > which restricts **use** to **non-commercial research or evaluation purposes
28
+ > only** (Section 3.3). That restriction is carried into every derivative work
29
+ > (Section 3.2) and it binds you, the downloader, not just LibreYOLO.
30
+ >
31
+ > The LibreYOLO **code** and the SegFormer **architecture** are unrestricted, as
32
+ > is any model you train from scratch with them. Only these pretrained weights
33
+ > are limited. For commercial use, train from scratch:
34
+ > `LibreSegformer(size="b0", nb_classes=N).train(data="your.yaml")`.
35
+
36
+ ## Usage
37
+
38
+ ```python
39
+ from libreyolo import LibreSegformer
40
+
41
+ model = LibreSegformer("LibreSegformerb0-sem.pt")
42
+ results = model.predict("image.jpg")
43
+ mask = results[0].semantic_mask # dense 150-class ADE20K mask
44
+ ```
45
+
46
+ ## Source
47
+
48
+ Converted from [nvidia/segformer-b0-finetuned-ade-512-512](https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512).
49
+ Copyright (c) 2021, NVIDIA Corporation & affiliates.
50
+ Licensed under the NVIDIA Source Code License for SegFormer.
51
+
52
+ Architecture from "SegFormer: Simple and Efficient Design for Semantic
53
+ Segmentation with Transformers" (Xie et al., NeurIPS 2021). LibreYOLO's
54
+ implementation is an independent port of the Apache-2.0 reference in
55
+ HuggingFace Transformers, with no runtime dependency on it.
56
+
57
+ ## Modifications
58
+
59
+ State-dict key remapping only (upstream `segformer.` encoder prefix becomes
60
+ `encoder.`), plus LibreYOLO checkpoint metadata. Learned parameters are
61
+ unchanged: the converted checkpoint reproduces upstream logits **bit-exactly**
62
+ (max abs difference 0.0 in float64). See
63
+ [`weights/convert_segformer_weights.py`](https://github.com/LibreYOLO/libreyolo/blob/dev/weights/convert_segformer_weights.py).
64
+
65
+ ## Accuracy
66
+
67
+ Single-scale ADE20K val mIoU as reported by the SegFormer authors for this
68
+ checkpoint: **37.4**. Numbers are the upstream authors', measured with their
69
+ evaluation protocol; LibreYOLO's `val` uses a fixed-canvas letterbox and will
70
+ not reproduce them exactly.
71
+
72
+ ## License
73
+
74
+ NVIDIA Source Code License for SegFormer (**non-commercial**). See
75
+ [`LICENSE`](./LICENSE) and [`NOTICE`](./NOTICE).