pad_collate

pad_collate(batch)

Collate function: pads images to the max width and stacks targets.

Returns

Name Type Description
images (B, 3, H, W_max)
targets 1D tensor concatenating all label sequences
target_lengths (B,) lengths for CTC loss