def perform():
    #imagesHandler.load_images()
    #colourHandler.extract_colour_distribution_from_all_images("RGB")
    RGB_data = colourHandler.getColourDistForAllImages("RGB")
    RGB_data = np.array(RGB_data,dtype=None)
    RGB_data= np.delete(RGB_data,0,1)
    
    LAB_data = colourHandler.getColourDistForAllImages("LAB")
    LAB_data = np.array(RGB_data,dtype=None)
    LAB_data= np.delete(RGB_data,0,1)
    
    gistVals = util.loadCSV("gistvals")
    gist_data = np.array(gistVals)
    
    #hogHandler.extract_hog_from_all_images()
    hog_data = hogHandler.getHogValsforAllImages()
    hog_data = np.array(hog_data,dtype=None)
    hog_data= np.delete(hog_data,0,1)
    hog_data = np.array(hog_data)
    
    #surfCodebook.run_codebook(n_clusters,400, 0.3, cv2.INTER_CUBIC, 0)
    surf_data = surf_cb_handler.get_distributions()
    surf_data = np.array(surf_data,dtype=None)
    surf_data= np.delete(surf_data,0,1)
    
    sift_data = sift_cb_handler.get_distributions()
    sift_data = np.array(sift_data,dtype=None)
    sift_data= np.delete(sift_data,0,1)
    
    orb_data = orb_cb_handler.get_distributions()
    orb_data = np.array(surf_data,dtype=None)
    orb_data= np.delete(surf_data,0,1)
    
    
    
    
    est = KMeans(n_clusters=30)
    
    print(79 * '_')
    print('% 9s' % 'init'
          '    time  inertia    h**o   compl  v-meas     ARI AMI  silhouette')
    
    bench_k_means(est, "colourPerfomanceVmeta", colour_data)
    bench_k_means(est, "hogPerfomanceVmeta", hog_data)
    #bench_k_means(est, "surfPerfomanceVmeta", surf_data)
예제 #2
0
def perform():
    #imagesHandler.load_images()
    #colourHandler.extract_colour_distribution_from_all_images("RGB")
    RGB_data = colourHandler.getColourDistForAllImages("RGB")
    RGB_data = np.array(RGB_data, dtype=None)
    RGB_data = np.delete(RGB_data, 0, 1)

    LAB_data = colourHandler.getColourDistForAllImages("LAB")
    LAB_data = np.array(RGB_data, dtype=None)
    LAB_data = np.delete(RGB_data, 0, 1)

    gistVals = util.loadCSV("gistvals")
    gist_data = np.array(gistVals)

    #hogHandler.extract_hog_from_all_images()
    hog_data = hogHandler.getHogValsforAllImages()
    hog_data = np.array(hog_data, dtype=None)
    hog_data = np.delete(hog_data, 0, 1)
    hog_data = np.array(hog_data)

    #surfCodebook.run_codebook(n_clusters,400, 0.3, cv2.INTER_CUBIC, 0)
    surf_data = surf_cb_handler.get_distributions()
    surf_data = np.array(surf_data, dtype=None)
    surf_data = np.delete(surf_data, 0, 1)

    sift_data = sift_cb_handler.get_distributions()
    sift_data = np.array(sift_data, dtype=None)
    sift_data = np.delete(sift_data, 0, 1)

    orb_data = orb_cb_handler.get_distributions()
    orb_data = np.array(surf_data, dtype=None)
    orb_data = np.delete(surf_data, 0, 1)

    est = KMeans(n_clusters=30)

    print(79 * '_')
    print(
        '% 9s' % 'init'
        '    time  inertia    h**o   compl  v-meas     ARI AMI  silhouette')

    bench_k_means(est, "colourPerfomanceVmeta", colour_data)
    bench_k_means(est, "hogPerfomanceVmeta", hog_data)
예제 #3
0
                                    sample_size=sample_size)))


import numpy
numpy.set_printoptions(threshold=numpy.nan)
names_vec = metabagofwords()
content_labels, content_est = [], []
sample_size = len(content_labels)

dates_clustered, mediums_clustered = associate_cluster.assignclustertoallimages(
)
print dates_clustered, len(dates_clustered)
print mediums_clustered, len(mediums_clustered)
print content_labels, len(content_labels)

rgb_data = colourHandler.getColourDistForAllImages("RGB")
rgb_data = np.array(rgb_data, dtype=None)
rgb_data = np.delete(rgb_data, 0, 1)

lab_data = colourHandler.getColourDistForAllImages("LAB")
lab_data = np.array(lab_data, dtype=None)
lab_data = np.delete(lab_data, 0, 1)

gistVals = util.loadCSV("gistvals")
gist_data = np.array(gistVals)

#hogHandler.extract_hog_from_all_images()
hog_data = hogHandler.getHogValsforAllImages()
hog_data = np.array(hog_data, dtype=None)
hog_data = np.delete(hog_data, 0, 1)
hog_data = np.array(hog_data)
예제 #4
0
'''
Created on 29 Aug 2015

@author: Coryn
'''
from databasehandler import colourHandler
import numpy as np
a = [[2,3,2],[3,4,3]]
c = np.delete(a,0,1)
print c
colour_data = colourHandler.getColourDistForAllImages("RGB")
colour_data = np.array(colour_data,dtype=None)
colour_data= np.delete(colour_data,0,1)
print colour_data
예제 #5
0
'''
Created on 29 Aug 2015

@author: Coryn
'''
from databasehandler import colourHandler
import numpy as np
a = [[2, 3, 2], [3, 4, 3]]
c = np.delete(a, 0, 1)
print c
colour_data = colourHandler.getColourDistForAllImages("RGB")
colour_data = np.array(colour_data, dtype=None)
colour_data = np.delete(colour_data, 0, 1)
print colour_data



import numpy
numpy.set_printoptions(threshold=numpy.nan)
names_vec = metabagofwords()
content_labels, content_est =[],[]
sample_size = len(content_labels)

dates_clustered, mediums_clustered = associate_cluster.assignclustertoallimages()
print dates_clustered, len(dates_clustered)
print mediums_clustered, len(mediums_clustered)
print content_labels, len(content_labels)

rgb_data = colourHandler.getColourDistForAllImages("RGB")
rgb_data = np.array(rgb_data,dtype=None)
rgb_data= np.delete(rgb_data,0,1)

lab_data = colourHandler.getColourDistForAllImages("LAB")
lab_data = np.array(lab_data,dtype=None)
lab_data= np.delete(lab_data,0,1)

gistVals = util.loadCSV("gistvals")
gist_data = np.array(gistVals)

#hogHandler.extract_hog_from_all_images()
hog_data = hogHandler.getHogValsforAllImages()
hog_data = np.array(hog_data,dtype=None)
hog_data= np.delete(hog_data,0,1)
hog_data = np.array(hog_data)