projects/DensePose/doc/TOOL_QUERY_DB.md
query_db is a tool to print or visualize DensePose data from a dataset.
It has two modes: print and show to output dataset entries to standard
output or to visualize them on images.
The general command form is:
python query_db.py print [-h] [-v] [--max-entries N] <dataset> <selector>
There are two mandatory arguments:
<dataset>, DensePose dataset specification, from which to select
the entries (e.g. densepose_coco_2014_train).<selector>, dataset entry selector which can be a single specification,
or a comma-separated list of specifications of the form
field[:type]=value for exact match with the value
or field[:type]=min-max for a range of valuesOne can additionally limit the maximum number of entries to output
by providing --max-entries argument.
Examples:
densepose_coco_2014_train dataset:python query_db.py print densepose_coco_2014_train \* --max-entries 10 -v
file_name equal to COCO_train2014_000000000036.jpg:python query_db.py print densepose_coco_2014_train file_name=COCO_train2014_000000000036.jpg -v
image_id between 36 and 156:python query_db.py print densepose_coco_2014_train image_id:int=36-156 -v
The general command form is:
python query_db.py show [-h] [-v] [--max-entries N] [--output <image_file>] <dataset> <selector> <visualizations>
There are three mandatory arguments:
<dataset>, DensePose dataset specification, from which to select
the entries (e.g. densepose_coco_2014_train).<selector>, dataset entry selector which can be a single specification,
or a comma-separated list of specifications of the form
field[:type]=value for exact match with the value
or field[:type]=min-max for a range of values<visualizations>, visualizations specifier; currently available visualizations are:
bbox - bounding boxes of annotated persons;dp_i - annotated points colored according to the containing part;dp_pts - annotated points in green color;dp_segm - segmentation masks for annotated persons;dp_u - annotated points colored according to their U coordinate in part parameterization;dp_v - annotated points colored according to their V coordinate in part parameterization;One can additionally provide one of the two optional arguments:
--max_entries to limit the maximum number of entries to visualize--output to provide visualization file name template, which defaults
to output.png. To distinguish file names for different dataset
entries, the tool appends 1-based entry index to the output file name,
e.g. output.0001.png, output.0002.png, etc.The following examples show how to output different visualizations for image with id = 322
from densepose_coco_2014_train dataset:
python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_segm -v
python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_i -v
python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_segm -v
python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_u -v
python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_v -v