def attach_roidb(imdb_names): """ only implement single roidb now """ roidbs = [get_roidb(s) for s in imdb_names.split('+')] roidb = roidbs[0] if len(roidbs) > 1: raise NotImplementedError else: imdb = get_imdb(imdb_names) return imdb, roidb
def attach_maskdb(imdb_names): """ only implement single maskdb now """ maskdbs = [get_maskdb(s) for s in imdb_names.split('+')] maskdb = maskdbs[0] if len(maskdbs) > 1: raise NotImplementedError else: imdb = get_imdb(imdb_names) return imdb, maskdb
def get_maskdb(imdb_name): imdb = get_imdb(imdb_name) print 'Loaded dataset `{:s}` for training'.format(imdb.name) # Here set handler function. (e.g. gt_roidb in faster RCNN) imdb.set_roi_handler(cfg.TRAIN.PROPOSAL_METHOD) imdb.set_mask_handler(cfg.TRAIN.PROPOSAL_METHOD) print 'Set proposal method: {:s}'.format(cfg.TRAIN.PROPOSAL_METHOD) if cfg.TRAIN.USE_FLIPPED: print 'Appending horizontally-flipped training examples...' imdb.append_flipped_masks() print 'done' return imdb.maskdb
sys.exit(1) return parser.parse_args() if __name__ == '__main__': args = parse_args() print('Called with args:') print(args) if args.cfg_file is not None: cfg_from_file(args.cfg_file) cfg.GPU_ID = args.gpu_id print('Using config:') pprint.pprint(cfg) while not os.path.exists(args.caffemodel) and args.wait: print('Waiting for {} to exist...'.format(args.caffemodel)) time.sleep(10) caffe.set_mode_gpu() caffe.set_device(args.gpu_id) imdb = get_imdb(args.imdb_name) _tester = TesterWrapper(args.prototxt, imdb, args.caffemodel, args.task_name) _tester.get_result()
parser.print_help() sys.exit(1) return parser.parse_args() if __name__ == '__main__': args = parse_args() print('Called with args:') print(args) if args.cfg_file is not None: cfg_from_file(args.cfg_file) cfg.GPU_ID = args.gpu_id print('Using config:') pprint.pprint(cfg) while not os.path.exists(args.caffemodel) and args.wait: print('Waiting for {} to exist...'.format(args.caffemodel)) time.sleep(10) caffe.set_mode_gpu() caffe.set_device(args.gpu_id) imdb = get_imdb(args.imdb_name) _tester = TesterWrapper(args.prototxt, imdb, args.caffemodel, args.task_name) _tester.get_result()