Module ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Assign NameStore ListLoad Str Str Str Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice NameLoad BinOpAdd NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Slice NameLoad BinOpAdd NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num If AttributeLoad NameLoad attr body Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad BinOpMult BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign NameStore Call NameLoad BinOpMult BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice NameLoad BinOpAdd NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Slice NameLoad BinOpAdd NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num If AttributeLoad NameLoad attr body Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Num Slice AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Num If AttributeLoad NameLoad attr body Raise Call NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num Num body Expr Str Assign NameStore BinOpDiv BinOpMult AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad NameLoad ListLoad Num Assign NameStore Call AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num AugAssignAdd AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore BinOpAdd AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore BinOpAdd AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr BinOpSub NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpSub NameLoad AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Continue Assign NameStore BinOpDiv BinOpMult AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign NameStore Call NameLoad BinOpSub NameLoad NameLoad If CompareGt BinOpDiv NameLoad NameLoad NameLoad body Continue Return NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Slice Num Assign NameStore Call NameLoad Num Num BinOpSub SubscriptLoad NameLoad Index Num Num BinOpSub SubscriptLoad NameLoad Index Num Num Assign NameStore BinOpMult AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Raise Call NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Print Call NameLoad ListLoad Num Num Call NameLoad Num Num Num Num Num
N/A base ImageAugmentor utils.rect Rect six.moves range N/A numpy np N/A __all__ N/A RandomCrop CenterCrop FixedCrop RandomCropRandomShape RandomCrop N/A ImageAugmentor N/A N/A  Randomly crop the image into a smaller one  __init__ N/A N/A self crop_shape N/A N/A N/A 
        :param crop_shape: a shape like (h, w)
         N/A N/A N/A self _init N/A locals N/A _augment N/A N/A self img N/A N/A N/A orig_shape N/A N/A img arr shape N/A h0 N/A N/A N/A self rng randint 0 N/A N/A orig_shape N/A 0 N/A N/A self crop_shape N/A 0 N/A w0 N/A N/A N/A self rng randint 0 N/A N/A orig_shape N/A 1 N/A N/A self crop_shape N/A 1 N/A N/A img arr N/A N/A img arr N/A N/A h0 N/A h0 N/A N/A self crop_shape N/A 0 N/A w0 N/A w0 N/A N/A self crop_shape N/A 1 N/A N/A img coords N/A N/A N/A NotImplementedError N/A N/A CenterCrop N/A ImageAugmentor N/A N/A  Crop the image at the center __init__ N/A N/A self crop_shape N/A N/A N/A 
        :param crop_shape: a shape like (h, w)
         N/A N/A N/A self _init N/A locals N/A _augment N/A N/A self img N/A N/A N/A orig_shape N/A N/A img arr shape N/A h0 N/A int N/A N/A N/A orig_shape N/A 0 N/A N/A self crop_shape N/A 0 0.5 N/A w0 N/A int N/A N/A N/A orig_shape N/A 1 N/A N/A self crop_shape N/A 1 0.5 N/A N/A img arr N/A N/A img arr N/A N/A h0 N/A h0 N/A N/A self crop_shape N/A 0 N/A w0 N/A w0 N/A N/A self crop_shape N/A 1 N/A N/A img coords N/A N/A N/A NotImplementedError N/A N/A FixedCrop N/A ImageAugmentor N/A N/A  Crop a rectangle at a given location __init__ N/A N/A self rect N/A N/A N/A 
        Two arguments defined the range in both axes to crop, min inclued, max excluded.

        :param rect: a `Rect` instance
         N/A N/A N/A self _init N/A locals N/A _augment N/A N/A self img N/A N/A N/A orig_shape N/A N/A img arr shape N/A N/A img arr N/A N/A img arr N/A N/A N/A N/A self rect y0 N/A N/A N/A self rect y1 1 N/A N/A N/A self rect x0 N/A N/A N/A self rect x0 1 N/A N/A img coords N/A N/A N/A NotImplementedError N/A N/A perturb_BB N/A N/A image_shape bb max_pertub_pixel rng max_aspect_ratio_diff max_try N/A None 0.3 100 N/A N/A 
    Perturb a bounding box.
    :param image_shape: [h, w]
    :param bb: a `Rect` instance
    :param max_pertub_pixel: pertubation on each coordinate
    :param max_aspect_ratio_diff: result can't have an aspect ratio too different from the original
    :param max_try: if cannot find a valid bounding box, return the original
    :returns: new bounding box
     N/A orig_ratio N/A N/A N/A bb h 1.0 N/A bb w N/A N/A rng None N/A N/A rng N/A N/A N/A np random RandomState N/A _ N/A range max_try N/A N/A p N/A N/A rng randint N/A max_pertub_pixel max_pertub_pixel N/A 4 N/A newbb N/A N/A bb copy N/A N/A newbb x N/A p N/A 0 N/A N/A newbb y N/A p N/A 1 N/A newx1 N/A N/A bb x1 N/A p N/A 2 N/A newy1 N/A N/A bb y1 N/A p N/A 3 N/A N/A newbb w N/A newx1 N/A newbb x N/A N/A newbb h N/A newy1 N/A newbb y N/A N/A N/A N/A newbb validate image_shape N/A N/A N/A new_ratio N/A N/A N/A newbb h 1.0 N/A newbb w N/A diff N/A abs N/A new_ratio orig_ratio N/A N/A N/A diff orig_ratio max_aspect_ratio_diff N/A N/A N/A newbb N/A bb N/A RandomCropRandomShape N/A ImageAugmentor N/A N/A 
    Crop a box around a bounding box
     __init__ N/A N/A self perturb_ratio max_aspect_ratio_diff N/A 0.3 N/A N/A 
        :param perturb_ratio: perturb distance will be in [0, perturb_ratio * sqrt(w * h)]
        :param max_aspect_ratio_diff: keep aspect ratio within the range
         N/A N/A N/A self _init N/A locals N/A _augment N/A N/A self img N/A N/A N/A shape N/A N/A N/A img arr shape N/A 2 N/A box N/A Rect 0 0 N/A N/A shape N/A 1 1 N/A N/A shape N/A 0 1 N/A dist N/A N/A self perturb_ratio N/A N/A np sqrt N/A N/A shape N/A 0 N/A shape N/A 1 N/A newbox N/A perturb_BB shape box dist N/A self rng N/A self max_aspect_ratio_diff N/A N/A img arr N/A N/A newbox roi N/A img arr N/A N/A img coords N/A N/A N/A NotImplementedError N/A N/A N/A N/A __name__ __main__ N/A N/A N/A perturb_BB N/A 100 100 N/A Rect 3 3 50 50 50