Skip to content
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

Swing visualization refactoring #451

Merged
merged 11 commits into from
Sep 19, 2022

Conversation

juliabeliaeva
Copy link
Contributor

This PR rewrites swing-based visualisation, cleaning-up code and removing duplications. Major changes are:

  • All detection results are converted to our detected result classes. This allows to reuse visualisation code for them.
  • Frames are replaced with panels, allowing to combine several images on a single frame.
  • Remove unnecessary conversion from BufferedImage to FloatArray and back, and unnecessary preprocessing before visualisation.
  • Use correct proportions for images.
  • Remove poses with low confidence score.

Example.
Before:
image
After:
image

Always convert raw output to the high-level objects. This allows to reuse the same visualization methods and to get rid of the extra code.
This allows to get rid of the unnecessary conversion of the image to FloatArray and back, and use the input image as is (applying preprocessing only to resize it when needed).
* Use antialiasing
* Use float coordinates instead of integers
* Draw pose edges under vertices
* Use default font face and size for labels
* Adjust labels location
* Specify precision for outputting probability
* Cleanup code
This allows to show detection results for several images in one frame.
@juliabeliaeva juliabeliaeva merged commit 9ca9a97 into Kotlin:master Sep 19, 2022
juliabeliaeva added a commit that referenced this pull request Sep 19, 2022
* Remove unused code

* Move detected result visualization to a separate file

* Remove visualization methods for the raw output

Always convert raw output to the high-level objects. This allows to reuse the same visualization methods and to get rid of the extra code.

* Extract method to show a frame with content

* Move ImagePanel to the visualization package

* Use BufferedImage to visualize detection results

This allows to get rid of the unnecessary conversion of the image to FloatArray and back, and use the input image as is (applying preprocessing only to resize it when needed).

* Extract functions to draw detection results on a graphics and remove duplication

* Enhance detection results visualization

  * Use antialiasing
  * Use float coordinates instead of integers
  * Draw pose edges under vertices
  * Use default font face and size for labels
  * Adjust labels location
  * Specify precision for outputting probability
  * Cleanup code

* Replace functions showing frames with functions returning panels

This allows to show detection results for several images in one frame.

* Skip low-confidence pose detection results

* Add documentation
@juliabeliaeva juliabeliaeva deleted the jvm-visualization branch October 12, 2022 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants