Skip to content

Commit

Permalink
info readme + weather augs
Browse files Browse the repository at this point in the history
  • Loading branch information
YassineYousfi committed Dec 20, 2020
1 parent ca1c0d1 commit cb52878
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
scrap.ipynb
scrap*
__pycache__/
.ipynb_checkpoints/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Here is an example (randomly from the validation set, no cherry picking)
#### Predicted
![Prediction](example_pred.png)

## Info

The comma10k dataset is currently being labeled, stay tuned for:
- A retrained model when the dataset is released
- More features to use the model


## How to use
This baseline uses two stages (i) 437x582 (ii) 874x1164 (full resolution)
Expand Down
47 changes: 46 additions & 1 deletion retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,52 @@ def get_train_transforms(height: int = 437,
mask_value=0)
], p=1.0)
elif level == 'hard_weather':
raise NotImplementedError("WIP")
return A.Compose([
A.HorizontalFlip(p=0.5),
A.IAAAdditiveGaussianNoise(p=0.2),
A.OneOf(
[A.GridDistortion(border_mode=cv2.BORDER_CONSTANT, value=0, mask_value=0, p=1.0),
A.ElasticTransform(alpha_affine=10, border_mode=cv2.BORDER_CONSTANT, value=0, mask_value=0, p=1.0),
A.ShiftScaleRotate(
shift_limit=0,
scale_limit=0,
rotate_limit=10,
border_mode=cv2.BORDER_CONSTANT,
value=0,
mask_value=0,
p=1.0
),
A.OpticalDistortion(border_mode=cv2.BORDER_CONSTANT, value=0, mask_value=0, p=1.0),
],p=0.5),
A.OneOf(
[A.CLAHE(p=1.0),
A.RandomBrightness(p=1.0),
A.RandomGamma(p=1.0),
A.ISONoise(p=1.0)
],p=0.5),
A.OneOf(
[A.IAASharpen(p=1.0),
A.Blur(blur_limit=3, p=1.0),
A.MotionBlur(blur_limit=3, p=1.0),
],p=0.5),
A.OneOf(
[A.RandomContrast(p=1.0),
A.HueSaturationValue(p=1.0),
],p=0.5),
A.OneOf(
[A.RandomFog(fog_coef_upper=0.8, p=1.0),
A.RandomRain(p=1.0),
A.RandomSnow(p=1.0),
A.RandomSunFlare(src_radius=100, p=1.0)
],p=0.4),
A.Resize(height=height, width=width, p=1.0),
A.Cutout(p=0.3),
A.PadIfNeeded(pad_to_multiple(height),
pad_to_multiple(width),
border_mode=cv2.BORDER_CONSTANT,
value=0,
mask_value=0)
], p=1.0)

def get_valid_transforms(height: int = 437,
width: int = 582):
Expand Down

0 comments on commit cb52878

Please sign in to comment.