Fix incorrect bounding box variables in yawn detection scripts#38
Open
Deepthanush1337 wants to merge 1 commit intohumanai-foundation:mainfrom
Open
Fix incorrect bounding box variables in yawn detection scripts#38Deepthanush1337 wants to merge 1 commit intohumanai-foundation:mainfrom
Deepthanush1337 wants to merge 1 commit intohumanai-foundation:mainfrom
Conversation
In noYawn.py: - result.boxes.xywhn always returned the first detection's coords regardless of which box the loop was on. Changed to box.xywhn so each face gets its own bounding box written to the label file. - The eyes loop used the face-loop variable (box) instead of box_eyes to extract xyxy coords, so eye rectangles were drawn over faces instead of eyes. Changed to box_eyes.xyxy. - Removed redundant f.close() after a with-block. In yawn_SPIGA_single.py and yawn_SPIGA_folder.py: - Same result.boxes.xywhn issue fixed to box.xywhn. - Removed redundant f.close() calls.
5f6adf4 to
48ada02
Compare
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.
Found a couple of bounding box bugs in the fatigue detection scripts:
noYawn.py:
result.boxes.xywhn.cpu().numpy()[0]always grabs the first detection regardless of whichboxthe loop is iterating over. Changed tobox.xywhnso each face gets its own coordinates in the label file.box.xyxywas used instead ofbox_eyes.xyxy, so the rectangle was drawn on the face bounding box rather than the eye bounding box. Fixed tobox_eyes.xyxy.f.close()after awithblock (file is already closed by the context manager).yawn_SPIGA_single.py and yawn_SPIGA_folder.py:
result.boxes.xywhn->box.xywhnfix.f.close()cleanup.