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
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -26,6 +26,16 @@ This model is part of a lineup of image safety classification models in 4 differ
|
|
| 26 |
| [`OwenElliott/image-safety-classifier-m`](https://huggingface.co/OwenElliott/image-safety-classifier-m) | 12.1M | 98.06% |
|
| 27 |
| [`OwenElliott/image-safety-classifier-l`](https://huggingface.co/OwenElliott/image-safety-classifier-l) | 28.5M | 98.20% |
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
## Model Usage
|
| 30 |
|
| 31 |
### Image Classification with timm
|
|
@@ -95,23 +105,6 @@ print("Probabilities:", dict(zip(class_names, probs)))
|
|
| 95 |
print("Class:", class_names[np.argmax(probs)])
|
| 96 |
```
|
| 97 |
|
| 98 |
-
## Evaluation
|
| 99 |
-
|
| 100 |
-
This model outperforms existing NSFW detectors on our dataset, here we provide an evaluation against [Marqo/nsfw-image-detection-384](https://huggingface.co/Marqo/nsfw-image-detection-384) and [Falconsai/nsfw_image_detection](https://huggingface.co/Falconsai/nsfw_image_detection).
|
| 101 |
-
|
| 102 |
-
__NSFW, NSFL, and SFW Evaluation:__
|
| 103 |
-
|
| 104 |
-

|
| 105 |
-
|
| 106 |
-

|
| 107 |
-
|
| 108 |
-
*Note that [Marqo/nsfw-image-detection-384](https://huggingface.co/Marqo/nsfw-image-detection-384) and [Falconsai/nsfw_image_detection](https://huggingface.co/Falconsai/nsfw_image_detection) don't have an explicit NSFL class, for this evaluation the NSFW class from these model is treated as a correct classification for an NSFL image.
|
| 109 |
-
|
| 110 |
-
__NSFW and SFW Evaluation:__
|
| 111 |
-
|
| 112 |
-

|
| 113 |
-

|
| 114 |
-
|
| 115 |
|
| 116 |
## Notes on the Dataset
|
| 117 |
|
|
|
|
| 26 |
| [`OwenElliott/image-safety-classifier-m`](https://huggingface.co/OwenElliott/image-safety-classifier-m) | 12.1M | 98.06% |
|
| 27 |
| [`OwenElliott/image-safety-classifier-l`](https://huggingface.co/OwenElliott/image-safety-classifier-l) | 28.5M | 98.20% |
|
| 28 |
|
| 29 |
+
## Evaluation
|
| 30 |
+
|
| 31 |
+
This model outperforms existing NSFW detectors on our dataset, here we provide an evaluation against [Marqo/nsfw-image-detection-384](https://huggingface.co/Marqo/nsfw-image-detection-384) and [Falconsai/nsfw_image_detection](https://huggingface.co/Falconsai/nsfw_image_detection).
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
*Note that [Marqo/nsfw-image-detection-384](https://huggingface.co/Marqo/nsfw-image-detection-384) and [Falconsai/nsfw_image_detection](https://huggingface.co/Falconsai/nsfw_image_detection) don't have an explicit NSFL class, for this evaluation the NSFW class from these model is treated as a correct classification for an NSFL image.
|
| 38 |
+
|
| 39 |
## Model Usage
|
| 40 |
|
| 41 |
### Image Classification with timm
|
|
|
|
| 105 |
print("Class:", class_names[np.argmax(probs)])
|
| 106 |
```
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
## Notes on the Dataset
|
| 110 |
|