File tree Expand file tree Collapse file tree 5 files changed +21
-73
lines changed
Expand file tree Collapse file tree 5 files changed +21
-73
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- python -O scripts/train_poseestimator.py --lr 1.e-3 --epochs 1500 --ds " repro_300_wlp+lapa_megaface_lp+wflw_lp" \
3+ python -O scripts/train_poseestimator.py --lr 1.e-3 --epochs 1500 --ds " repro_300_wlp+lapa_megaface_lp+wflw_lp+replicantface " \
44 --with-swa \
55 --with-nll-loss \
66 --rampup-nll-losses \
77 --backbone resnet18 \
8- --outdir model_files/current/baseline4
9-
10- # python -O scripts/train_poseestimator.py --lr 1.e-3 --epochs 1500 --ds "repro_300_wlp+lapa_megaface_lp+wflw_lp+replicantface" \
11- # --with-swa \
12- # --with-nll-loss \
13- # --rampup-nll-losses \
14- # --backbone resnet18 \
15- # --outdir model_files/current/testing4
16-
17- # python -O scripts/train_poseestimator.py --lr 1.e-3 --epochs 1500 --ds "repro_300_wlp+lapa_megaface_lp+wflw_lp" \
18- # --with-swa \
19- # --with-nll-loss \
20- # --rampup-nll-losses \
21- # --backbone resnet18 \
22- # --no-pointhead \
23- # --outdir model_files/current/no-pointhead-wo-replicantface4
24-
25- # python -O scripts/train_poseestimator.py --lr 1.e-3 --epochs 1500 --ds "repro_300_wlp+lapa_megaface_lp+wflw_lp+replicantface" \
26- # --with-swa \
27- # --with-nll-loss \
28- # --rampup-nll-losses \
29- # --backbone resnet18 \
30- # --no-pointhead \
31- # --outdir model_files/current/no-pointhead4
8+ --no-pointhead \
9+ --outdir model_files/current/more-noise4
Original file line number Diff line number Diff line change 1- # from trackertraincode.datatransformation.tensors import croprescale_image_torch, affine_transform_image_torch
2- # from trackertraincode.datatransformation.tensors.image_geometric_cv2 import affine_transform_image_cv2, croprescale_image_cv2
3- # from trackertraincode.datatransformation.tensors.affinetrafo import (
4- # position_normalization, position_unnormalization,
5- # apply_affine2d)
6-
7- # from trackertraincode.datatransformation.batch.intensity import (
8- # KorniaImageDistortions,
9- # RandomBoxBlur,
10- # RandomPlasmaBrightness,
11- # RandomPlasmaContrast,
12- # RandomPlasmaShadow,
13- # RandomGaussianBlur,
14- # RandomSolarize,
15- # RandomInvert,
16- # RandomPosterize,
17- # RandomGamma,
18- # RandomEqualize,
19- # RandomGaussianNoiseWithClipping,
20- # RandomContrast,
21- # RandomBrightness,
22- # RandomGaussianNoise
23- # )
24-
25- # from trackertraincode.datatransformation.batch.normalization import (
26- # normalize_batch,
27- # unnormalize_batch,
28- # offset_points_by_half_pixel,
29- # whiten_batch
30- # )
31-
32- # from trackertraincode.datatransformation.batch.representation import (
33- # to_tensor,
34- # )
35-
36- # from trackertraincode.datatransformation.batch.geometric import (
37- # RandomFocusRoi,
38- # FocusRoi,
39- # RoiFocusRandomizationParameters,
40- # horizontal_flip_and_rot_90
41- # )
42-
43- # from trackertraincode.datatransformation.tensors.normalization import unwhiten_image, whiten_image
44- # from trackertraincode.datatransformation.tensors.representation import ensure_image_nchw, ensure_image_nhwc
45-
461from . import tensors
472from . import batch
483
Original file line number Diff line number Diff line change 1616 RandomContrast ,
1717 RandomBrightness ,
1818 RandomGaussianNoise ,
19+ OnlyClip ,
1920)
2021
2122from .normalization import (
Original file line number Diff line number Diff line change 2323 RandomGaussianNoise ,
2424 RandomContrast ,
2525 RandomBrightness ,
26+ IntensityAugmentationBase2D ,
2627)
2728
2829
2930class KorniaImageDistortions (object ):
30- @wraps (AugmentationSequential .__init__ )
3131 def __init__ (self , * args , ** kwargs ):
3232 self .augs = AugmentationSequential (* args , ** kwargs )
3333
@@ -51,3 +51,14 @@ def apply_transform(
5151 output = super ().apply_transform (input , params , flags , transform )
5252 output = output .clip (0.0 , 1.0 )
5353 return output
54+
55+
56+ class OnlyClip (IntensityAugmentationBase2D ):
57+ def apply_transform (
58+ self ,
59+ input : Tensor ,
60+ params : Dict [str , Tensor ],
61+ flags : Dict [str , Any ],
62+ transform : Tensor | None = None ,
63+ ) -> Tensor :
64+ return input .clip (0.0 , 1.0 )
Original file line number Diff line number Diff line change @@ -519,8 +519,11 @@ def make_pose_estimation_loaders(
519519 random_apply = 4 ,
520520 ),
521521 dtr .batch .KorniaImageDistortions (
522- dtr .batch .RandomGaussianNoise (std = 4.0 / 255.0 , p = 0.5 ),
523- dtr .batch .RandomGaussianNoise (std = 16.0 / 255.0 , p = 0.1 ),
522+ dtr .batch .RandomGaussianNoise (std = 4.0 / 255.0 , p = 0.25 ),
523+ dtr .batch .RandomGaussianNoise (std = 16.0 / 255.0 , p = 0.25 ** 2 ),
524+ dtr .batch .RandomGaussianNoise (std = 32.0 / 255.0 , p = 0.25 ** 3 ),
525+ dtr .batch .RandomGaussianNoise (std = 64.0 / 255.0 , p = 0.25 ** 4 ),
526+ dtr .batch .OnlyClip (p = 1.0 ),
524527 ),
525528 ]
526529 else :
You can’t perform that action at this time.
0 commit comments