Ejemplo n.º 1
0
def main():
    # STEP 1: Parse args
    args = get_arguments(sys.argv[1:])

    # STEP 2: Get a list of CSV objects.
    csv_list = get_csv_list(args)

    # STEP 3: Create a Plotter and generate plot(s)
    if args.indiv:
        generate_individual_plots(args, csv_list)
    else:
        plot = Plotter(args, csv_list)
        plot.generate_plot()
Ejemplo n.º 2
0
def protein_length_graphic(paths_dict, height, width, font_scale):
	
	height = int(height.get())
	width = int(width.get())
	font_scale = float(font_scale.get())
	
	savepath = paths_dict[SAVEPATH]
	
	prot_index = 0
	if len(protein_listbox1.curselection()) > 0:
		prot_index = protein_listbox1.curselection()[0]
	else:
		raise Exception("At least one protein must be selected")
	
	prot_name = protein_listbox1.get(prot_index)
	
	facade.protein_length_graphic(prot_name, savepath, height, width, font_scale, sys.stderr)
	
	protein_size_tif = plotter.get_protein_size_tif(savepath, prot_name)
	
	_show_image(protein_size_tif, height, width, 1200, 800)
	
	displayedText.set('Protein plot done!!')
	
	return
Ejemplo n.º 3
0
 def __init__(self):
     self.limit = -1
     self.fingerprint_loaded = False
     self.Decoder = Decoder.Decoder()
     self.FingerPrinter = FingerPrinter.FingerPrinter()
     self.Recognizer = Recognizer.Recognizer()
     self.HashingManager = HashingManager.HashingManager()
     self.Plotter = Plotter.Plotter()
     self.MicRecorder = MicRecorder.MicRecorder()
Ejemplo n.º 4
0
def generate_individual_plots(args, csv_list):
    args.dir = None
    xaxis = args.xaxis if args.xaxis else None
    xmin = Plotter.get_x_min(csv_list, xaxis)
    xmax = Plotter.get_x_max(csv_list, xaxis)
    ymin = Plotter.get_y_min(csv_list, xaxis) + args.offset
    ymax = Plotter.get_y_max(csv_list, xaxis) + args.offset
    for csv in csv_list:
        args.file = csv.fname
        plot = Plotter(args, [csv], xmin, xmax, ymin, ymax)
        plot.generate_plot()
Ejemplo n.º 5
0
def stripplot (paths_dict, height, width):
	
	height = int(height.get())
	width = int(width.get())
	
	savepath = paths_dict[SAVEPATH]
	
	facade.stripplot(savepath, height, width, sys.stderr)
	
	blast_plot_tif = plotter.get_blast_plot_tif(savepath)
	
	_show_image(blast_plot_tif, height, width, 1200, 600)
	
	return
Ejemplo n.º 6
0
def heatmap(paths_dict, height, width, font_scale, right_scale, bottom_scale):
	
	height = int(height.get())
	width = int(width.get())
	font_scale = float(font_scale.get())
	bottom_scale = float(bottom_scale.get())
	right_scale = float(right_scale.get())
	
	savepath = paths_dict[SAVEPATH]
	
	facade.heatmap(savepath, height, width, font_scale, right_scale, bottom_scale, sys.stderr)
	
	clustermap = plotter.get_cluster_map_tif(savepath)
	
	_show_image(clustermap, height, width, 1200, 800)
	
	return
Ejemplo n.º 7
0
from src import Plotter

# prepare the video input stream
vc = cv2.VideoCapture('./data/Surgery.avi')
# read the first frame of the video stream
_, frameReference = vc.read()

count = 0
plt.ion()
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20, 5))
plt.axis('off')

segmentation = False
# instantiate the Tracker with the segmentation option
tracker = Tracker.Tracker(segmentation)
plotter = Plotter.Plotter()

start = datetime.datetime.now()
while vc.isOpened():
    time1 = datetime.datetime.now()
    # grab the next frame
    _, frameNew = vc.read()

    if frameNew is None:
        end = datetime.datetime.now()
        print("finishing...")
        break

    assert frameReference.shape == frameNew.shape

    # extract the keypoints and match them according to their descriptors
Ejemplo n.º 8
0
 def test_plotter_arg_filename(self):
     args = get_arguments(['-d', 'ex*/my*', '-c', 'hunger', '-I'])
     csv_list = get_csv_list(args)
     plot = Plotter(args, csv_list)
     self.assertEqual(plot.arg['name'], 'my_examples.png')
Ejemplo n.º 9
0
 def test_plotter_default_name_dir(self):
     args = get_arguments(['-d', 'ex*/my*', '-c', 'hunger', '-n', 'pet_hunger'])
     csv_list = get_csv_list(args)
     plot = Plotter(args, csv_list)
     self.assertEqual(plot.arg['name'], 'pet_hunger.html')
Ejemplo n.º 10
0
    lr.XY_AVERAGE,
    lr.XY_WEIGHTED_AVERAGE,
]

SVM_LIST_COMP1 = [lr.MOVEMENT, lr.XY_MOVEMENT]
SVM_LIST_COMP2 = [
    lr.MOVEMENT, lr.ALL_MAJORITY, lr.ALL_AVERAGE, lr.ALL_WEIGHTED_AVERAGE
]

TO_DO_TOGHETER = [(SVM_LIST_NOSHIFT, "setnoshift"),
                  (SVM_LIST_SHIFT, "setshift"), (SVM_LIST_COMP1, "origshift"),
                  (SVM_LIST_COMP2, "setall")]

# todo: ottimizza evitando la ripetizione di calcoli
if __name__ == '__main__':
    p = plotter.Plotter(Utils.DATASET_NAME_0)

    for handwriting in [Utils.ITALIC, Utils.BLOCK_LETTER]:
        classifier = lr.WordClassifier(Utils.DATASET_NAME_0, handwriting)

        chrono = cr.Chrono("Generating verification outputs...")
        ver = VerificationEvaluator(classifier)
        for balanced in [True, False]:
            names, fprs, tprs, ts, aucs = ver.plots_info_weights(
                lr.WEIGHTED_AVERAGE, balanced, np.arange(0, 1.01, 0.2))
            p.plotRocs(names, fprs, tprs, aucs, handwriting, balanced,
                       "weights")

            for svm_list, name in TO_DO_TOGHETER:
                names, fprs, tprs, ts, aucs = ver.plots_info_names(
                    svm_list, balanced)
Ejemplo n.º 11
0
from src.GeneticAlgorythm import *
from src.Plotter import *
import time
import numpy as np

if __name__ == "__main__":
    methods = [
        "RankSelection", "RankSelectionDependentOnIteration",
        "RouletteSelection", "TournamentSelection"
    ]
    iterCount = 1000
    plt = Plotter()
    meanPlt = Plotter()
    crossOverPlt = Plotter()
    mutatePlt = Plotter()
    bestIndividualsPlt = Plotter()
    crossPlot = Plotter()
    mutatePlot = Plotter()
    for method in methods:
        print()
        print('Metoda : ', method)
        print()
        #zbierznosici funkcji celu i najlepsze osobniki

        popular = [
            1.0, 2.0, 2.14, 3.6, 11.23, 23.51, 17.2, 12.3, 19.2, 7.7, 21.3,
            32.7, 29.9, 30.5, 35.4
        ]
        # popular=[3,11,15,23,27,33,41,49,56,59,70,90]
        popular.sort()
        alg = GeneticAlgorythm(20,