one_tag_different_dirs
: all files have the same tag, but they are located in different sub-directoriesone_tag_same_dir
: all files have the same tag (type) and are located in the same directorytwo_tags_same_dir
: two different types of filesimage
andlabel
(two tags), located in the same directory and matched by a fragment of their filenamesinputs_across_dirs
: once again, there are two file tags. Each is located in its own directory, and files are matched by their filenameone_input_per_dir
: files that must be grouped together are located in the same subdirectoryone_input_per_multi_dirs
: same as before, but subdirectories are no longer in the root directorydifferent_nesting_levels
:different_variadicities
: the same label file is re-used in different input groupsdifferent_variadicities_multiple_levels
: same as previous, with a more complex layoutmultiple_over_multiple_tags
: all tags are multiple (i.e. for a given key, each tag is a list of file rather than a single file)optional_tags
: all tags are optional (i.e. an input group can have some of its tags to None)variadic_files
: a single label file and multiple image files for a given key
Here are some examples of applying grob
to Kaggle datasets.
If you find more compelling examples, don't hesitate to add them here.
grob "image={subset}/images/new{id:d}.jpg,labels={subset}/images/new{id:d}.txt" . --optional labels --remove-on-missing image
{
"train_1": {
"image": "train/images/new1.jpg",
"labels": "train/labels/new1.txt"
}
}
grob "image={subset}/images/{name}.jpg, labels={subset}/labels/{name}.txt" .
{
"test_00dea1edf14f09ab_jpg.rf.3f17c8790a68659d03b1939a59ccda80": {
"image": "test/images/00dea1edf14f09ab_jpg.rf.3f17c8790a68659d03b1939a59ccda80.jpg",
"labels": "test/labels/00dea1edf14f09ab_jpg.rf.3f17c8790a68659d03b1939a59ccda80.txt"
}
}
grob "image={subset}/images/{name:d}.png, labels={subset}/annotations/{name:d}.png" .
{
"0": {
"image": "images/0.png",
"labels": "annotations/0.xml"
}
}
grob "image=images/{subset}/images/{name}.jpg, labels=labels/{subset}/{name}.txt" .
# Alternatively, group all the different augmentations of a single image together
grob "image=images/{subset}/images/{id:d}*.jpg, labels=labels/{subset}/{id:d}*.txt" . --multiple --optional
Car Parts - Image Classification
grob "image={subset}/{part_name}/*.jpg" . --multiple --key "{part_name} - {subset}"
grob "image=asl_alphabet_train/{part_name}/*.jpg" . --multiple
Fruit Images for Object Detection
grob "image={subset}/{name}.jpg, labels={subset}/{name}.xml" .
grob "image=*/{name}.jpg, labels=*/{name}.jpg.cat" .
DeepGlobe Road Extraction Dataset
grob "image={subset}/{name}_sat.jpg, mask={subset}/{name}_mask.png" .