def cluster_means_shift(self, image_cols):
print 'Means shifting'
bandwidth = estimate_bandwidth(image_cols, quantile=self.params.quantile, n_samples=400)
print self.params.quantile, bandwidth
ms = MeanShift(bandwidth=bandwidth, bin_seeding=True, min_bin_freq=50)
ms.fit(image_cols)
# from IPython import embed; embed(); import ipdb; ipdb.set_trace()
self.number_of_clusters = len(np.unique(ms.labels_))
print 'number of clusters', self.number_of_clusters
return ms.cluster_centers_
评论列表
文章目录