keremberke/painting-style-classification
Viewer β’ Updated β’ 6.57k β’ 270 β’ 19
This is a fine-tuned image classification model based on torchvision.models.efficientnet_b0 initialized with pretrained weights from IMAGENET1K_V1. It has been fine-tuned to classify artworks into 9 different painting styles.
label_smoothing=0.1)lr=1e-4, weight_decay=0.01)from torchvision import transforms
from PIL import Image
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
),
])
# Example usage:
img = Image.open("your_image.jpg").convert("RGB")
input_tensor = transform(img).unsqueeze(0)
output = model(input_tensor)
pred = torch.argmax(output, dim=1)