Closed eberrigan closed 3 months ago
The recent changes enhance the Sleap application's graphical representation by integrating Matplotlib as the primary plotting framework while retaining QtCharts functionality. This transition includes the introduction of a new LossPlot
class and updates to the LossViewer
for improved management and visualization of training metrics.
Files | Change Summary |
---|---|
sleap/gui/widgets/monitor.py |
Introduced LossPlot class for plotting training/validation loss with Matplotlib; refactored LossViewer methods for better data handling and visualization. |
sleap/nn/training.py , sleap/gui/widgets/mpl.py |
Changed Matplotlib backend from "Qt5Agg" to "QtAgg" in both setup_visualization and mpl.py , enhancing compatibility. |
sleap/gui/app.py |
Removed a blank line; no functional changes. |
sequenceDiagram
participant User
participant LossViewer
participant LossPlot
User->>LossViewer: Request to visualize loss data
LossViewer->>LossPlot: Create LossPlot instance
LossPlot-->>LossViewer: Return plot
LossViewer->>LossPlot: Add training/validation loss data
LossPlot-->>LossViewer: Update visualization
LossViewer->>User: Display updated loss chart
In the garden, data blooms bright,
With LossPlot, a new delight!
From Qt's grasp, we've set it free,
Now plots dance in harmony.
Hoppity hop, let graphs take flight,
Visual magic, pure and bright! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Still need TODOs:
Attention: Patch coverage is 71.96653%
with 67 lines
in your changes missing coverage. Please review.
Project coverage is 75.48%. Comparing base (
7ed1229
) to head (a4c2905
). Report is 38 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
sleap/gui/widgets/monitor.py | 71.61% | 67 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
In a downstream branch #1841, we upgrade all of the dependencies to use Python 3.10. However,
QtCharts
is problematic--it is missing libraries in updatedPySide6
We are only using
QtCharts
in theLossViewer
, so, in this PR, we replaceQtCharts
withmatplotlib
. ALossPlot
class that subclassesMplCanvas
is added to handle the plotting functionality previously mixed intoLossViewer
. The unused duplicate of theLossViewer
in training_monitor.py is removed. To maintain scope, the refactoredLossViewer
re-uses same logic and only replacesQtCharts
withmatplotlib
.⚠️ In testing the refactored
LossViewer
, we came across a "leaked semaphore" error that seemed to occur only for (a?) bottom-up model(s?) on (a?) Mac M2(s?). This issue will be further investigated, but has been deemed unrelated to the refactoring in this PR as it was replicated on the base develop branch as well (and seems more likely to be model/configuration related).Types of changes
Does this address any currently open issues?
1841
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart:
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Refactor