Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tensorlayer/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,9 @@ def save_joints():
head_x2s = anno['annorect']['x2'][0]
head_y2s = anno['annorect']['y2'][0]
for annopoint, head_x1, head_y1, head_x2, head_y2 in zip(annopoints, head_x1s, head_y1s, head_x2s, head_y2s):
if annopoint != []:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some python style guide suggests using implicit false,
e.g. https://google.github.io/styleguide/pyguide.html?showone=True/False_evaluations#True/False_evaluations
(I finally found one example.)

@luomai @DEKHTIARJonathan do you like implicit false?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as long as we can keep this consistent in our coding style.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would defintely go toward the google coding guidelines. TL is an API on top of google product. In order to facilitate the learning curve, we should keep, to my mind, the same pratices whenever it is possible. I perfectly agree with @lgarithm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zsdonghao could you change this line to implicit false? Namely if annopoint:

# if annopoint != []:
# if len(annopoint) != 0:
if annopoint.size:
head_rect = [float(head_x1[0, 0]), float(head_y1[0, 0]), float(head_x2[0, 0]), float(head_y2[0, 0])]

# joint coordinates
Expand Down