TrainValSplits
Last updated
Last updated
TrainValSplits
widget in Supervisely is a tool that helps with the creation of training and validation datasets. The widget allows for easy splitting of the original dataset into training and validation sets based on customizable parameters such as percentage split or based on datasets or specific tag. TrainValSplits
helps improve the performance of machine learning models by ensuring that they are trained on diverse and representative data.
project_id
int
Input Project
ID
project_fs
str
Path to input Project
on local host
random_splits
bool
Shuffle data and split with defined probability
tags_splits
bool
Images should have assigned train or val tag
datasets_splits
bool
Select one or several datasets for every split
widget_id
str
ID of the widget
Determine input Project
ID.
type: int
default value: None
Determine path to input Project
on local host.
type: str
default value: None
Shuffle data and split with defined probability.
type: bool
default value: true
Images should have assigned train or val tag.
type: bool
default value: true
Select one or several datasets for every split.
type: bool
default value: true
ID of the widget.
type: str
default value: None
get_splits()
Return result train/val split.
disable()
Disable widget.
enable()
Enable widget.
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/controls/006_train_val_splits/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
TrainValSplits
widgetButton
and Text
widget we will usePrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.