Downloads · 30 days
18
16% of all-time downloads
Sleeeepy/crossed-out-text-classifier
crossed-out-text-classifier is a image classification model from Sleeeepy. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as apache-2.0.
This is a ResNet18-based binary classifier trained to detect crossed out text in OCR images. The model classifies images into two categories: - no: Text is not crossed out - yes: Text is crossed out
Downloads · 30 days
18
16% of all-time downloads
All-time downloads
111
Public
Repo size
44.8 MB
Likes
0
Public
Click a slice to open those files.
.bin44.8 MB · 100%
From the Hugging Face model README
This is a ResNet18-based binary classifier trained to detect crossed out text in OCR images. The model classifies images into two categories:
no: Text is not crossed outyes: Text is crossed outimport torch
from PIL import Image
import torchvision.transforms as transforms
# Load model
model = torch.load('pytorch_model.bin', map_location='cpu')
model.eval()
# Prepare image
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
image = Image.open('your_image.png').convert('RGB')
input_tensor = transform(image).unsqueeze(0)
# Make prediction
with torch.no_grad():
outputs = model(input_tensor)
probabilities = torch.nn.functional.softmax(outputs, dim=1)
predicted_class = torch.argmax(probabilities, dim=1).item()
confidence = torch.max(probabilities, dim=1)[0].item()
class_names = ['no', 'yes']
print(f"Prediction: {class_names[predicted_class]} (confidence: {confidence:.4f})")
from src.inference import CrossedOutPredictor
# Initialize predictor
predictor = CrossedOutPredictor()
predictor.load_model('pytorch_model.bin')
# Make prediction
prediction, confidence = predictor.predict_image('your_image.png')
print(f"Prediction: {prediction} (confidence: {confidence:.4f})")
The model was trained on a dataset of OCR images with crossed out and non-crossed out text. The training used:
This model is intended for:
This model is released under the Apache 2.0 license.
If you use this model, please cite:
@misc{Sleeeepy_crossed_out_text_classifier,
title={Crossed Out Text Classifier},
author={Your Name},
year={2025},
howpublished={\url{https://huggingface.co/Sleeeepy/crossed-out-text-classifier}}
}