MCPcopy Create free account
hub / github.com/ChenhongyiYang/QueryDet-PyTorch / build_transform_gen

Function build_transform_gen

visdrone/mapper.py:87–101  ·  view source on GitHub ↗
(cfg, is_train)

Source from the content-addressed store, hash-verified

85
86
87def build_transform_gen(cfg, is_train):
88 if is_train:
89 sample_style = cfg.INPUT.MIN_SIZE_TRAIN_SAMPLING
90 else:
91 sample_style = 'choice'
92
93 logger = logging.getLogger(__name__)
94 tfm_gens = []
95 if is_train:
96 tfm_gens.append(T.RandomFlip(horizontal=True, vertical=False))
97 tfm_gens.append(T.ResizeShortestEdge(short_edge_length=cfg.VISDRONE.SHORT_LENGTH, max_size=cfg.VISDRONE.MAX_LENGTH, sample_style=sample_style))
98 else:
99 tfm_gens.append(T.ResizeShortestEdge(short_edge_length=[cfg.VISDRONE.TEST_LENGTH], max_size=cfg.VISDRONE.TEST_LENGTH, sample_style=sample_style))
100
101 return tfm_gens
102
103
104

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected