jaranohaal
commited on
Commit
•
aa884ae
1
Parent(s):
5147416
Update README.md
Browse files
README.md
CHANGED
@@ -38,11 +38,11 @@ from transformers import ViTForImageClassification, ViTFeatureExtractor
|
|
38 |
from PIL import Image
|
39 |
|
40 |
# Load the model and feature extractor
|
41 |
-
model = ViTForImageClassification.from_pretrained('
|
42 |
-
feature_extractor = ViTFeatureExtractor.from_pretrained('
|
43 |
|
44 |
# Load an image
|
45 |
-
image = Image.open('
|
46 |
|
47 |
# Preprocess the image
|
48 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
|
|
38 |
from PIL import Image
|
39 |
|
40 |
# Load the model and feature extractor
|
41 |
+
model = ViTForImageClassification.from_pretrained('jaranohaal/vit-base-violence-detection')
|
42 |
+
feature_extractor = ViTFeatureExtractor.from_pretrained('jaranohaal/vit-base-violence-detection')
|
43 |
|
44 |
# Load an image
|
45 |
+
image = Image.open('image.jpg')
|
46 |
|
47 |
# Preprocess the image
|
48 |
inputs = feature_extractor(images=image, return_tensors="pt")
|