--- title: Graphical user interface keywords: fastai sidebar: home_sidebar summary: "Simple GUI with ipywidgets." description: "Simple GUI with ipywidgets." nb_path: "nbs/08_gui.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %}

Logging

{% raw %}

exception_handler[source]

exception_handler(exception_type, exception, tb)

{% endraw %} {% raw %}
{% endraw %}

Helper Functions

{% raw %}

set_css_in_cell_output[source]

set_css_in_cell_output()

{% endraw %} {% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}
{% endraw %}

Widgets

Base Widgets

{% raw %}

class ZipUpload[source]

ZipUpload(path=None, layout=None)

Widgets upload and extract zip files

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = ZipUpload()
t.widget
{% endraw %} {% raw %}

class ItemsPerPage[source]

ItemsPerPage(path=None, plot_fn=None, items={}, srt=True, srt_by='name', srt_index=0, **kwargs)

Dropdown to show n items per page

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = ItemsPerPage(srt_index=1)
t.widget
{% endraw %} {% raw %}

class BaseParamWidget[source]

BaseParamWidget(config=None)

Parameter Widget Base Class

{% endraw %} {% raw %}
{% endraw %} {% raw %}

class BaseUI[source]

BaseUI(config=None, path=None)

Base UI for different steps

{% endraw %} {% raw %}
{% endraw %}

Path Widgets

{% raw %}

class PathSelector[source]

PathSelector(start_dir, select_name='Select', select_file=False, tooltip=None)

Widgets to browse and select files or directories

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = PathSelector('')
display(t.button, t.dialog)
{% endraw %} {% raw %}

class PathDownloads[source]

PathDownloads(*args, **kwargs) :: PathSelector

Widgets to browse and download files or directories

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = PathDownloads('', select_file=True)
display(t.button, t.dialog)
{% endraw %} {% raw %}

class PathConfig[source]

PathConfig(*args, **kwargs) :: PathSelector

Widgets to browse and and load config file

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = PathConfig('', select_file=True)
display(t.button, t.dialog)
{% endraw %}

Table Widget

{% raw %}

class ResultWidget[source]

ResultWidget()

Widget to show results from panads DataFrames

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = ResultWidget()
t.widget.layout.display = "block"  
t.widget
{% endraw %}

Grund Truth Estimation Widgets

{% raw %}
{% endraw %} {% raw %}

class GTDataSB[source]

GTDataSB(path=None, **kwargs) :: BaseParamWidget

Layout for Grund Truth Estimation "Data" Section

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=GTDataSB()
t.widget
{% endraw %} {% raw %}

class GTEstSB[source]

GTEstSB(path=None, **kwargs) :: BaseParamWidget

Layout for Grund Truth Estimation "Data" Section

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=GTEstSB()
t.widget
{% endraw %}

Grund Truth Estimation UI

{% raw %}

class GTEstUI[source]

GTEstUI(hide=False, **kwargs) :: BaseUI

UI for ground truth estimation

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=GTEstUI()
t.sb_acc
{% endraw %}

Train Widgets

{% raw %}
{% endraw %} {% raw %}

class TrainDataSB[source]

TrainDataSB(path=None, **kwargs) :: BaseParamWidget

Layout for "Training Data" Section

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=TrainDataSB('')
t.widget
{% endraw %} {% raw %}

class TrainModelSB[source]

TrainModelSB(**kwargs) :: BaseParamWidget

Layout for "Ensemble Training"

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=TrainModelSB()
t.widget
{% endraw %} {% raw %}

class TrainValidSB[source]

TrainValidSB(path=None, **kwargs) :: BaseParamWidget

Layout for "Validation" Section

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=TrainValidSB()
t.widget
{% endraw %}

Pop-Up Widgets

{% raw %}

class LRWidget[source]

LRWidget()

Widget for Learning Rate Finder

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = LRWidget()
t.widget.layout.display = "block"  
t.widget
{% endraw %} {% raw %}

class BasePopUpParamWidget[source]

BasePopUpParamWidget(**kwargs) :: BaseParamWidget

Parameter Pop-Up Widget Base Class

{% endraw %} {% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class ParamWidget[source]

ParamWidget(**kwargs) :: BasePopUpParamWidget

Widget for custom training parameters

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=ParamWidget(config=Config(batch_size=8))
t.widget.layout.display = "block"    
t.widget
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class MWWidget[source]

MWWidget(**kwargs) :: BasePopUpParamWidget

Widget to customize loss functions

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=MWWidget(config=Config())
t.widget.layout.display = "block"  
t.widget
{% endraw %}

Train UI

{% raw %}

class TrainUI[source]

TrainUI(hide=False, **kwargs) :: BaseUI

UI for ensemble training

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=TrainUI('')
t.sb_acc
{% endraw %}

Prediction Widgets

{% raw %}
{% endraw %} {% raw %}

class PredInputSB[source]

PredInputSB(path=None, **kwargs) :: BaseParamWidget

Layout for "Data and Ensemble" Section

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=PredInputSB('')
t.widget
{% endraw %} {% raw %}

class PredSB[source]

PredSB(path=None, **kwargs) :: BaseParamWidget

Layout for "Prediction and Quality Control" Section

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=PredSB()
t.widget
{% endraw %} {% raw %}

class CellposeSB[source]

CellposeSB(path=None, **kwargs) :: BaseParamWidget

Layout for instance separation with cellpose

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=CellposeSB()
t.widget
{% endraw %}

Prediction UI

{% raw %}

class PredUI[source]

PredUI(hide=False, **kwargs) :: BaseUI

UI for prediction of new data

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t=PredUI('')
t.sb_acc
{% endraw %}

GUI

{% raw %}

class GUI[source]

GUI(path=Path('.'), reinit=False) :: GetAttr

GUI for deepflash2

{% endraw %} {% raw %}
{% endraw %} {% raw %}
t = GUI()
{% endraw %} {% raw %}
shutil.rmtree(t.train_dir)
shutil.rmtree(t.pred_dir)
shutil.rmtree(t.gt_dir)
{% endraw %}