TrainValSplits
Introduction
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.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Input |
|
| Path to input |
|
| Shuffle data and split with defined probability |
|
| Images should have assigned train or val tag |
|
| Select one or several datasets for every split |
|
| ID of the widget |
project_id
Determine input Project
ID.
type: int
default value: None
project_fs
Determine path to input Project
on local host.
type: str
default value: None
random_splits
Shuffle data and split with defined probability.
type: bool
default value: true
tags_splits
Images should have assigned train or val tag.
type: bool
default value: true
datasets_splits
Select one or several datasets for every split.
type: bool
default value: true
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Return result train/val split. |
| Disable widget. |
| Enable widget. |
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/controls/006_train_val_splits/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare project_id, download project and create project_fs
Initialize TrainValSplits
widget
TrainValSplits
widgetInitialize Button
and Text
widget we will use
Button
and Text
widget we will useCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Add function to control widgets from python code
Last updated