-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When boxes is empty, it throws an error. #7
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution.
- Please use
flake8
to check your coding style. - You are using
unknown
as your name. Is it OK? After merging your PR, you can not change it.
lib/multibox_encoder.py
Outdated
if len(all_boxes) != 0 : | ||
return np.stack(all_boxes), np.stack(all_labels), np.stack(all_scores) | ||
else: | ||
return np.zeros(0),np.zeros(0),np.zeros(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shape of boxes
should be (0, 4)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zeros
-> empty
lib/multibox_encoder.py
Outdated
if len(all_boxes) != 0 : | ||
return np.stack(all_boxes), np.stack(all_labels), np.stack(all_scores) | ||
else: | ||
return np.zeros(0),np.zeros(0),np.zeros(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zeros
-> empty
lib/multibox_encoder.py
Outdated
@@ -88,5 +88,7 @@ def decode(self, loc, conf, nms_threshold, conf_threshold): | |||
all_boxes.append(label_boxes[i]) | |||
all_labels.append(label) | |||
all_scores.append(label_scores[i]) | |||
|
|||
return np.stack(all_boxes), np.stack(all_labels), np.stack(all_scores) | |||
if len(all_boxes) != 0 : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!=
-> >
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I did't know these checking tool.
It leads the beginner like me to write proper code.
Sorry, I don't know how to re-request pull request. Could you get my second version? |
You can use |
I have already pushed the commitment into boxemptybugfix branch. In my browser, I can see the my second source with the comment ("refactored on plint, flake8 and so on 9f60f42.") on the line. And in "files changes" tabs, second source are shown. I have to leave my office. |
I can see two commits: |
This version only obeys flake8 (pylint seems dislking "len()") |
Please check #7 (comment) and #7 (review) .2 |
lib/multibox_encoder.py
Outdated
@@ -93,4 +93,4 @@ def decode(self, loc, conf, nms_threshold, conf_threshold): | |||
np.stack(all_labels), \ | |||
np.stack(all_scores) | |||
else: | |||
return np.empty(0), np.empty(0), np.empty(0) | |||
return np.empty((0,4)), np.empty((0,4)), np.empty((0,4)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.empty(0)
for labels
and scores
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return np.empty((0,4)), np.empty(0), np.empty(0)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good (don't forget to use flake8
)
I found you changed the author name of commits. But the name for the first two commits are still |
It is difficult to change name on my git-tool. |
The only problem of |
Hakuyume-san, thank you very much. |
When boxes is empty, it throws an error.