Skip to content

Commit

Permalink
guide for pose estimation - flipping (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsdonghao authored Nov 2, 2018
1 parent 9d125ca commit 1e7b806
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/modules/prepro.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
API - Data Pre-processing
API - Data Pre-Processing
=========================

.. automodule:: tensorlayer.prepro
Expand Down Expand Up @@ -221,7 +221,7 @@ The sequential transformation can be represented as ``y = Tk (... T1(x))``,
and the time complexity is ``O(k N)`` where ``N`` is the cost of applying one transformation to image ``x``.
``N`` is linear to the size of ``x``.
For the combined transformation ``y = (Tk ... T1) (x)``
the time complexity is ``O(27(k - 1) + N) = max{O(27k), O(N)} = O(N)`` (assuming 27k << N) where 27 = 3^3 is the cost for combine two transformations.
the time complexity is ``O(27(k - 1) + N) = max{O(27k), O(N)} = O(N)`` (assuming 27k << N) where 27 = 3^3 is the cost for combining two transformations.


Get rotation matrix
Expand Down
8 changes: 7 additions & 1 deletion tensorlayer/prepro.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ def affine_transform_keypoints(coords_list, transform_matrix):
"""Transform keypoint coordinates according to a given affine transform matrix.
OpenCV format, x is width.
Note that, for pose estimation task, flipping requires maintaining the left and right body information.
We should not flip the left and right body, so please use ``tl.prepro.keypoint_random_flip``.
Parameters
-----------
coords_list : list of list of tuple/list
Expand Down Expand Up @@ -3995,7 +3998,10 @@ def keypoint_random_flip(
prob : float, 0 to 1
The probability to flip the image, if 1, always flip the image.
flip_list : tuple of int
Denotes how the keypoints number be changed after flipping. Default COCO format.
Denotes how the keypoints number be changed after flipping which is required for pose estimation task.
The left and right body should be maintained rather than switch.
(Default COCO format).
Set to an empty tuple if you don't need to maintain left and right information.
Returns
----------
Expand Down

0 comments on commit 1e7b806

Please sign in to comment.