Update README.md
Browse files
README.md
CHANGED
@@ -30,7 +30,7 @@ from PIL import Image
|
|
30 |
from transformers import pipeline
|
31 |
|
32 |
img = Image.open("<path_to_image_file>")
|
33 |
-
classifier = pipeline("image-classification", model="
|
34 |
classifier(img)
|
35 |
|
36 |
```
|
@@ -45,8 +45,8 @@ from PIL import Image
|
|
45 |
from transformers import AutoModelForImageClassification, ViTImageProcessor
|
46 |
|
47 |
img = Image.open("<path_to_image_file>")
|
48 |
-
model = AutoModelForImageClassification.from_pretrained("
|
49 |
-
processor = ViTImageProcessor.from_pretrained('
|
50 |
with torch.no_grad():
|
51 |
inputs = processor(images=img, return_tensors="pt")
|
52 |
outputs = model(**inputs)
|
|
|
30 |
from transformers import pipeline
|
31 |
|
32 |
img = Image.open("<path_to_image_file>")
|
33 |
+
classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection")
|
34 |
classifier(img)
|
35 |
|
36 |
```
|
|
|
45 |
from transformers import AutoModelForImageClassification, ViTImageProcessor
|
46 |
|
47 |
img = Image.open("<path_to_image_file>")
|
48 |
+
model = AutoModelForImageClassification.from_pretrained("Falconsai/nsfw_image_detection")
|
49 |
+
processor = ViTImageProcessor.from_pretrained('Falconsai/nsfw_image_detection')
|
50 |
with torch.no_grad():
|
51 |
inputs = processor(images=img, return_tensors="pt")
|
52 |
outputs = model(**inputs)
|