MCPcopy Create free account
hub / github.com/davisking/dlib / main

Function main

tools/imglab/src/main.cpp:631–1340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629// ----------------------------------------------------------------------------------------
630
631int main(int argc, char** argv)
632{
633 try
634 {
635
636 command_line_parser parser;
637
638 parser.add_option("h","Displays this information.");
639 parser.add_option("v","Display version.");
640 parser.add_option("font", "Set the label font in the GUI.", 1);
641
642 parser.set_group_name("Creating XML files");
643 parser.add_option("c","Create an XML file named <arg> listing a set of images.",1);
644 parser.add_option("r","Search directories recursively for images.");
645 parser.add_option("convert","Convert foreign image Annotations from <arg> format to the imglab format. "
646 "Supported formats: pascal-xml, pascal-v1, idl.",1);
647
648 parser.set_group_name("Viewing XML files");
649 parser.add_option("tile","Chip out all the objects and save them as one big image called <arg>.",1);
650 parser.add_option("size","When using --tile or --cluster, make each extracted object contain "
651 "about <arg> pixels (default 8000).",1);
652 parser.add_option("l","List all the labels in the given XML file.");
653 parser.add_option("stats","List detailed statistics on the object labels in the given XML file.");
654 parser.add_option("files","List all the files in the given XML file.");
655
656 parser.set_group_name("Editing/Transforming XML datasets");
657 parser.add_option("rename", "Rename all labels of <arg1> to <arg2>.",2);
658 parser.add_option("parts","The display will allow image parts to be labeled. The set of allowable parts "
659 "is defined by <arg> which should be a space separated list of parts.",1);
660 parser.add_option("rmempty","Remove all images that don't contain non-ignored annotations and save the results to a new XML file.");
661 parser.add_option("rmdupes","Remove duplicate images from the dataset. This is done by comparing "
662 "the md5 hash of each image file and removing duplicate images. " );
663 parser.add_option("rmdiff","Set the ignored flag to true for boxes marked as difficult.");
664 parser.add_option("rmtrunc","Set the ignored flag to true for boxes that are partially outside the image.");
665 parser.add_option("box-images","Add a box to each image that contains the entire image.");
666 parser.add_option("sort-num-objects","Sort the images listed an XML file so images with many objects are listed first.");
667 parser.add_option("sort","Alphabetically sort the images in an XML file.");
668 parser.add_option("shuffle","Randomly shuffle the order of the images listed in an XML file.");
669 parser.add_option("seed", "When using --shuffle, set the random seed to the string <arg>.",1);
670 parser.add_option("split", "Split the contents of an XML file into two separate files. One containing the "
671 "images with objects labeled <arg> and another file with all the other images. ",1);
672 parser.add_option("split-train-test", "Split the contents of an XML file into two separate files. A training "
673 "file containing <arg> fraction of the images and a testing file containing the remaining (1-<arg>) images. "
674 "The partitioning is done deterministically by putting the first images in the input xml file into the training split "
675 "and the later images into the test split.",1);
676 parser.add_option("add", "Add the image metadata from <arg1> into <arg2>. If any of the image "
677 "tags are in both files then the ones in <arg2> are deleted and replaced with the "
678 "image tags from <arg1>. The results are saved into merged.xml and neither <arg1> or "
679 "<arg2> files are modified.",2);
680 parser.add_option("flip", "Read an XML image dataset from the <arg> XML file and output a left-right flipped "
681 "version of the dataset and an accompanying flipped XML file named flipped_<arg>. "
682 "We also adjust object part labels after flipping so that the new flipped dataset "
683 "has the same average part layout as the source dataset." ,1);
684 parser.add_option("flip-basic", "This option is just like --flip, except we don't adjust any object part labels after flipping. "
685 "The parts are instead simply mirrored to the flipped dataset.", 1);
686 parser.add_option("rotate", "Read an XML image dataset and output a copy that is rotated counter clockwise by <arg> degrees. "
687 "The output is saved to an XML file prefixed with rotated_<arg>.",1);
688 parser.add_option("add-width-height-metadata", "Open the given xml files and set the width and height image metadata fields "

Callers

nothing calls this directly

Calls 15

get_optionFunction · 0.85
merge_metadata_filesFunction · 0.85
flip_datasetFunction · 0.85
rotate_datasetFunction · 0.85
tile_datasetFunction · 0.85
cluster_datasetFunction · 0.85
resample_datasetFunction · 0.85
convert_pascal_xmlFunction · 0.85
convert_pascal_v1Function · 0.85
convert_idlFunction · 0.85
create_new_datasetFunction · 0.85

Tested by

no test coverage detected