MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / bbox_mapping_back

Function bbox_mapping_back

detrsmpl/core/post_processing/bbox/transforms.py:63–72  ·  view source on GitHub ↗

Map bboxes from testing scale to original image scale.

(bboxes,
                      img_shape,
                      scale_factor,
                      flip,
                      flip_direction='horizontal')

Source from the content-addressed store, hash-verified

61
62
63def bbox_mapping_back(bboxes,
64 img_shape,
65 scale_factor,
66 flip,
67 flip_direction='horizontal'):
68 """Map bboxes from testing scale to original image scale."""
69 new_bboxes = bbox_flip(bboxes, img_shape,
70 flip_direction) if flip else bboxes
71 new_bboxes = new_bboxes.view(-1, 4) / new_bboxes.new_tensor(scale_factor)
72 return new_bboxes.view(bboxes.shape)
73
74
75def bbox2roi(bbox_list):

Callers

nothing calls this directly

Calls 1

bbox_flipFunction · 0.85

Tested by

no test coverage detected