def __init__(self, bor): # self.currnet_idx = 16 self.currnet_idx = 19 texte = text.Text(bor) texte.set_text(10, 1, "XD XD XD XD") self.effects = [ texte, # 0 pixels.Pixels(bor), # 1 rainbow.Rainbow(bor), # 2 sinrainbow2.SinRainbow2(bor), # 3 sinrainbow.SinRainbow(bor), # 4 # tetris.Tetris(10, 10), metaballs.Metaballs(bor), # 5 disco.Disco(), # 6 pulsingcolor.PulsingColor(Color.blue()), # 7 xdcolor.XDColor(Color.red()), # 8 xdcolor.XDColor(Color.green()), # 9 xdcolor.XDColor(Color.blue()), # 10 solidcolor.SolidColor(Color.black()), # 11 droplet.Droplet(bor), # 12 paint.Paint(bor), # 13 tennis.Tennis(bor), # 14 rays.Rays(bor), # 15 plasma.Plasma(bor), # 16 #GifPlayer('/home/pi/xD-Table-Py/effects/gifplayer/gifs/fireplace_smol.gif'), # 17 GifPlayer( '/home/pi/xD-Table-Py/effects/gifplayer/gifs/fireplace_doniel.gif' ), # 17 rainbow_slow.RainbowSlow(bor), # 18 kibana.Heatmap(), # 19 ]
def begin_masking(): # Run process for DIR selection and required functions ImageOperations = paint.Paint() FileOperations = fileOperations.FileOperations.Directory() input_extension = select_export_extension_combo.get() print("Selected input extension: {}".format(input_extension)) FileOperations.list_all_files(extension=input_extension) all_images = FileOperations.count_files() for image in FileOperations.provide_files(): original = FileOperations.open_image() name_of_current_file = FileOperations.all_flies_in_dir[FileOperations.current_file][2] mask = ImageOperations.execute_paint(original=original, current_name=name_of_current_file) if invert: mask = ImageOperations.invert_mask_colors() if grayscale: mask = ImageOperations.grayscale_mask_colors() if not ImageOperations.skip: # Do save skip save_extension = ".png" if save_in_tiff: save_extension = ".tiff" else: save_extension = ".png" FileOperations.save_image(img=mask, save_extension=save_extension) else: FileOperations.current_file = FileOperations.current_file + 1 if ImageOperations.end_after_this: break
self.isClientConnected = False def send_data(self, data): if self.isClientConnected: self.udp_socket.sendto(json.dumps(data).encode(), (self.HOST, self.PORT)) def receive_data(self, size=1073741824): if not self.isClientConnected: return "" else: while True: data, addr = self.udp_socket.recvfrom(size) if data: return json.loads(data) def receive_history(self, size=1073741824): if not self.isClientConnected: return "" else: while True: data = self.tcp_socket.recv(size) if data: self.history = json.loads(data) else: break if __name__ == '__main__': client = Client() client.connect() paint = paint.Paint(client)
''' Driver program for detection of hand written digits. Draw your digits in real time and hit the 'go' button to see the prediction. Model trained using the MNIST dataset ''' import paint import numpy as np from keras.models import Sequential from keras.layers import Dense from keras.models import model_from_json import pandas as pd import os json_file = open('model.json', 'r') loaded_model_json = json_file.read() json_file.close() model = model_from_json(loaded_model_json) model.load_weights("model.h5") model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy']) p = paint.Paint(model)
i = ImageTk.PhotoImage(i) #substitui a imagem no tk painel.configure(image=i) painel.i = i def salvar(event): print("oi") if event.char == 's': tkFileDialog.askopenfilename() img = paint.img cv2.imwrite(path, img) paint = paintarq.Paint() #ferramentas = ferramentas.Ferramentas() paint.inicializacaoPainelDesenho() root = Tk() chamarPainel(paint.img) painel.bind('<Button-1>', motion) painel.bind('<B1-Motion>', motion2) painel.bind('<B3-Motion>', borracha) root.bind('<Key>', salvar) cores.Cores(root) ferramentas = ferramentasarq.Ferramentas(root) root.mainloop()