From 6a9e8a28d2e71c54dca0b2403788afcce652ceb8 Mon Sep 17 00:00:00 2001 From: pollfly <75068813+pollfly@users.noreply.github.com> Date: Sun, 24 Mar 2024 10:49:28 +0200 Subject: [PATCH] Add Hyper-Dataset code examples (#806) --- docs/hyperdatasets/code_examples.md | 33 +++++++++++++++++++++++++++++ sidebars.js | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docs/hyperdatasets/code_examples.md diff --git a/docs/hyperdatasets/code_examples.md b/docs/hyperdatasets/code_examples.md new file mode 100644 index 00000000..eefaeae4 --- /dev/null +++ b/docs/hyperdatasets/code_examples.md @@ -0,0 +1,33 @@ +--- +title: Code Examples +--- + +The following examples demonstrate registering, retrieving, and ingesting your data through the Hyper-Datasets python +interface. + +## Registering your Data +* [register_dataset_with_roi.py](https://github.com/allegroai/clearml/blob/master/examples/hyperdatasets/data-registration/register_dataset_with_roi.py) - Demonstrates +creating a new DatasetVersion and adding to it frames, supporting ROI annotations and metadata +* [register_dataset_masks.py](https://github.com/allegroai/clearml/blob/master/examples/hyperdatasets/data-registration/register_dataset_masks.py) - Demonstrates +creating a new DatasetVersion and adding to it frames containing masks. This example also demonstrates the +DatasetVersion-level [pixel segmentation masks](masks.md#pixel-segmentation-masks). + +After executing either of these scripts, you can view your DatasetVersion contents and details in the UI. + +## Using your Data +### Dataviews +The [dataview_example_framegroup.py](https://github.com/allegroai/clearml/blob/master/examples/hyperdatasets/data-ingestion/dataview_example_framegroup.py) +and [dataview_example_singleframe.py](https://github.com/allegroai/clearml/blob/master/examples/hyperdatasets/data-ingestion/dataview_example_singleframe.py) +examples demonstrate how to use a [DataView](dataviews.md) to retrieve your data as SingleFrames and FrameGroups as +part of a running experiment. This is done by creating a DataView query and then retrieving the corresponding frames. + +DataView details are displayed in the UI in an experiment's **DATAVIEWS** tab. + + +### Data Ingestion +The [pytorch_dataset_example.py](https://github.com/allegroai/clearml/blob/master/examples/hyperdatasets/data-ingestion/pytorch_dataset_example.py) +example demonstrates how to feed your DataViews to an ML framework by creating a DataView query and wrapping it as a +PyTorch Dataset. + +The [pytorch_dataset_example_with_masks.py](https://github.com/allegroai/clearml/blob/master/examples/hyperdatasets/data-ingestion/pytorch_dataset_example_with_masks.py) +example demonstrates the additional actions required when your frames contain masks. \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index 41d994c9..6bf18e67 100644 --- a/sidebars.js +++ b/sidebars.js @@ -287,7 +287,8 @@ module.exports = { }, 'hyperdatasets/webapp/webapp_annotator' ] - } + }, + 'hyperdatasets/code_examples' ], sdkHyperDataset: [ {'Hyper-Dataset': ['references/hyperdataset/hyperdataset', 'references/hyperdataset/hyperdatasetversion']},