Skip to content

Instantly share code, notes, and snippets.

@nmcclain
Last active May 28, 2024 17:07
Show Gist options
  • Save nmcclain/471875a53fb2e7f934e9ed80296f26e7 to your computer and use it in GitHub Desktop.
Save nmcclain/471875a53fb2e7f934e9ed80296f26e7 to your computer and use it in GitHub Desktop.
Example DTL for image augmentation with Supervise.ly
[
{
"dst": "$raw",
"src": [
"roads_annotated/*"
],
"action": "data",
"settings": {
"classes_mapping": "default"
}
},
{
"action": "flip",
"src": [
"$raw"
],
"dst": "$raw_fliph",
"settings": {
"axis": "vertical"
}
},
{
"dst": "$data",
"src": [
"$raw",
"$raw_fliph"
],
"action": "multiply",
"settings": {
"multiply": 5
}
},
{
"action": "crop",
"src": [
"$data"
],
"dst": "$randocrop",
"settings": {
"random_part": {
"height": {
"min_percent": 10,
"max_percent": 40
},
"width": {
"min_percent": 30,
"max_percent": 80
},
"keep_aspect_ratio": false
}
}
},
{
"action": "crop",
"src": [
"$data"
],
"dst": "$randocrop2",
"settings": {
"random_part": {
"height": {
"min_percent": 40,
"max_percent": 90
},
"width": {
"min_percent": 60,
"max_percent": 90
},
"keep_aspect_ratio": false
}
}
},
{
"action": "dummy",
"src": [
"$raw",
"$raw_fliph",
"$randocrop",
"$randocrop2"
],
"dst": "$out",
"settings": {}
},
{
"dst": "$precontrast",
"src": [
"$out"
],
"action": "multiply",
"settings": {
"multiply": 5
}
},
{
"dst": "$outcontrast",
"src": [
"$precontrast"
],
"action": "contrast_brightness",
"settings": {
"contrast": {
"min": 0.5,
"max": 2,
"center_grey": false
},
"brightness": {
"min": -50,
"max": 50
}
}
},
{
"dst": [
"$totrain",
"$toval"
],
"src": [
"$outcontrast",
"$out"
],
"action": "if",
"settings": {
"condition": {
"probability": 0.95
}
}
},
{
"dst": "$train",
"src": [
"$totrain"
],
"action": "tag",
"settings": {
"tag": "train",
"action": "add"
}
},
{
"dst": "$val",
"src": [
"$toval"
],
"action": "tag",
"settings": {
"tag": "val",
"action": "add"
}
},
{
"dst": "roads_augmented-train-val",
"src": [
"$train",
"$val"
],
"action": "supervisely",
"settings": {}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment