mirror of
https://github.com/clearml/clearml-docs
synced 2025-06-23 02:06:01 +00:00
Small edits
This commit is contained in:
parent
1a6fce1f64
commit
8fb860e28c
@ -146,6 +146,8 @@ You can retrieve the Dataview frames using [`DataView.to_list()`](../references/
|
|||||||
This example uses an ROI query to filter for frames containing at least one ROI with the label `cat`:
|
This example uses an ROI query to filter for frames containing at least one ROI with the label `cat`:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView, IterationOrder
|
||||||
|
|
||||||
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
||||||
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=False)
|
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=False)
|
||||||
|
|
||||||
@ -166,6 +168,8 @@ list_of_frames = myDataView.to_list()
|
|||||||
This example uses an ROI query to filter for frames containing at least one ROI with either the label `cat` OR the label `dog`:
|
This example uses an ROI query to filter for frames containing at least one ROI with either the label `cat` OR the label `dog`:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
# Add a query for a Dataset version
|
# Add a query for a Dataset version
|
||||||
myDataView.add_query(
|
myDataView.add_query(
|
||||||
dataset_name='myDataset',
|
dataset_name='myDataset',
|
||||||
@ -189,6 +193,8 @@ list_of_frames = myDataView.to_list()
|
|||||||
This example uses an ROI query to filter for frames containing at least one ROI with both the label `Car` AND the label `partly_occluded`:
|
This example uses an ROI query to filter for frames containing at least one ROI with both the label `Car` AND the label `partly_occluded`:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
# Add a query for a Dataset version
|
# Add a query for a Dataset version
|
||||||
myDataView.add_query(
|
myDataView.add_query(
|
||||||
dataset_name='myDataset',
|
dataset_name='myDataset',
|
||||||
@ -207,6 +213,8 @@ This example uses an ROI query to filter for frames containing at least one ROI
|
|||||||
have the label `partly_occluded`:
|
have the label `partly_occluded`:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
# Add a query for a Dataset version
|
# Add a query for a Dataset version
|
||||||
# Use a Lucene Query
|
# Use a Lucene Query
|
||||||
# "label" is a key in the rois dictionary of a frame
|
# "label" is a key in the rois dictionary of a frame
|
||||||
@ -229,6 +237,8 @@ ROI with the label `Person`. The example demonstrates using the `roi_queries` pa
|
|||||||
with a list of [`DataView.RoiQuery`](../references/hyperdataset/dataview.md#roiquery) objects:
|
with a list of [`DataView.RoiQuery`](../references/hyperdataset/dataview.md#roiquery) objects:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
myDataview = DataView()
|
myDataview = DataView()
|
||||||
myDataview.add_multi_query(
|
myDataview.add_multi_query(
|
||||||
dataset_id=self._dataset_id,
|
dataset_id=self._dataset_id,
|
||||||
@ -247,6 +257,8 @@ contain ROIs with the label `Person`. To exclude an ROI, pass `must_not=True` in
|
|||||||
object.
|
object.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
myDataview = DataView()
|
myDataview = DataView()
|
||||||
myDataview.add_multi_query(
|
myDataview.add_multi_query(
|
||||||
dataset_id=self._dataset_id,
|
dataset_id=self._dataset_id,
|
||||||
@ -266,6 +278,8 @@ This example demonstrates an ROI query filtering for frames containing the ROI l
|
|||||||
from two versions of one Dataset, and one version of another Dataset:
|
from two versions of one Dataset, and one version of another Dataset:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
# Add queries:
|
# Add queries:
|
||||||
|
|
||||||
# The 1st Dataset version
|
# The 1st Dataset version
|
||||||
@ -308,6 +322,8 @@ They use the same logical OR, AND, NOT AND matching as ROI queries.
|
|||||||
This example demonstrates a frame query filtering for frames containing the meta key `city` value of `bremen`:
|
This example demonstrates a frame query filtering for frames containing the meta key `city` value of `bremen`:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
# Add a frame query for frames with the meta key "city" value of "bremen"
|
# Add a frame query for frames with the meta key "city" value of "bremen"
|
||||||
myDataView.add_query(
|
myDataView.add_query(
|
||||||
dataset_name='myDataset',
|
dataset_name='myDataset',
|
||||||
@ -333,6 +349,8 @@ This example demonstrates creating a Dataview and setting its parameters to iter
|
|||||||
manually terminated:
|
manually terminated:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView, IterationOrder
|
||||||
|
|
||||||
# Create a Dataview object for an iterator that returns frames
|
# Create a Dataview object for an iterator that returns frames
|
||||||
myDataView = DataView()
|
myDataView = DataView()
|
||||||
|
|
||||||
@ -344,6 +362,8 @@ myDataView.set_iteration_parameters(order=IterationOrder.random, infinite=True)
|
|||||||
This example demonstrates creating a DataView and setting its parameters to iterate and return all frames matching a query:
|
This example demonstrates creating a DataView and setting its parameters to iterate and return all frames matching a query:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView, IterationOrder
|
||||||
|
|
||||||
# Create a Dataview object for an iterator for frames
|
# Create a Dataview object for an iterator for frames
|
||||||
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=False)
|
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=False)
|
||||||
|
|
||||||
@ -370,6 +390,8 @@ This example demonstrates creating a Dataview and setting its parameters to iter
|
|||||||
Dataset version contains fewer than that number of frames matching the query, then fewer are returned by the iterator.
|
Dataset version contains fewer than that number of frames matching the query, then fewer are returned by the iterator.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView, IterationOrder
|
||||||
|
|
||||||
# Create a Dataview object for an iterator for frames
|
# Create a Dataview object for an iterator for frames
|
||||||
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
||||||
|
|
||||||
@ -392,6 +414,8 @@ This example adjusts an imbalance in the input data to improve training for `Car
|
|||||||
one ROI labeled with both `Car` and `largely_occluded` will be input.
|
one ROI labeled with both `Car` and `largely_occluded` will be input.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView, IterationOrder
|
||||||
|
|
||||||
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
||||||
|
|
||||||
myDataView.add_query(
|
myDataView.add_query(
|
||||||
@ -423,6 +447,8 @@ then use the labels you map **to** when setting enumeration values.
|
|||||||
For example, if the labels `truck`, `van`, and `car` are mapped **to** `vehicle`, then set enumeration for `vehicle`.
|
For example, if the labels `truck`, `van`, and `car` are mapped **to** `vehicle`, then set enumeration for `vehicle`.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView, IterationOrder
|
||||||
|
|
||||||
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
||||||
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
||||||
|
|
||||||
@ -473,6 +499,8 @@ third uses `Car` (upper case "C").
|
|||||||
The example maps `Car` (upper case "C") to `car` (lower case "c"):
|
The example maps `Car` (upper case "C") to `car` (lower case "c"):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView, IterationOrder
|
||||||
|
|
||||||
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
||||||
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
||||||
|
|
||||||
@ -512,6 +540,8 @@ Dataview objects can be retrieved by the Dataview ID or name using the [`DataVie
|
|||||||
class method.
|
class method.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from allegroai import DataView
|
||||||
|
|
||||||
my_dataview = DataView.get(dataview_id='<dataview_id>')
|
my_dataview = DataView.get(dataview_id='<dataview_id>')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user