Skip to content

Commit 4d1154c

Browse files
fix: performance (#38)
ResNet50 requires images with the size of 224, I had to increase that. Also important changes are slight rotations which helps the model to learn. Increase the light of the images can help when images are a bit darker. Those tiny changes increase the model accuracy from 71% to 80%
1 parent 8296767 commit 4d1154c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/data_loader.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ def __init__(self, hf_dataset):
1111
self.data = hf_dataset
1212
self.transform = T.Compose([
1313
T.Grayscale(num_output_channels=3),
14+
T.Resize((224,224)),
15+
T.RandomHorizontalFlip(p=0.5),
16+
T.RandomRotation(degrees=10),
17+
T.RandomApply([T.ColorJitter(brightness=0.2, contrast=0.2)], p=0.5),
1418
T.ToTensor(),
1519
T.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
1620
])

0 commit comments

Comments
 (0)