diff options
| -rw-r--r-- | cli/app/search/search_dense.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/app/search/search_dense.py b/cli/app/search/search_dense.py index fba393a..e0f069f 100644 --- a/cli/app/search/search_dense.py +++ b/cli/app/search/search_dense.py @@ -563,7 +563,7 @@ def feature_loss_tfhub(feature_extractor, opt_feature_layers, BATCH_SIZE, img_a, img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) return feat_loss / len(opt_feature_layers), img_feat_err / len(opt_feature_layers) - +scope_index = 0 def feature_loss_vgg(feature_extractor, opt_feature_layers, BATCH_SIZE, img_a, img_b, y, x, height, width, resize_height=None, resize_width=None): height = int(height) width = int(width) @@ -580,8 +580,11 @@ def feature_loss_vgg(feature_extractor, opt_feature_layers, BATCH_SIZE, img_a, i img_a = tf.image.resize_images(img_a, [resize_height, resize_width]) img_b = tf.image.resize_images(img_b, [resize_height, resize_width]) - gen_fc, gen_feat_ex = nets.vgg.vgg_16(img_a) - target_fc, target_feat_ex = nets.vgg.vgg_16(img_b) + scope_index += 1 + gen_fc, gen_feat_ex = nets.vgg.vgg_16(img_a, scope='vgg_16_{}'.format(scope)) + + scope_index += 1 + target_fc, target_feat_ex = nets.vgg.vgg_16(img_b, scope='vgg_16_{}'.format(scope)) # gen_feat_ex = feature_extractor(dict(images=img_a), as_dict=True, signature='image_feature_vector') # target_feat_ex = feature_extractor(dict(images=img_b), as_dict=True, signature='image_feature_vector') |
