Prevent test_cnn.py from crashing w/invalid Tensor label#3
Merged
taras-luxonis merged 1 commit intoluxonis:masterfrom Jan 14, 2020
Merged
Conversation
When an object is detected and then leaves the image, the Tensor label
returned is typically far outside the list of label indexes (ex: 7552.0). This
causes the `test_cnn.py` to crash.
This checks to ensure the index is within the available labels before
applying the label text.
The exception:
```
Traceback (most recent call last):
File "test_cnn.py", line 85, in <module>
cv2.putText(frame, labels[int(e[0]['label'])], pt_t1, cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 2)
IndexError: list index out of range
```
|
Thanks man! I just tried to tag Yurii but his handle isn’t auto-populating on my phone for some reason. Will ping him in slack. |
SzabolcsGergely
pushed a commit
that referenced
this pull request
Oct 30, 2020
Prevent test_cnn.py from crashing w/invalid Tensor label
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an object is detected and then leaves the image, the Tensor label returned is typically far outside the list of label indexes (ex: 7552.0). This causes the
test_cnn.pyto crash.This checks to ensure the index is within the available labels before applying the label text.
The exception: