Module Import alias alias Import alias Import alias alias Import alias identifier Import alias Import alias ImportFrom alias Import alias alias alias Import alias identifier ImportFrom alias FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword NameLoad If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Return NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Print Str Print NameLoad Expr Call AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListLoad Str Str For TupleStore NameStore NameStore Call NameLoad ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Print Call AttributeLoad Str attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Num NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd BinOpAdd Str SubscriptLoad NameLoad Index NameLoad Str Print Call AttributeLoad Str attr NameLoad With Call AttributeLoad NameLoad attr NameLoad Str NameStore body For NameStore Call NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad Str attr Call NameLoad BinOpDiv Call AttributeLoad NameLoad attr NameLoad Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad TupleLoad Num Num SubscriptLoad AttributeLoad NameLoad attr Index Num Num keyword Str Assign NameStore Call AttributeLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice attr Assign NameStore CompareGt NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Ellipsis NameLoad Expr Call AttributeLoad NameLoad attr Num Call AttributeLoad Str attr NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str Print Call AttributeLoad Str attr NameLoad With Call NameLoad NameLoad Str NameStore body For NameStore Call NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad Str attr Call NameLoad BinOpDiv Call AttributeLoad NameLoad attr NameLoad Num NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad ListLoad Num Num Num Assign NameStore Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore BinOpAdd AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad keyword NameLoad If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num NameLoad Assign NameStore BinOpAdd AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad NameLoad Num NameLoad keyword NameLoad If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore BinOpAdd AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad Str Str Num Num keyword NameLoad keyword ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad Str Str Num Num keyword NameLoad keyword ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str
N/A N/A h5py math N/A _init_paths N/A os sys N/A sg_utils utils N/A preprocess N/A coco_voc test_model * N/A argparse pprint sys N/A numpy np IPython.core.debugger Tracer parse_args N/A N/A N/A N/A N/A 
  Parse input arguments
   N/A parser N/A N/A argparse ArgumentParser description Script for training and testing word detection models. N/A N/A N/A parser add_argument --task dest task help what to run default type str N/A N/A N/A parser add_argument --gpu dest gpu_id help GPU device id to use [0] default 0 type int N/A N/A N/A parser add_argument --solver dest solver help solver prototxt default None type str N/A N/A N/A parser add_argument --iters dest max_iters help number of iterations to train default 240000 type int N/A N/A N/A parser add_argument --weights dest pretrained_model help initialize with pretrained model weights default None type str N/A N/A N/A parser add_argument --cfg dest cfg_file help optional config file default None type str N/A N/A N/A parser add_argument --train_set dest train_set help dataset to train on default valid1 type str N/A N/A N/A parser add_argument --val_set dest val_set help dataset to validate on default valid1 type str N/A N/A N/A parser add_argument --train_dir dest train_dir help directory to train the models from default None type str N/A N/A N/A parser add_argument --write_labels dest write_labels default False type bool N/A N/A N/A parser add_argument --write_splits dest write_splits default False type bool N/A N/A N/A parser add_argument --calibration_set dest calibration_set help dataset to use eval file from default valid1 type str N/A N/A N/A parser add_argument --test_set dest test_set help dataset to test on default valid2 type str N/A N/A N/A parser add_argument --prototxt_deploy dest prototxt_deploy help deploy prototxt default models/vgg/mil_finetune.prototxt.deploy type str N/A N/A N/A parser add_argument --model dest model help deploy prototxt default models/vgg/snapshot_iter_240000.caffemodel type str N/A N/A N/A parser add_argument --vocab_file dest vocab_file help vocabulary to train for default cachedir/v1/vocab_train.pkl type str N/A N/A N/A len N/A sys argv 1 N/A N/A N/A N/A parser print_help N/A N/A N/A sys exit 1 N/A args N/A N/A parser parse_args N/A args N/A N/A N/A __name__ __main__ N/A N/A args N/A parse_args N/A Called with args: N/A args N/A N/A N/A caffe set_mode_gpu N/A N/A N/A args gpu_id None N/A N/A N/A N/A caffe set_device N/A args gpu_id N/A vocab N/A N/A utils load_variables N/A args vocab_file N/A N/A N/A args task compute_targets N/A N/A imdb N/A N/A output_dir N/A args train_dir N/A sets N/A train val N/A N/A i imset N/A enumerate N/A N/A args train_set N/A args val_set N/A N/A N/A N/A imdb append N/A N/A coco_voc coco_voc imset N/A N/A N/A Loaded dataset {:s} format N/A N/A imdb N/A i name N/A counts N/A N/A preprocess get_vocab_counts N/A N/A imdb N/A i image_index N/A N/A imdb N/A i coco_caption_data 5 vocab N/A N/A args write_labels N/A N/A label_file N/A N/A N/A os path join output_dir N/A N/A labels_ N/A sets N/A i .h5 N/A N/A N/A Writing labels to {} format label_file N/A N/A N/A h5py File label_file w f N/A N/A j N/A xrange N/A N/A imdb N/A i num_images N/A N/A ind N/A N/A N/A imdb N/A i image_index N/A j N/A ind_str N/A N/A {:02d}/{:d} format N/A int N/A N/A N/A math floor ind 10000.0 ind N/A l N/A N/A f create_dataset N/A N/A /labels-{} format ind_str N/A 1 1 N/A N/A counts shape N/A 1 1 dtype f N/A c N/A N/A N/A counts N/A N/A j N/A copy N/A c N/A c 0 N/A c N/A N/A c astype N/A np float32 N/A c N/A N/A c reshape N/A 1 1 N/A c size 1 N/A N/A l N/A c N/A N/A N/A utils tic_toc_print 1 N/A N/A write labels {:6d} / {:6d} format j N/A N/A imdb N/A i num_images N/A N/A args write_splits N/A N/A split_file N/A N/A N/A os path join output_dir N/A N/A sets N/A i .ids N/A N/A N/A Writing labels to {} format split_file N/A N/A open split_file wt f N/A N/A j N/A xrange N/A N/A imdb N/A i num_images N/A N/A ind N/A N/A N/A imdb N/A i image_index N/A j N/A ind_str N/A N/A {:02d}/{:d} format N/A int N/A N/A N/A math floor ind 10000.0 ind N/A N/A N/A f write N/A N/A {}
 format ind_str N/A N/A N/A args task test_model N/A N/A imdb N/A N/A coco_voc coco_voc N/A args test_set N/A mean N/A N/A np array N/A N/A N/A 103.939 116.779 123.68 N/A base_image_size 565 N/A model N/A load_model N/A args prototxt_deploy N/A args model base_image_size mean vocab N/A out_dir N/A N/A args model _output N/A N/A N/A utils mkdir_if_missing out_dir N/A detection_file N/A N/A N/A os path join out_dir N/A N/A imdb name _detections.pkl N/A N/A test_model imdb model detection_file detection_file N/A N/A N/A args task eval_model N/A N/A imdb N/A N/A coco_voc coco_voc N/A args test_set N/A gt_label N/A N/A preprocess get_vocab_counts N/A imdb image_index N/A imdb coco_caption_data 5 vocab N/A out_dir N/A N/A args model _output N/A detection_file N/A N/A N/A os path join out_dir N/A N/A imdb name _detections.pkl N/A eval_file N/A N/A N/A os path join out_dir N/A N/A imdb name _eval.pkl N/A N/A benchmark imdb vocab gt_label 5 detection_file eval_file eval_file N/A N/A N/A args task output_words N/A N/A out_dir N/A N/A args model _output N/A imdb N/A N/A coco_voc coco_voc N/A args test_set N/A detection_file N/A N/A N/A os path join out_dir N/A N/A imdb name _detections.pkl N/A imdb_cal N/A N/A coco_voc coco_voc N/A args calibration_set N/A eval_file N/A N/A N/A os path join out_dir N/A N/A imdb_cal name _eval.pkl N/A out_dir N/A N/A N/A os path join N/A N/A args model _output txt N/A N/A N/A utils mkdir_if_missing out_dir N/A prec_file N/A N/A N/A os path join out_dir N/A N/A imdb name _prec.txt N/A sc_file N/A N/A N/A os path join out_dir N/A N/A imdb name _sc.txt N/A N/A output_words imdb detection_file eval_file vocab prec prec 0.5 3 output_file prec_file functional_words N/A a on of the in with and is to an two at next are N/A N/A output_words imdb detection_file eval_file vocab prec sc 0.5 3 output_file sc_file functional_words N/A a on of the in with and is to an two at next are