本文整理匯總了Python中nets.vgg16.vgg16方法的典型用法代碼示例。如果您正苦於以下問題:Python vgg16.vgg16方法的具體用法?Python vgg16.vgg16怎麽用?Python vgg16.vgg16使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nets.vgg16
的用法示例。
在下文中一共展示了vgg16.vgg16方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""Parse input arguments."""
parser = argparse.ArgumentParser(description='Tensorflow CTPN demo')
parser.add_argument('--net', dest='net', choices=['vgg16', 'squeeze', 'mobile'], default='vgg16')
parser.add_argument('--img_dir', default='/home/cwq/data/ICDAR13/123')
parser.add_argument('--dataset', dest='dataset', help='model tag', default='voc_2007_trainval')
parser.add_argument('--tag', dest='tag', help='model tag', default='vgg_latin_chn_newdata')
parser.add_argument('--viz', action='store_true', default=False, help='show result')
parser.add_argument('-o', '--oriented', action='store_true', default=False, help='output rotated detect box')
args = parser.parse_args()
if not os.path.exists(args.img_dir):
print("img dir not exists.")
exit(-1)
args.result_dir = os.path.join('./data/result', args.tag)
if not os.path.exists(args.result_dir):
os.makedirs(args.result_dir)
return args
示例2: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""Parse input arguments."""
parser = argparse.ArgumentParser(description='Test images, and save result as ICDAR challenge format')
parser.add_argument('--net', dest='net', choices=['vgg16', 'res101'], default='vgg16')
parser.add_argument('--img_dir', default='./data/demo')
parser.add_argument('--dataset', dest='dataset', help='model tag', default='voc_2007_trainval')
parser.add_argument('--tag', dest='tag', help='model tag', default='default')
parser.add_argument('-o', '--oriented', action='store_true', default=False, help='output rotated detect box')
parser.add_argument('-c', '--challenge', type=str, help='Which challenge to run',
choices=[
'ICDAR13', # ICDAR13 - Focused Scene Text
'ICDAR15', # ICDAR15 - Challenge 4 - Incidental Scene Text
'MLT17' # Multi-lingual scene text detection
])
args = parser.parse_args()
if not os.path.exists(args.img_dir):
print("img dir not exists.")
exit(-1)
args.result_dir = os.path.join('./data/result', args.tag)
if not os.path.exists(args.result_dir):
os.makedirs(args.result_dir)
return args
示例3: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""Parse input arguments."""
parser = argparse.ArgumentParser(description='Tensorflow Faster R-CNN demo')
parser.add_argument('--net', dest='demo_net', help='Network to use [vgg16 res101]',
choices=NETS.keys(), default='res101')
parser.add_argument('--dataset', dest='dataset', help='Trained dataset [pascal_voc pascal_voc_0712]',
choices=DATASETS.keys(), default='pascal_voc_0712')
args = parser.parse_args()
return args
開發者ID:Sunarker,項目名稱:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代碼行數:12,代碼來源:demo.py
示例4: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Test a Fast R-CNN network')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file', default=None, type=str)
parser.add_argument('--model', dest='model',
help='model to test',
default=None, type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to test',
default='voc_2007_test', type=str)
parser.add_argument('--comp', dest='comp_mode', help='competition mode',
action='store_true')
parser.add_argument('--num_dets', dest='max_per_image',
help='max number of detections per image',
default=100, type=int)
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default='', type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152, mobile',
default='res50', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
開發者ID:Sunarker,項目名稱:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代碼行數:36,代碼來源:test_net.py
示例5: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Train a faster-rcnn in wealy supervised situation with wsddn modules')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file',
default=None, type=str)
parser.add_argument('--weight', dest='weight',
help='initialize with pretrained model weights',
type=str)
parser.add_argument('--wsddn', dest='wsddn',
help='initialize with pretrained wsddn model weights',
type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to train on',
default='voc_2007_trainval', type=str)
parser.add_argument('--imdbval', dest='imdbval_name',
help='dataset to validate on',
default='voc_2007_test', type=str)
parser.add_argument('--iters', dest='max_iters',
help='number of iterations to train',
default=70000, type=int)
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default=None, type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152, mobile',
default='res50', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
開發者ID:Sunarker,項目名稱:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代碼行數:41,代碼來源:trainval_net.py
示例6: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Train a Fast R-CNN network')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file',
default=None, type=str)
parser.add_argument('--weight', dest='weight',
help='initialize with pretrained model weights',
type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to train on',
default='voc_2007_trainval', type=str)
parser.add_argument('--imdbval', dest='imdbval_name',
help='dataset to validate on',
default='voc_2007_test', type=str)
parser.add_argument('--iters', dest='max_iters',
help='number of iterations to train',
default=70000, type=int)
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default=None, type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152, mobile',
default='res50', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
示例7: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Train a CTPN network')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file',
default='./data/cfgs/vgg16.yml', type=str)
parser.add_argument('--pretrained_model',
default=None,
help='path to pretrained model, initialize with pretrained model weights',
type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to train on',
default='voc_2007_trainval', type=str)
parser.add_argument('--imdbval', dest='imdbval_name',
help='dataset to validate on',
default='voc_2007_test', type=str)
parser.add_argument('--iters', dest='max_iters',
help='number of iterations to train',
default=50000, type=int)
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default=None, type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152, mobile, squeeze',
choices=['vgg16', 'res50', 'res101', 'res152', 'mobile', 'squeeze'],
default='vgg16', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
args = parser.parse_args()
return args
示例8: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Test a Fast R-CNN network')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file', default=None, type=str)
parser.add_argument('--model', dest='model',
help='model to test',
default=None, type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to test',
default='voc_2007_test', type=str)
parser.add_argument('--comp', dest='comp_mode', help='competition mode',
action='store_true')
parser.add_argument('--num_dets', dest='max_per_image',
help='max number of detections per image',
default=100, type=int)
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default='', type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152',
default='res50', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
示例9: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Train a Fast R-CNN network')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file',
default=None, type=str)
parser.add_argument('--weight', dest='weight',
help='initialize with pretrained model weights',
default=None,type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to train on',
default='voc_2007_trainval', type=str)
parser.add_argument('--imdbval', dest='imdbval_name',
help='dataset to validate on',
default='voc_2007_test', type=str)
parser.add_argument('--iters', dest='max_iters',
help='number of iterations to train',
default=70000, type=int)
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default=None, type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152',
default='res50', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
示例10: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""Parse input arguments."""
parser = argparse.ArgumentParser(description='MSDS-RCNN demo')
parser.add_argument('--net', dest='demo_net', help='Currently only support vgg16',
choices=NETS.keys(), default='vgg16')
parser.add_argument('--dataset', dest='dataset', help='Trained dataset',
choices=DATASETS.keys(), default='original')
args = parser.parse_args()
return args
示例11: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Test a region classification network')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file', default=None, type=str)
parser.add_argument('--model', dest='model',
help='model to test',
default=None, type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to test',
default='voc_2007_test', type=str)
parser.add_argument('--visualize', dest='visualize', help='whether to show results',
action='store_true')
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default='', type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152, mobile',
default='res50', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
示例12: parse_args
# 需要導入模塊: from nets import vgg16 [as 別名]
# 或者: from nets.vgg16 import vgg16 [as 別名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Train a region classification network')
parser.add_argument('--cfg', dest='cfg_file',
help='optional config file',
default=None, type=str)
parser.add_argument('--weight', dest='weight',
help='initialize with pretrained model weights',
type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to train on',
default='voc_2007_trainval', type=str)
parser.add_argument('--imdbval', dest='imdbval_name',
help='dataset to validate on',
default='voc_2007_test', type=str)
parser.add_argument('--iters', dest='max_iters',
help='number of iterations to train',
default=70000, type=int)
parser.add_argument('--tag', dest='tag',
help='tag of the model',
default=None, type=str)
parser.add_argument('--net', dest='net',
help='vgg16, res50, res101, res152, mobile',
default='res50', type=str)
parser.add_argument('--set', dest='set_cfgs',
help='set config keys', default=None,
nargs=argparse.REMAINDER)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args