MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / reader

Function reader

CV/SemSegPaddleDG/src/datasets/pascal_context.py:218–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216 image_path, label_path = context.get_path_pairs()
217
218 def reader():
219 if len(image_path) % (batch_size * gpu_num) != 0:
220 length = (len(image_path) // (batch_size * gpu_num)) * (batch_size * gpu_num)
221 else:
222 length = len(image_path)
223 for i in range(length):
224 if i == 0:
225 cc = list(zip(image_path, label_path))
226 random.shuffle(cc)
227 image_path[:], label_path[:] = zip(*cc)
228 yield image_path[i], label_path[i], context
229 if xmap:
230 return paddle.reader.xmap_readers(context_mapper_train, reader, 4, 32)
231 else:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected