Skip to content

Commit 61d1601

Browse files
author
Beat Buesser
committed
Updates for review comments
Signed-off-by: Beat Buesser <[email protected]>
1 parent 26485f0 commit 61d1601

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

art/estimators/object_detection/tensorflow_faster_rcnn.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,11 @@ def loss_gradient( # pylint: disable=W0221
332332
:param y: Targets of format `List[Dict[str, np.ndarray]]`, one for each input image. The fields of the Dict are
333333
as follows:
334334
335-
- boxes [N, 4]: the boxes in [y1, x1, y2, x2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
336-
Can be changed to PyTorch format with `standardise_output=True`.
337-
- labels [N]: the labels for each image
335+
- boxes [N, 4]: the boxes in [y1, x1, y2, x2] in scale [0, 1] (`standardise_output=False`) or
336+
[x1, y1, x2, y2] in image scale (`standardise_output=True`) format,
337+
with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
338+
- labels [N]: the labels for each image in TensorFlow (`standardise_output=False`) or PyTorch
339+
(`standardise_output=True`) format
338340
- scores [N]: the scores or each prediction.
339341
340342
:param standardise_output: True if `y` is provided in standardised PyTorch format. Box coordinates will be
@@ -401,14 +403,14 @@ def predict( # pylint: disable=W0221
401403
scaled from [0, 1] to image dimensions, label index will be increased by 1 to adhere
402404
to COCO categories and the boxes will be changed to [x1, y1, x2, y2] format, with
403405
0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
404-
:return: A dictionary containing the following fields:
405406
406407
:return: Predictions of format `List[Dict[str, np.ndarray]]`, one for each input image. The
407408
fields of the Dict are as follows:
408409
409410
- boxes [N, 4]: the boxes in [y1, x1, y2, x2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
410411
Can be changed to PyTorch format with `standardise_output=True`.
411-
- labels [N]: the labels for each image
412+
- labels [N]: the labels for each image in TensorFlow format. Can be changed to PyTorch format with
413+
`standardise_output=True`.
412414
- scores [N]: the scores or each prediction.
413415
"""
414416
# Only do prediction if is_training is False

art/estimators/object_detection/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def convert_pt_to_tf(y: List[Dict[str, np.ndarray]], height: int, width: int) ->
7171
:return: Target values of format `List[Dict[Tensor]]`, one for each input image. The fields of the Dict are as
7272
follows:
7373
74-
- boxes (FloatTensor[N, 4]): the boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and
74+
- boxes (FloatTensor[N, 4]): the boxes in [y1, x1, y2, x2] format, with 0 <= x1 < x2 <= W and
7575
0 <= y1 < y2 <= H in scale [0, 1].
7676
- labels (Int64Tensor[N]): the labels for each image
7777
- scores (Tensor[N]): the scores or each prediction.

0 commit comments

Comments
 (0)