Multiply
This layer (multiply) duplicates data (image + annotation).
Example:
1
{
2
"action": "multiply",
3
"src": ["$sample1"],
4
"dst": "$sample2",
5
"settings": {
6
"multiply": 3
7
}
8
}
Copied!
Results:

Use case: training data balancing

This layer is useful when we are going to balance or unbalance data in training dataset.
For example, we have two projects: "cat_proj" with 200 images of cats and "dog_proj" with 600 images of dogs. And we are going to prepare training dataset for cat-dog classifier.
1
[
2
{
3
"action": "data",
4
"src": ["cat_proj/*"],
5
"dst": "$data_cat",
6
"settings": {
7
"classes_mapping": "default"
8
}
9
},
10
{
11
"action": "data",
12
"src": ["dog_proj/*"],
13
"dst": "$data_dog",
14
"settings": {
15
"classes_mapping": "default"
16
}
17
},
18
{
19
"action": "multiply",
20
"src": ["$data_cat"],
21
"dst": "$data_cat_big",
22
"settings": {
23
"multiply": 3
24
}
25
},
26
{
27
"action": "supervisely",
28
"dst": "proj_cat_doc_balanced",
29
"src": ["$data_cat_big", "$data_dog"],
30
"settings": {}
31
}
32
]
Copied!
As you can see from this computational graph, we just read data from both datasets and apply "multiply" layer to variable $data_cat. Produced variable $data_cat_big will contain 200 * 3 images. And then we save both $data_cat_big and $data_dog to project proj_cat_doc_balanced.
Last modified 1yr ago