Пример #1
0
def predict_frnn(image):
    cfg.TEST.HAS_RPN = True  # Use RPN for proposals

    # load network
    global saver, net
    if saver is None or net is None:
        saver, net = prepare_model.load_model(sess, args.demo_net, tf_model,
                                              len(CLASSES))

    return predict_proc(sess, net, image)
Пример #2
0
def main():
    cfg.TEST.HAS_RPN = True  # Use RPN for proposals

    tf_model = prepare_model.get_tf_model(args.model_dir, args.model_data)
    # set config
    tfconfig = tf.ConfigProto(allow_soft_placement=True)
    tfconfig.gpu_options.allow_growth = True

    # init session
    sess = tf.Session(config=tfconfig)
    # load network
    saver, net = prepare_model.load_model(sess, args.demo_net, tf_model,
                                          len(CLASSES))

    predict_test(sess, net, args)


# def predict_frnn(image):
#     cfg.TEST.HAS_RPN = True  # Use RPN for proposals
#
#     tf_model = prepare_model.get_tf_model(args.model_dir, args.model_data)
#     # set config
#     tfconfig = tf.ConfigProto(allow_soft_placement=True)
#     tfconfig.gpu_options.allow_growth = True
#
#     # init session
#     sess = tf.Session(config=tfconfig)
#     # load network
#     saver, net = prepare_model.load_model(sess, args.demo_net, tf_model, len(CLASSES))
#
#     return predict_proc(sess, net, image)
#
# def main():
#     cfg.TEST.HAS_RPN = True  # Use RPN for proposals
#
#     tf_model = prepare_model.get_tf_model(args.model_dir, args.model_data)
#     # set config
#     tfconfig = tf.ConfigProto(allow_soft_placement=True)
#     tfconfig.gpu_options.allow_growth = True
#
#     # init session
#     sess = tf.Session(config=tfconfig)
#     # load network
#     saver, net = prepare_model.load_model(sess, args.demo_net, tf_model, len(CLASSES))
#
#     predict_test(sess, net, args)
#
# if __name__ == '__main__':
#     main()
Пример #3
0
def main():
    cfg.TEST.HAS_RPN = True  # Use RPN for proposals

    tf_model = prepare_model.get_tf_model(args.model_dir, args.model_data)
    # set config
    tfconfig = tf.ConfigProto(allow_soft_placement=True)
    tfconfig.gpu_options.allow_growth = True

    # init session
    sess = tf.Session(config=tfconfig)
    # load network
    saver, net = prepare_model.load_model(sess, args.demo_net, tf_model,
                                          len(CLASSES))

    predict_test(sess, net, args)
Пример #4
0
def get_model(batch_model, iter, demo_net):
    cfg.TEST.HAS_RPN = True  # Use RPN for proposals

    model_dir = batch_model
    model_data = "{}_faster_rcnn_iter_{}.ckpt".format(demo_net, iter)
    tf_model = prepare_model.get_tf_model(model_dir, model_data)
    print(tf_model)
    # set config
    tfconfig = tf.ConfigProto(allow_soft_placement=True)
    tfconfig.gpu_options.allow_growth = True

    # init session
    sess_test = tf.Session(config=tfconfig)
    # load network
    CLASSES = pascal_voc.read_classes(
        osp.join(cfg.ROOT_DIR, 'experiments', 'classes_cfgs',
                 'com_classes_169.txt'))
    print(len(CLASSES))
    saver, net_test = prepare_model.load_model(sess_test, demo_net, tf_model,
                                               len(CLASSES))
    return sess_test, net_test, model_dir, model_data, CLASSES
Пример #5
0
# classes_path = os.path.join(cfg.ROOT_DIR,'experiments', 'classes_cfgs',"{}".format("com_classes_169.txt"))
CLASSES = pascal_voc.read_classes(classes_path)

print(classes_path)
print(CLASSES)

# set config
tfconfig = tf.ConfigProto(allow_soft_placement=True)
tfconfig.gpu_options.allow_growth = True
tf_model = prepare_model.get_tf_model(args.model_dir, args.model_data)

print(tf_model)
# init session
sess = tf.Session(config=tfconfig)

saver, net = prepare_model.load_model(sess, args.demo_net, tf_model,
                                      len(CLASSES))


def predict_frnn(image):
    cfg.TEST.HAS_RPN = True  # Use RPN for proposals

    # load network
    global saver, net
    if saver is None or net is None:
        saver, net = prepare_model.load_model(sess, args.demo_net, tf_model,
                                              len(CLASSES))

    return predict_proc(sess, net, image)


def main():