Instructions to use facebook/sapiens2-seg-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sapiens2
How to use facebook/sapiens2-seg-1b with sapiens2:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- sapiens
How to use facebook/sapiens2-seg-1b with sapiens:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Transformers
How to use facebook/sapiens2-seg-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="facebook/sapiens2-seg-1b")# Load model directly from transformers import AutoImageProcessor, Sapiens2ForSemanticSegmentation processor = AutoImageProcessor.from_pretrained("facebook/sapiens2-seg-1b") model = Sapiens2ForSemanticSegmentation.from_pretrained("facebook/sapiens2-seg-1b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "Sapiens2ForSemanticSegmentation" | |
| ], | |
| "attention_dropout": 0.0, | |
| "drop_path_rate": 0.0, | |
| "flip_pairs": null, | |
| "head_config": { | |
| "_name_or_path": "", | |
| "architectures": null, | |
| "chunk_size_feed_forward": 0, | |
| "conv_kernel_size": 1, | |
| "conv_kernel_sizes": [ | |
| 1, | |
| 1 | |
| ], | |
| "conv_out_channels": [ | |
| 64, | |
| 64 | |
| ], | |
| "dtype": null, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "model_type": "sapiens2_head", | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "problem_type": null, | |
| "return_dict": true, | |
| "scale_conv_kernel_size": 1, | |
| "scale_conv_kernel_sizes": null, | |
| "scale_conv_out_channels": null, | |
| "scale_final_hidden_sizes": null, | |
| "scale_final_input_size": null, | |
| "upsample_kernel_size": 4, | |
| "upsample_kernel_sizes": [ | |
| 4, | |
| 4, | |
| 4, | |
| 4 | |
| ], | |
| "upsample_out_channels": [ | |
| 512, | |
| 256, | |
| 128, | |
| 64 | |
| ], | |
| "use_pixel_shuffle": null | |
| }, | |
| "hidden_act": "silu", | |
| "hidden_size": 1536, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1", | |
| "2": "LABEL_2", | |
| "3": "LABEL_3", | |
| "4": "LABEL_4", | |
| "5": "LABEL_5", | |
| "6": "LABEL_6", | |
| "7": "LABEL_7", | |
| "8": "LABEL_8", | |
| "9": "LABEL_9", | |
| "10": "LABEL_10", | |
| "11": "LABEL_11", | |
| "12": "LABEL_12", | |
| "13": "LABEL_13", | |
| "14": "LABEL_14", | |
| "15": "LABEL_15", | |
| "16": "LABEL_16", | |
| "17": "LABEL_17", | |
| "18": "LABEL_18", | |
| "19": "LABEL_19", | |
| "20": "LABEL_20", | |
| "21": "LABEL_21", | |
| "22": "LABEL_22", | |
| "23": "LABEL_23", | |
| "24": "LABEL_24", | |
| "25": "LABEL_25", | |
| "26": "LABEL_26", | |
| "27": "LABEL_27", | |
| "28": "LABEL_28" | |
| }, | |
| "image_size": [ | |
| 1024, | |
| 768 | |
| ], | |
| "initializer_range": 0.02, | |
| "intermediate_size": 6144, | |
| "key_bias": true, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1, | |
| "LABEL_10": 10, | |
| "LABEL_11": 11, | |
| "LABEL_12": 12, | |
| "LABEL_13": 13, | |
| "LABEL_14": 14, | |
| "LABEL_15": 15, | |
| "LABEL_16": 16, | |
| "LABEL_17": 17, | |
| "LABEL_18": 18, | |
| "LABEL_19": 19, | |
| "LABEL_2": 2, | |
| "LABEL_20": 20, | |
| "LABEL_21": 21, | |
| "LABEL_22": 22, | |
| "LABEL_23": 23, | |
| "LABEL_24": 24, | |
| "LABEL_25": 25, | |
| "LABEL_26": 26, | |
| "LABEL_27": 27, | |
| "LABEL_28": 28, | |
| "LABEL_3": 3, | |
| "LABEL_4": 4, | |
| "LABEL_5": 5, | |
| "LABEL_6": 6, | |
| "LABEL_7": 7, | |
| "LABEL_8": 8, | |
| "LABEL_9": 9 | |
| }, | |
| "layerscale_value": 1.0, | |
| "mlp_bias": true, | |
| "model_type": "sapiens2", | |
| "normalize_backbone_outputs": true, | |
| "num_attention_heads": 24, | |
| "num_channels": 3, | |
| "num_first_full_attention_layers": 8, | |
| "num_hidden_layers": 40, | |
| "num_key_value_attention_heads": 12, | |
| "num_key_value_heads_per_layer": [ | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 12, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24, | |
| 24 | |
| ], | |
| "num_last_full_attention_layers": 8, | |
| "num_register_tokens": 8, | |
| "out_features": [ | |
| "stage40" | |
| ], | |
| "out_indices": [ | |
| 40 | |
| ], | |
| "patch_size": 16, | |
| "pos_embed_jitter": null, | |
| "pos_embed_rescale": 2.0, | |
| "pos_embed_shift": null, | |
| "proj_bias": true, | |
| "query_bias": true, | |
| "reshape_hidden_states": true, | |
| "rms_norm_eps": 1e-06, | |
| "rope_theta": 100.0, | |
| "semantic_loss_ignore_index": 255, | |
| "stage_names": [ | |
| "stem", | |
| "stage1", | |
| "stage2", | |
| "stage3", | |
| "stage4", | |
| "stage5", | |
| "stage6", | |
| "stage7", | |
| "stage8", | |
| "stage9", | |
| "stage10", | |
| "stage11", | |
| "stage12", | |
| "stage13", | |
| "stage14", | |
| "stage15", | |
| "stage16", | |
| "stage17", | |
| "stage18", | |
| "stage19", | |
| "stage20", | |
| "stage21", | |
| "stage22", | |
| "stage23", | |
| "stage24", | |
| "stage25", | |
| "stage26", | |
| "stage27", | |
| "stage28", | |
| "stage29", | |
| "stage30", | |
| "stage31", | |
| "stage32", | |
| "stage33", | |
| "stage34", | |
| "stage35", | |
| "stage36", | |
| "stage37", | |
| "stage38", | |
| "stage39", | |
| "stage40" | |
| ], | |
| "transformers_version": "5.10.0.dev0", | |
| "use_gated_mlp": true, | |
| "use_mask_token": false, | |
| "use_qk_norm": true, | |
| "value_bias": true | |
| } | |