Safemotion Lib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
fastreid.data.transforms.autoaugment.AutoAugment Class Reference

Public Member Functions

 __init__ (self, total_iter)
 
 __call__ (self, img)
 

Public Attributes

 total_iter
 
 gamma
 
 policy
 

Detailed Description

Definition at line 495 of file autoaugment.py.

Constructor & Destructor Documentation

◆ __init__()

fastreid.data.transforms.autoaugment.AutoAugment.__init__ ( self,
total_iter )

Definition at line 497 of file autoaugment.py.

497 def __init__(self, total_iter):
498 self.total_iter = total_iter
499 self.gamma = 0
500 self.policy = auto_augment_policy()
501

Member Function Documentation

◆ __call__()

fastreid.data.transforms.autoaugment.AutoAugment.__call__ ( self,
img )

Definition at line 502 of file autoaugment.py.

502 def __call__(self, img):
503 if random.uniform(0, 1) > self.gamma:
504 sub_policy = random.choice(self.policy)
505 self.gamma = min(1.0, self.gamma + 1.0 / self.total_iter)
506 for op in sub_policy:
507 img = op(img)
508 return img
509 else:
510 return img
511
512

Member Data Documentation

◆ gamma

fastreid.data.transforms.autoaugment.AutoAugment.gamma

Definition at line 499 of file autoaugment.py.

◆ policy

fastreid.data.transforms.autoaugment.AutoAugment.policy

Definition at line 500 of file autoaugment.py.

◆ total_iter

fastreid.data.transforms.autoaugment.AutoAugment.total_iter

Definition at line 498 of file autoaugment.py.


The documentation for this class was generated from the following file: