Downloads · 30 days
0
JJJHHHH/CCR_EthicalSplit_Finetune
CCR_EthicalSplit_Finetune is a machine learning model from JJJHHHH. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
- Architecture: ResNet50 pretrained on ImageNet + custom classifier head - Classes: 1200 Chinese calligraphy characters - Input: 224x224 RGB images (grayscale converted to RGB) - Framework: PyTorch
Downloads · 30 days
0
Access
Public
Updated Jul 20, 2025
Repo size
303 MB
Likes
0
Public
Click a slice to open those files.
.pth303 MB · 100%
From the Hugging Face model README
model = ChineseClassifier(embed_dim=512, num_classes=1200, pretrainedEncoder=True, unfreezeEncoder=True)
checkpoint = torch.load("best_checkpoint.pth", map_location=device)
model.load_state_dict(checkpoint["model_state_dict"])
model.eval()
transform = CalligraphyCharacterDataset.defaultTransform()
img = Image.open("path_to_image.jpg").convert("RGB")
input_tensor = transform(img).unsqueeze(0).to(device)
outputs = model(input_tensor)
pred_idx = torch.argmax(outputs, dim=1).item()
pred_char = idx2char[pred_idx]