<s> """<STR_LIT>""" <EOL> import _init_paths <EOL> from fast_rcnn . train import get_training_roidb , train_net <EOL> from fast_rcnn . config import cfg , cfg_from_file , cfg_from_list , get_output_dir <EOL> from datasets . factory import get_imdb <EOL> import caffe <EOL> import argparse <EOL> import pprint <EOL> import numpy as np <EOL> import sys <EOL> def parse_args ( ) : <EOL> """<STR_LIT>""" <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> default = <NUM_LIT:0> , type = int ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> default = None , type = str ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> default = <NUM_LIT> , type = int ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> default = None , type = str ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> default = None , type = str ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> default = '<STR_LIT>' , type = str ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , default = None , <EOL> nargs = argparse . REMAINDER ) <EOL> if len ( sys . argv ) == <NUM_LIT:1> : <EOL> parser . print_help ( ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> args = parser . parse_args ( ) <EOL> return args <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> args = parse_args ( ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( args ) <EOL> if args . cfg_file is not None : <EOL> cfg_from_file ( args . cfg_file ) <EOL> if args . set_cfgs is not None : <EOL> cfg_from_list ( args . set_cfgs ) <EOL> print ( '<STR_LIT>' ) <EOL> pprint . pprint ( cfg ) <EOL> if not args . randomize : <EOL> np . random . seed ( cfg . RNG_SEED ) <EOL> caffe . set_random_seed ( cfg . RNG_SEED ) <EOL> caffe . set_mode_gpu ( ) <EOL> if args . gpu_id is not None : <EOL> caffe . set_device ( args . gpu_id ) <EOL> imdb = get_imdb ( args . imdb_name ) <EOL> print '<STR_LIT>' . format ( imdb . name ) <EOL> roidb = get_training_roidb ( imdb ) <EOL> output_dir = get_output_dir ( imdb , None ) <EOL> print '<STR_LIT>' . format ( output_dir ) <EOL> train_net ( args . solver , roidb , output_dir , <EOL> pretrained_model = args . pretrained_model , <EOL> max_iters = args . max_iters ) </s>
