mirror of
https://github.com/clearml/clearml-docs
synced 2025-03-19 11:38:50 +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`:
|
||||
|
||||
```python
|
||||
from allegroai import DataView, IterationOrder
|
||||
|
||||
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
||||
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`:
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
# Add a query for a Dataset version
|
||||
myDataView.add_query(
|
||||
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`:
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
# Add a query for a Dataset version
|
||||
myDataView.add_query(
|
||||
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`:
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
# Add a query for a Dataset version
|
||||
# Use a Lucene Query
|
||||
# "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:
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
myDataview = DataView()
|
||||
myDataview.add_multi_query(
|
||||
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.
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
myDataview = DataView()
|
||||
myDataview.add_multi_query(
|
||||
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:
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
# Add queries:
|
||||
|
||||
# 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`:
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
# Add a frame query for frames with the meta key "city" value of "bremen"
|
||||
myDataView.add_query(
|
||||
dataset_name='myDataset',
|
||||
@ -333,6 +349,8 @@ This example demonstrates creating a Dataview and setting its parameters to iter
|
||||
manually terminated:
|
||||
|
||||
```python
|
||||
from allegroai import DataView, IterationOrder
|
||||
|
||||
# Create a Dataview object for an iterator that returns frames
|
||||
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:
|
||||
|
||||
```python
|
||||
from allegroai import DataView, IterationOrder
|
||||
|
||||
# Create a Dataview object for an iterator for frames
|
||||
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.
|
||||
|
||||
```python
|
||||
from allegroai import DataView, IterationOrder
|
||||
|
||||
# Create a Dataview object for an iterator for frames
|
||||
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.
|
||||
|
||||
```python
|
||||
from allegroai import DataView, IterationOrder
|
||||
|
||||
myDataView = DataView(iteration_order=IterationOrder.random, iteration_infinite=True)
|
||||
|
||||
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`.
|
||||
|
||||
```python
|
||||
from allegroai import DataView, IterationOrder
|
||||
|
||||
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
||||
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"):
|
||||
|
||||
```python
|
||||
from allegroai import DataView, IterationOrder
|
||||
|
||||
# Create a Dataview object for an iterator that randomly returns frames according to queries
|
||||
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.
|
||||
|
||||
```python
|
||||
from allegroai import DataView
|
||||
|
||||
my_dataview = DataView.get(dataview_id='<dataview_id>')
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user