When boxes is empty, it throws an error.#7
When boxes is empty, it throws an error.#7sitifukujin wants to merge 5 commits intoHakuyume:masterfrom
Conversation
Hakuyume
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
- Please use
flake8to check your coding style. - You are using
unknownas 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.
The shape of boxes should be (0, 4).
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) |
lib/multibox_encoder.py
Outdated
| all_scores.append(label_scores[i]) | ||
|
|
||
| return np.stack(all_boxes), np.stack(all_labels), np.stack(all_scores) | ||
| if len(all_boxes) != 0 : |
sitifukujin
left a comment
There was a problem hiding this comment.
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
| 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.
np.empty(0) for labels and scores.
There was a problem hiding this comment.
return np.empty((0,4)), np.empty(0), np.empty(0)
?
There was a problem hiding this comment.
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.