-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from TravisWheelerLab/develop
New Release: v0.0.9
- Loading branch information
Showing
13 changed files
with
159 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
Changes for this version of diplomat: | ||
- Improved video player widget, with lag reduction when backtracking. | ||
- Two new UI labelers for source only placement of points. | ||
- Less lag for plots on the side in the UI when scrolling. | ||
- UI moved to it's own module and added to documentation. | ||
- Several additional minor bug fixes. | ||
Changes for this version of DIPLOMAT: | ||
- Fixed installation process for DIPLOMAT with SLEAP on windows by adding keras dependency. | ||
- Added support for changing some UI appearance settings to DIPLOMAT's supervised and tweak UI. | ||
- Make SLEAP frontend error out unless a user explicitly passes a number of outputs parameter. | ||
- Improved point rendering in the UI (proper alpha transparency support and smoother point rendering). |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from typing import Any, Callable, List, Optional | ||
import wx | ||
from diplomat.processing import Config | ||
from diplomat.wx_gui.labeler_lib import SettingWidget, SettingCollection, SettingCollectionWidget | ||
|
||
|
||
class DropDown(SettingWidget): | ||
def __init__(self, options: List[Any], option_names: Optional[List[str]] = None, default: int = 0, **kwargs): | ||
if(len(options) == 0): | ||
raise ValueError("No options offered!") | ||
if(option_names is None): | ||
option_names = [str(o) for o in options] | ||
if(len(option_names) != len(options)): | ||
raise ValueError("Options and name arrays don't have the same length.") | ||
self._options = list(options) | ||
self._option_names = option_names | ||
if(not (0 <= default < len(options))): | ||
raise ValueError("Default index is out of bounds!") | ||
self._default = int(default) | ||
self._kwargs = kwargs | ||
self._hook = None | ||
self._value = default | ||
|
||
def set_hook(self, hook: Callable[[str], None]): | ||
self._hook = hook | ||
|
||
def get_new_widget(self, parent=None) -> wx.Control: | ||
text_list = wx.Choice(parent, choices=self._option_names, style=wx.LB_SINGLE, **self._kwargs) | ||
text_list.SetSelection(self._default) | ||
|
||
def val_change(evt): | ||
sel = text_list.GetSelection() | ||
if(sel == wx.NOT_FOUND): | ||
text_list.SetSelection(self._default) | ||
self._value = self._default | ||
else: | ||
self._value = sel | ||
|
||
if(self._hook is not None): | ||
self._hook(self._options[self._value]) | ||
|
||
text_list.Bind(wx.EVT_CHOICE, val_change) | ||
|
||
return text_list | ||
|
||
def get_value(self) -> Any: | ||
return self._options[self._value] | ||
|
||
|
||
class SettingsDialog(wx.Dialog): | ||
def __init__(self, *args, title: str = "Settings", settings: SettingCollection, **kwargs): | ||
super().__init__(*args, title=title, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs) | ||
|
||
self._parent_layout = wx.BoxSizer(wx.VERTICAL) | ||
|
||
self._settings = settings | ||
self._setting_widget = SettingCollectionWidget(self, title=title, collapsable=False) | ||
self._setting_widget.set_setting_collection(settings) | ||
self._parent_layout.Add(self._setting_widget, proportion=1, flag=wx.EXPAND | wx.ALL) | ||
|
||
self._buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL) | ||
self._parent_layout.Add(self._buttons, proportion=0, flag=wx.EXPAND | wx.ALL) | ||
|
||
self.SetSizerAndFit(self._parent_layout) | ||
|
||
def get_values(self) -> Config: | ||
return self._settings.get_values() |
This file contains 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