keras_retinanet.backend package

Submodules

keras_retinanet.backend.cntk_backend module

Copyright 2017-2018 Fizyr (https://fizyr.com)

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

keras_retinanet.backend.common module

Copyright 2017-2018 Fizyr (https://fizyr.com)

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

keras_retinanet.backend.common.bbox_transform_inv(boxes, deltas, mean=None, std=None)[source]

Applies deltas (usually regression results) to boxes (usually anchors).

Before applying the deltas to the boxes, the normalization that was previously applied (in the generator) has to be removed. The mean and std are the mean and std as applied in the generator. They are unnormalized in this function and then applied to the boxes.

Args
boxes : np.array of shape (B, N, 4), where B is the batch size, N the number of boxes and 4 values for (x1, y1, x2, y2). deltas: np.array of same shape as boxes. These deltas (d_x1, d_y1, d_x2, d_y2) are a factor of the width/height. mean : The mean value used when computing deltas (defaults to [0, 0, 0, 0]). std : The standard deviation used when computing deltas (defaults to [0.2, 0.2, 0.2, 0.2]).
Returns
A np.array of the same shape as boxes, but with deltas applied to each box. The mean and std are used during training to normalize the regression values (networks love normalization).
keras_retinanet.backend.common.shift(shape, stride, anchors)[source]

Produce shifted anchors based on shape of the map and stride size.

Args
shape : Shape to shift the anchors over. stride : Stride to shift the anchors with over the shape. anchors: The anchors to apply at each location.

keras_retinanet.backend.dynamic module

keras_retinanet.backend.tensorflow_backend module

Copyright 2017-2018 Fizyr (https://fizyr.com)

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

keras_retinanet.backend.tensorflow_backend.clip_by_value(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/clip_by_value .

keras_retinanet.backend.tensorflow_backend.gather_nd(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/gather_nd .

keras_retinanet.backend.tensorflow_backend.map_fn(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/map_fn .

keras_retinanet.backend.tensorflow_backend.meshgrid(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/meshgrid .

keras_retinanet.backend.tensorflow_backend.non_max_suppression(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/image/non_max_suppression .

keras_retinanet.backend.tensorflow_backend.ones(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/ones .

keras_retinanet.backend.tensorflow_backend.pad(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/pad .

keras_retinanet.backend.tensorflow_backend.range(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/range .

keras_retinanet.backend.tensorflow_backend.resize_images(images, size, method='bilinear', align_corners=False)[source]

See https://www.tensorflow.org/versions/r1.14/api_docs/python/tf/image/resize_images .

Args
method: The method used for interpolation. One of (‘bilinear’, ‘nearest’, ‘bicubic’, ‘area’).
keras_retinanet.backend.tensorflow_backend.scatter_nd(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/scatter_nd .

keras_retinanet.backend.tensorflow_backend.top_k(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/nn/top_k .

keras_retinanet.backend.tensorflow_backend.transpose(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/transpose .

keras_retinanet.backend.tensorflow_backend.unstack(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/unstack .

keras_retinanet.backend.tensorflow_backend.where(*args, **kwargs)[source]

See https://www.tensorflow.org/api_docs/python/tf/where .

keras_retinanet.backend.theano_backend module

Copyright 2017-2018 Fizyr (https://fizyr.com)

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Module contents