MCPcopy Create free account
hub / github.com/mindee/doctr / _transform

Function _transform

scripts/evaluate.py:30–35  ·  view source on GitHub ↗
(img, target)

Source from the content-addressed store, hash-verified

28 # We define a transformation function which does transform the annotation
29 # to the required format for the Resize transformation
30 def _transform(img, target):
31 boxes = target["boxes"]
32 transformed_img, transformed_boxes = T.Resize(
33 input_shape, preserve_aspect_ratio=args.keep_ratio, symmetric_pad=args.symmetric_pad
34 )(img, boxes)
35 return transformed_img, {"boxes": transformed_boxes, "labels": target["labels"]}
36
37 predictor = ocr_predictor(
38 args.detection,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected