dict_matcher.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:AuthoringDecompositions 作者: jrock08 项目源码 文件源码
def match_to_dict(image_as_patches, dictionary):
    patch_size = len(image_as_patches.get_shape())+1

    distance = tf.reduce_sum(tf.square(tf.expand_dims(image_as_patches,1) - tf.expand_dims(dictionary,0)), range(2,patch_size))
    min_loc = tf.argmin(distance, 1)
    return tf.gather(dictionary, min_loc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号