MCPcopy Create free account
hub / github.com/BICLab/SpikeYOLO / convert

Function convert

coco2yolo.py:18–30  ·  view source on GitHub ↗
(size, box)

Source from the content-addressed store, hash-verified

16
17
18def convert(size, box):
19 dw = 1. / (size[0])
20 dh = 1. / (size[1])
21 x = box[0] + box[2] / 2.0
22 y = box[1] + box[3] / 2.0
23 w = box[2]
24 h = box[3]
25
26 x = x * dw
27 w = w * dw
28 y = y * dh
29 h = h * dh
30 return (x, y, w, h)
31
32
33if __name__ == '__main__':

Callers 1

coco2yolo.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected