dataset_classification
About
Load classification dataset
This algorithm allows to load a classification dataset from a given folder. It can also split the dataset into train and validation folders.
Any classification training algorithms from Ikomia HUB can be connected.
🚀 Use with Ikomia API
1. Install Ikomia API
We strongly recommend using a virtual environment. If you're not sure where to start, we offer a tutorial here.
pip install ikomia
2. Create your workflow
from ikomia.dataprocess.workflow import Workflowfrom ikomia.utils import ik# Init your workflowwf = Workflow()# Add the dataset loader to load your custom data and annotationsalgo = wf.add_task(name="dataset_classification", auto_connect=False)algo.set_parameters({"dataset_folder":"path/to/dataset/folder"})# Add the training task to the workflowresnet = wf.add_task(name="train_torchvision_resnet" , auto_connect=True)# Launch your training on your datawf.run()
☀️ Use with Ikomia Studio
Ikomia Studio offers a friendly UI with the same features as the API.
-
If you haven't started using Ikomia Studio yet, download and install it from this page.
-
For additional guidance on getting started with Ikomia Studio, check out this blog post.
📝 Set algorithm parameters
-
dataset_folder (str): Path to the dataset folder.
-
split_dataset (bool, optional): If True, your dataset will be split into train and validation folders.
-
dataset_split_ratio (float, optional) – default: '0.8': Divide the dataset into train and evaluation sets, ]0, 1[.
-
output_folder (str, optional): Path to the output folder where the split dataset will be saved.
-
seed (int, optional) - default '42': A seed value for the dataset slip.
Parameters should be in strings format when added to the dictionary.
import ikomiafrom ikomia.dataprocess.workflow import Workflow# Init your workflowwf = Workflow()# Add algorithmalgo = wf.add_task(name="dataset_classification", auto_connect=False)algo.set_parameters({"dataset_folder":"path/to/dataset/folder","split_dataset": "True","dataset_split_ratio": "0.9","output_folder": "path/to/output/folder","seed": "25"})# Add the training task to the workflowresnet = wf.add_task(name="train_torchvision_resnet" , auto_connect=True)# Launch your training on your datawf.run()
⏩ Advanced usage
The dataset_classification algorithm is designed to load datasets for training classification models from Ikomia HUB.
In addition to its primary purpose, this algorithm offers a convenient feature to effortlessly split the dataset into separate train and validation folders, adhering to the following organized structure:
Dataset_folder├── train│ ├── class-one│ │ ├── IMG_1.jpg│ │── class-two│ │ ├── IMG_2.jpg│ └── class-three│ ├── IMG_3.jpg├── val│ ├── class-one│ │ ├── IMG_4.jpg│ │── class-two│ │ ├── IMG_5.jpg│ └── class-three│ ├── IMG_6.jpg
Developer
Ikomia
License
MIT License
A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.
Permissions | Conditions | Limitations |
---|---|---|
Commercial use | License and copyright notice | Liability |
Modification | Warranty | |
Distribution | ||
Private use |
This is not legal advice: this description is for informational purposes only and does not constitute the license itself. Provided by choosealicense.com.