#!/usr/bin/env pythonimportbob.bio.faceverbose=2grid='gpu'env=['PATH','LD_LIBRARY_PATH']database='replay-img-licit'# Detects the face amd crops it without eye detectionCROPPED_IMAGE_HEIGHT=224CROPPED_IMAGE_WIDTH=224preprocessor=bob.bio.face.preprocessor.FaceDetect(face_cropper=bob.bio.face.preprocessor.FaceCrop(cropped_image_size=(CROPPED_IMAGE_HEIGHT,CROPPED_IMAGE_WIDTH)),use_flandmark=False)extractor='vgg_features'algorithm='distance-cosine'
but writing it was not possible without reading the code.
This should be covered on issue #36 (closed). Why did we close that?
@amohammadi: These names correspond to the internally attribute values used by argparse. I just kept them. And yes, of course, a bit of doc would help to figure those out. Not sure how to generate a comprehensive list though. Possible?
For options with a default, these default values might be written there, too:
# verbose = 0# grid = None# groups = ['dev']
Writing such a script should not be that difficult, however, providing documentation for each entry might be more cumbersome, and getting them in a reasonable order might be difficult, too.
Another issue that I see with the global configuration file is that variables that do not correspond to any option are silently ignored.
This might be good in the example of Amir above, i.e., where CROPPED_IMAGE_HEIGHT and CROPPED_IMAGE_WIDTH are defined globally and used inside a preprocessor configuration.
On the other hand, if options are misspelled (e.g., using verbosity instead of verbose), these options are just ignored without raising any warning. Maybe, we can come up with a test that checks if every variable inside the configuration file was actually used as a command line option, and emit a warning if not. We might skip all-uppercase variable names, in this case.