不变分片距离与聚类

patchdistances的Python项目详细描述


这个软件包包含了使用不变的面片距离来聚类和重建图像的方法。 包是基于CUDA C++项目构建的:invariant_patch_distances。 该软件包具有以下依赖关系:计算能力为3.x或更高的NVIDIA显卡, CUDA 10.0和CMake 3.10。在

示例

下面的示例演示如何使用这些簇对面片进行聚类并重建图像。在

importpatchdistancesaspd# Load image as Float32 numpy array. It can either be gray-scale or rgb.img=load_image()//Initializethedistanceclass.//Alternatively:similarity_inv_dist.aid=pd.affine_inv_dist()//Greedy-k-centerclusteringoftheimagepatchesusingthedistance.labels,indices_of_labels=aid.greedy_k_center(image=img,patch_shape=(7,7),clusters=20,first_patch_idx=0,solver=pd.solver_t.procrustes,func_family=pd.func_t.superlevelsets,use_imed=False,interpolation=pd.inter_t.bicubic,)//Reconstructtheimageusingthepreviouslyclusteredpatches.//Alternatively:reconstruct_w_translation.reconstructed_image,nearest_neighbor_labeling=aid.reconstruct(image=img,labels=labels,rec_type=pd.rec_t.Median,solver=pd.solver_t.procrustes,func_family=pd.func_t.superlevelsets,use_imed=False,interpolation=pd.inter_t.bicubic,)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何向第二个组合框模型项添加数组值从第一个组合框所选项获取数组名称?   使用Java与WebSphere的SSL握手错误   eclipse线程“main”Java中的第一个Java程序异常。lang.NoClassDefFoundError   java将Javafx应用作为Web应用移植的最佳方式   IDE的java右JVM文件夹   java如何在基本适配器中停止文本到语音   java If block使用substring和equals方法以假值执行   在本例中,如何在java中返回多个值?   java第二个主类在maven构建期间覆盖第一个主类   如何在java中设置运行时ArrayList的泛型类型?   java从主机读取文件