コード例 #1
0
ファイル: paper_demo.py プロジェクト: githublzb/OneNet
        #font = ImageFont.truetype(font='tnr.ttf', size=50)
        #draw.text((135, 200), "%.2f"%psnr, (255,255,255), font=font)
        filename = '%s/z.jpg' % folder
        img.save(filename)
        
    def reshape_img(img):
        return img[0]


    if run_ours:
        # setup the variables in the session
        n_reference = 0
        batch_size = n_reference + 1
        images_tf = tf.placeholder( tf.float32, [batch_size, img_size[0], img_size[1], img_size[2]], name="images")
        is_train = False
        proj, latent = model.build_projection_model(images_tf, is_train, n_reference, use_bias=True, reuse=None)

        with tf.variable_scope("PROJ") as scope:
            scope.reuse_variables()

    # load the dataset


    print 'loading data...'
    testset_filelist = load_data.load_testset_path_list()
    total_test = len(testset_filelist)
    print 'total test = %d' % total_test

    # We create a session to use the graph and restore the variables
    if run_ours:
        print 'loading model...'
コード例 #2
0
ファイル: paper_demo.py プロジェクト: GentleDell/OneNet
        img.save(filename)

    def reshape_img(img):
        return img[0]

    if run_ours:
        # setup the variables in the session
        n_reference = 0
        batch_size = n_reference + 1
        images_tf = tf.placeholder(
            tf.float32, [batch_size, img_size[0], img_size[1], img_size[2]],
            name="images")
        is_train = False
        proj, latent = model.build_projection_model(images_tf,
                                                    is_train,
                                                    n_reference,
                                                    use_bias=True,
                                                    reuse=None)

        with tf.variable_scope("PROJ") as scope:
            scope.reuse_variables()

    # load the dataset

    print('loading data...')
    testset_filelist = load_data.load_testset_path_list()
    total_test = len(testset_filelist)
    print('total test = %d' % total_test)

    # We create a session to use the graph and restore the variables
    if run_ours: