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
Add model
Browse files- README.md +10 -0
- config.json +45 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- image-classification
|
| 4 |
+
- timm
|
| 5 |
+
- transformers
|
| 6 |
+
pipeline_tag: image-classification
|
| 7 |
+
library_name: timm
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
---
|
| 10 |
+
# Model card for image-safety-classifier-s
|
config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architecture": "swiftformer_s",
|
| 3 |
+
"num_classes": 3,
|
| 4 |
+
"num_features": 224,
|
| 5 |
+
"global_pool": "avg",
|
| 6 |
+
"pretrained_cfg": {
|
| 7 |
+
"tag": "dist_in1k",
|
| 8 |
+
"custom_load": false,
|
| 9 |
+
"input_size": [
|
| 10 |
+
3,
|
| 11 |
+
224,
|
| 12 |
+
224
|
| 13 |
+
],
|
| 14 |
+
"fixed_input_size": true,
|
| 15 |
+
"interpolation": "bicubic",
|
| 16 |
+
"crop_pct": 0.95,
|
| 17 |
+
"crop_mode": "center",
|
| 18 |
+
"mean": [
|
| 19 |
+
0.485,
|
| 20 |
+
0.456,
|
| 21 |
+
0.406
|
| 22 |
+
],
|
| 23 |
+
"std": [
|
| 24 |
+
0.229,
|
| 25 |
+
0.224,
|
| 26 |
+
0.225
|
| 27 |
+
],
|
| 28 |
+
"num_classes": 1000,
|
| 29 |
+
"label_names": [
|
| 30 |
+
"NSFL",
|
| 31 |
+
"NSFW",
|
| 32 |
+
"SFW"
|
| 33 |
+
],
|
| 34 |
+
"pool_size": null,
|
| 35 |
+
"first_conv": "stem.0",
|
| 36 |
+
"classifier": [
|
| 37 |
+
"head",
|
| 38 |
+
"head_dist"
|
| 39 |
+
],
|
| 40 |
+
"license": "apache-2.0",
|
| 41 |
+
"origin_url": "https://github.com/Amshaker/SwiftFormer",
|
| 42 |
+
"paper_name": "SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications",
|
| 43 |
+
"paper_ids": "arXiv:2303.15446"
|
| 44 |
+
}
|
| 45 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5a7a68c1036cd8b117662a910718f6a2d6a56d18996e70b19d5f79b1b7c892a2
|
| 3 |
+
size 22647760
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a7489eb5ed3ee2217b7d6653de7608bd75115846f2e5e431ac5dc9d2a861f638
|
| 3 |
+
size 22738563
|