Spaces:
Sleeping
Sleeping
functionNormally Claude Sonnet 4.6 commited on
Commit ·
948c799
1
Parent(s): 0335eaa
Remplacer RandomResizedCrop par Resize fixe pour images microscopiques
Browse filesL'échelle des textures est discriminante en microscopie — un crop aléatoire
détruit cette information et empêche la convergence sur petit dataset.
Rotation réduite à 15°, ColorJitter conservé.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- data_utils.py +5 -5
data_utils.py
CHANGED
|
@@ -44,13 +44,13 @@ class HFDatasetWrapper(Dataset):
|
|
| 44 |
def get_train_transform():
|
| 45 |
return transforms.Compose(
|
| 46 |
[
|
| 47 |
-
#
|
| 48 |
-
transforms.
|
| 49 |
transforms.RandomHorizontalFlip(p=0.5),
|
| 50 |
transforms.RandomVerticalFlip(p=0.5),
|
| 51 |
-
#
|
| 52 |
-
transforms.RandomRotation(degrees=
|
| 53 |
-
# Légère variation
|
| 54 |
transforms.ColorJitter(brightness=0.2, contrast=0.2, saturation=0.1),
|
| 55 |
transforms.ToTensor(),
|
| 56 |
transforms.Normalize(
|
|
|
|
| 44 |
def get_train_transform():
|
| 45 |
return transforms.Compose(
|
| 46 |
[
|
| 47 |
+
# Resize fixe : préserve l'échelle des textures microscopiques
|
| 48 |
+
transforms.Resize((IMAGE_SIZE, IMAGE_SIZE)),
|
| 49 |
transforms.RandomHorizontalFlip(p=0.5),
|
| 50 |
transforms.RandomVerticalFlip(p=0.5),
|
| 51 |
+
# Les coupes microscopiques n'ont pas d'orientation canonique
|
| 52 |
+
transforms.RandomRotation(degrees=15),
|
| 53 |
+
# Légère variation photométrique pour robustesse aux conditions d'acquisition
|
| 54 |
transforms.ColorJitter(brightness=0.2, contrast=0.2, saturation=0.1),
|
| 55 |
transforms.ToTensor(),
|
| 56 |
transforms.Normalize(
|