Downloads · 30 days
7
6% of all-time downloads
Binarybardakshat/RKSHT
RKSHT is a image classification model from Binarybardakshat. Use it when you need a label for an image. The card lists the license as apache-2.0.
This is a custom Vision Transformer (ViT) model fine-tuned for detecting instances of harassment in public and workplace environments. The model is built on google/vit-base-patch16-224-in21k and trained on a dataset t…
Downloads · 30 days
7
6% of all-time downloads
All-time downloads
127
Public
Repo size
343 MB
Likes
0
Public
Click a slice to open those files.
.bin343 MB · 100%
From the Hugging Face model README
This is a custom Vision Transformer (ViT) model fine-tuned for detecting instances of harassment in public and workplace environments. The model is built on google/vit-base-patch16-224-in21k and trained on a dataset tailored for harassment detection, classifying images into 'harassment' or 'non-harassment' categories.
This model is designed for use in applications requiring harassment detection through visual data, including:
The RKSHT model has been fine-tuned with high accuracy for distinguishing harassment behavior.
Here’s an example of how to use the RKSHT Harassment Detection model for image classification:
import torch
from transformers import ViTForImageClassification, ViTFeatureExtractor
from PIL import Image
# Load the model and feature extractor
model = ViTForImageClassification.from_pretrained('Binarybardakshat/RKSHT')
feature_extractor = ViTFeatureExtractor.from_pretrained('Binarybardakshat/RKSHT')
# Load an image
image = Image.open('image.jpg')
# Preprocess the image
inputs = feature_extractor(images=image, return_tensors="pt")
# Perform inference
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
# Print the predicted class
print("Predicted class:", model.config.id2label[predicted_class_idx])