This PR contains a major refactoring of the code for the GUI. There are several changes, including the following:
All GUI code is under the LabGym/gui subpackage. The package exposes a function called gui() which can be called to start LabGym, which will maintain compatibility with the from LabGym import gui; gui.gui() method to start the app. Within the gui package, the code is further organized into packages corresponding to the Preprocessing, Training, and Analysis modules. This organization helps separate the GUI code from the rest of the code.
Many of the windows in LabGym have a similar appearance, i.e. buttons next to text explaining the button. There is now a LabGymWindow class from which all windows should inherit. This class contains functions which make it simple to add new button/text modules while maintaining the same appearance across all windows.
Several key functions have been moved out of the GUI package and into the backend, most notably test_detectors() and train_detectors(). The goal is to (eventually) remove any dependency on modules like os, json, detectron2, etc. in the GUI code -- the GUI should only be concerned with getting user input, formatting it correctly, and passing it onto the backend. This process is almost complete, but won't be fully complete until the backend code is refactored, which will be happening in the next project.
Version checking functionality has been rewritten and moved to __main__.py. The code for parsing versions now relies on the packaging module on PyPI, which is written by the core Python developers to parse package version numbers. I've added this dependency to setup.py to ensure it's installed when users install LabGym from PyPI.
This PR contains a major refactoring of the code for the GUI. There are several changes, including the following:
LabGym/gui
subpackage. The package exposes a function calledgui()
which can be called to start LabGym, which will maintain compatibility with thefrom LabGym import gui; gui.gui()
method to start the app. Within thegui
package, the code is further organized into packages corresponding to the Preprocessing, Training, and Analysis modules. This organization helps separate the GUI code from the rest of the code.LabGymWindow
class from which all windows should inherit. This class contains functions which make it simple to add new button/text modules while maintaining the same appearance across all windows.test_detectors()
andtrain_detectors()
. The goal is to (eventually) remove any dependency on modules likeos
,json
,detectron2
, etc. in the GUI code -- the GUI should only be concerned with getting user input, formatting it correctly, and passing it onto the backend. This process is almost complete, but won't be fully complete until the backend code is refactored, which will be happening in the next project.__main__.py
. The code for parsing versions now relies on thepackaging
module on PyPI, which is written by the core Python developers to parse package version numbers. I've added this dependency tosetup.py
to ensure it's installed when users install LabGym from PyPI.