Upload 10 files
Browse files- README.md +12 -3
- config.json +20 -0
- onnx/prompt_encoder_mask_decoder.onnx +3 -0
- onnx/prompt_encoder_mask_decoder_fp16.onnx +3 -0
- onnx/prompt_encoder_mask_decoder_quantized.onnx +3 -0
- onnx/vision_encoder.onnx +3 -0
- onnx/vision_encoder_fp16.onnx +3 -0
- onnx/vision_encoder_quantized.onnx +3 -0
- preprocessor_config.json +28 -0
- quantize_config.json +82 -0
README.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers.js
|
3 |
+
---
|
4 |
+
|
5 |
+
https://huggingface.co/suredream/openboundary with ONNX weights to be compatible with Transformers.js.
|
6 |
+
|
7 |
+
## Usage (Transformers.js)
|
8 |
+
|
9 |
+
If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@xenova/transformers) using:
|
10 |
+
```bash
|
11 |
+
npm i @xenova/transformers
|
12 |
+
```
|
config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "nielsr/slimsam-77-uniform",
|
3 |
+
"architectures": [
|
4 |
+
"SamModel"
|
5 |
+
],
|
6 |
+
"initializer_range": 0.02,
|
7 |
+
"mask_decoder_config": {
|
8 |
+
"model_type": ""
|
9 |
+
},
|
10 |
+
"model_type": "sam",
|
11 |
+
"prompt_encoder_config": {
|
12 |
+
"model_type": ""
|
13 |
+
},
|
14 |
+
"transformers_version": "4.36.2",
|
15 |
+
"vision_config": {
|
16 |
+
"hidden_size": 168,
|
17 |
+
"mlp_dim": 696,
|
18 |
+
"model_type": ""
|
19 |
+
}
|
20 |
+
}
|
onnx/prompt_encoder_mask_decoder.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f4514391764fbd56e08e119060d874ecd7d52994bfb1968af159e12d4943b5bb
|
3 |
+
size 16557892
|
onnx/prompt_encoder_mask_decoder_fp16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df24d49a6f1a5dc0dbbecd84ca0fff9f14c76e63b81fd35c2b92c1321b007f71
|
3 |
+
size 8550118
|
onnx/prompt_encoder_mask_decoder_quantized.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cb90b279f549d2cab7fd6e20c38522438c65d84bdcca3d2a764cff7d857fdce2
|
3 |
+
size 4903810
|
onnx/vision_encoder.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f8433273a6750b587779baa0cf5508111001bf7e7acfcf585d370139fd366d0
|
3 |
+
size 23276014
|
onnx/vision_encoder_fp16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:11aaeb49c75e7b3f4cbf8a32c2c819406520c6b3affb4068ff474b2240c8aa38
|
3 |
+
size 12170657
|
onnx/vision_encoder_quantized.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cce23c7b2e5d4f330932738fb67ba518e04b0d99ccdd1cccd22a7da4e01f2971
|
3 |
+
size 8882165
|
preprocessor_config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_convert_rgb": true,
|
3 |
+
"do_normalize": true,
|
4 |
+
"do_pad": true,
|
5 |
+
"do_rescale": true,
|
6 |
+
"do_resize": true,
|
7 |
+
"image_mean": [
|
8 |
+
0.485,
|
9 |
+
0.456,
|
10 |
+
0.406
|
11 |
+
],
|
12 |
+
"image_processor_type": "SamImageProcessor",
|
13 |
+
"image_std": [
|
14 |
+
0.229,
|
15 |
+
0.224,
|
16 |
+
0.225
|
17 |
+
],
|
18 |
+
"pad_size": {
|
19 |
+
"height": 1024,
|
20 |
+
"width": 1024
|
21 |
+
},
|
22 |
+
"processor_class": "SamProcessor",
|
23 |
+
"resample": 2,
|
24 |
+
"rescale_factor": 0.00392156862745098,
|
25 |
+
"size": {
|
26 |
+
"longest_edge": 1024
|
27 |
+
}
|
28 |
+
}
|
quantize_config.json
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"per_channel": true,
|
3 |
+
"reduce_range": true,
|
4 |
+
"per_model_config": {
|
5 |
+
"prompt_encoder_mask_decoder": {
|
6 |
+
"op_types": [
|
7 |
+
"Gather",
|
8 |
+
"Sin",
|
9 |
+
"Unsqueeze",
|
10 |
+
"Not",
|
11 |
+
"Cast",
|
12 |
+
"Equal",
|
13 |
+
"Neg",
|
14 |
+
"MatMul",
|
15 |
+
"Cos",
|
16 |
+
"OneHot",
|
17 |
+
"Transpose",
|
18 |
+
"Sub",
|
19 |
+
"Where",
|
20 |
+
"Erf",
|
21 |
+
"ConstantOfShape",
|
22 |
+
"ReduceMean",
|
23 |
+
"Shape",
|
24 |
+
"Range",
|
25 |
+
"Expand",
|
26 |
+
"Div",
|
27 |
+
"Relu",
|
28 |
+
"ConvTranspose",
|
29 |
+
"Tile",
|
30 |
+
"Concat",
|
31 |
+
"ScatterND",
|
32 |
+
"Sqrt",
|
33 |
+
"Slice",
|
34 |
+
"Mul",
|
35 |
+
"Constant",
|
36 |
+
"Pow",
|
37 |
+
"Reshape",
|
38 |
+
"Add",
|
39 |
+
"Softmax"
|
40 |
+
],
|
41 |
+
"weight_type": "QInt8"
|
42 |
+
},
|
43 |
+
"vision_encoder": {
|
44 |
+
"op_types": [
|
45 |
+
"Gather",
|
46 |
+
"Sin",
|
47 |
+
"Unsqueeze",
|
48 |
+
"Cast",
|
49 |
+
"MatMul",
|
50 |
+
"Cos",
|
51 |
+
"Transpose",
|
52 |
+
"Sub",
|
53 |
+
"Pad",
|
54 |
+
"Erf",
|
55 |
+
"Conv",
|
56 |
+
"ConstantOfShape",
|
57 |
+
"Resize",
|
58 |
+
"ReduceMean",
|
59 |
+
"Shape",
|
60 |
+
"Range",
|
61 |
+
"Expand",
|
62 |
+
"Div",
|
63 |
+
"Tile",
|
64 |
+
"Mod",
|
65 |
+
"Squeeze",
|
66 |
+
"Concat",
|
67 |
+
"Sqrt",
|
68 |
+
"Split",
|
69 |
+
"Mul",
|
70 |
+
"Slice",
|
71 |
+
"Identity",
|
72 |
+
"Constant",
|
73 |
+
"Pow",
|
74 |
+
"Einsum",
|
75 |
+
"Reshape",
|
76 |
+
"Add",
|
77 |
+
"Softmax"
|
78 |
+
],
|
79 |
+
"weight_type": "QUInt8"
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|