-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for framework conversion (#1659)
- Update documentation for framework conversion - Add same notebook in kaggle : [kaggle notebook](https://www.kaggle.com/code/sooahleex/fer-2013-dataset-training-with-datumaro/notebook)
- Loading branch information
Showing
9 changed files
with
530 additions
and
9 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
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
2 changes: 1 addition & 1 deletion
2
...advanced_skills/12_project_versioning.rst → ...advanced_skills/13_project_versioning.rst
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
2 changes: 1 addition & 1 deletion
2
...ced_skills/13_pseudo_label_generation.rst → ...ced_skills/14_pseudo_label_generation.rst
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,5 +1,5 @@ | ||
================================= | ||
Level 13: Pseudo Label Generation | ||
Level 14: Pseudo Label Generation | ||
================================= | ||
|
||
TBD |
2 changes: 1 addition & 1 deletion
2
...el-up/advanced_skills/14_data_pruning.rst → ...el-up/advanced_skills/15_data_pruning.rst
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
56 changes: 56 additions & 0 deletions
56
docs/source/docs/level-up/intermediate_skills/12_framework_conversion.rst
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,56 @@ | ||
============================ | ||
Level 12: Framework Conversion | ||
============================ | ||
|
||
Datumaro allows seamless conversion of datasets to popular deep learning frameworks, such as PyTorch and TensorFlow. | ||
This is particularly useful when you are working with a dataset that needs to be used across different frameworks | ||
without manual reformatting. | ||
|
||
Datumaro provides the FrameworkConverter class, which can be used to convert a dataset for various tasks | ||
like classification, detection, and segmentation. | ||
|
||
Supported Tasks | ||
- Classification | ||
- Multilabel Classification | ||
- Detection | ||
- Instance Segmentation | ||
- Semantic Segmentation | ||
- Tabular Data | ||
|
||
.. tab-set:: | ||
|
||
.. tab-item:: Python | ||
|
||
With the PyTorch framework, you can convert a Datumaro dataset like this: | ||
|
||
.. code-block:: python | ||
from datumaro.plugins.framework_converter import FrameworkConverter | ||
from torchvision import transforms | ||
transform = transforms.Compose([transforms.ToTensor()]) | ||
dm_dataset = ... # Load your dataset here | ||
First, we have to specify the dataset, subset, and task | ||
|
||
.. code-block:: python | ||
multi_framework_dataset = FrameworkConverter(dm_dataset, subset="train", task="classification") | ||
train_dataset = multi_framework_dataset.to_framework(framework="torch", transform=transform) | ||
Through this, we convert the dataset to PyTorch format | ||
|
||
.. code-block:: python | ||
from torch.utils.data import DataLoader | ||
train_loader = DataLoader(train_dataset, batch_size=32) | ||
Now we can use the train_dataset with PyTorch DataLoader | ||
|
||
In this example: | ||
|
||
- `subset="train"` indicates that we are working with the training portion of the dataset. | ||
|
||
- `task="classification"` specifies that this is a classification task. | ||
|
||
- The dataset is converted to PyTorch-compatible format using the `to_framework` method. |
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
Oops, something went wrong.