BBoxPaste¶
- class
dragon.vm.dali.ops.
BBoxPaste
(
ltrb=True,
ratio=None,
paste_x=None,
paste_y=None,
**kwargs
)[source]¶ Transform bounding boxes to match the
Paste
operator.Examples:
bbox_paste = dali.ops.BBoxPaste() paste_pos = dali.ops.Uniform((0., 1.)) paste_ratio = dali.ops.Uniform((0., 3.)) paste_prob = dali.ops.CoinFlip(0.5) bbox = bbox_paste( inputs['bbox'], # Expand ratio ratio=paste_ratio() * paste_prob() + 1., # PosX, PosY paste_x=paste_pos(), paste_y=paste_pos(), )
__new__¶
- static
BBoxPaste.
__new__
(
cls,
ltrb=True,
ratio=None,
paste_x=None,
paste_y=None,
**kwargs
)[source]¶ Create a
BBoxPaste
operator.- Parameters:
- ltrb (bool, optional, default=True) – Indicate the bbox is
ltrb
orxywh
format. - ratio (int, optional) – The expand ratio.
- paste_x (int, optional) – The paste position at x-axis.
- paste_y (int, optional) – The paste position at y-axis.
- ltrb (bool, optional, default=True) – Indicate the bbox is
- Returns:
nvidia.dali.ops.BBoxPaste – The operator.