Instructions to use OwenElliott/image-safety-classifier-s with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use OwenElliott/image-safety-classifier-s with timm:
import timm model = timm.create_model("hf_hub:OwenElliott/image-safety-classifier-s", pretrained=True) - Transformers
How to use OwenElliott/image-safety-classifier-s with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="OwenElliott/image-safety-classifier-s") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OwenElliott/image-safety-classifier-s", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architecture": "swiftformer_s", | |
| "num_classes": 3, | |
| "num_features": 224, | |
| "global_pool": "avg", | |
| "pretrained_cfg": { | |
| "tag": "dist_in1k", | |
| "custom_load": false, | |
| "input_size": [ | |
| 3, | |
| 224, | |
| 224 | |
| ], | |
| "fixed_input_size": true, | |
| "interpolation": "bicubic", | |
| "crop_pct": 0.95, | |
| "crop_mode": "center", | |
| "mean": [ | |
| 0.485, | |
| 0.456, | |
| 0.406 | |
| ], | |
| "std": [ | |
| 0.229, | |
| 0.224, | |
| 0.225 | |
| ], | |
| "num_classes": 1000, | |
| "label_names": [ | |
| "NSFL", | |
| "NSFW", | |
| "SFW" | |
| ], | |
| "pool_size": null, | |
| "first_conv": "stem.0", | |
| "classifier": [ | |
| "head", | |
| "head_dist" | |
| ], | |
| "license": "apache-2.0", | |
| "origin_url": "https://github.com/Amshaker/SwiftFormer", | |
| "paper_name": "SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications", | |
| "paper_ids": "arXiv:2303.15446" | |
| } | |
| } |