MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / convert

Function convert

tensorlayer/files/utils.py:1598–1609  ·  view source on GitHub ↗
(size, box)

Source from the content-addressed store, hash-verified

1596
1597 # parse XML annotations
1598 def convert(size, box):
1599 dw = 1. / size[0]
1600 dh = 1. / size[1]
1601 x = (box[0] + box[1]) / 2.0
1602 y = (box[2] + box[3]) / 2.0
1603 w = box[1] - box[0]
1604 h = box[3] - box[2]
1605 x = x * dw
1606 w = w * dw
1607 y = y * dh
1608 h = h * dh
1609 return x, y, w, h
1610
1611 def convert_annotation(file_name):
1612 """Given VOC2012 XML Annotations, returns number of objects and info."""

Callers 1

convert_annotationFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…