Loading RunningInParallel.py +3 −4 Original line number Original line Diff line number Diff line Loading @@ -24,7 +24,7 @@ if __name__ == "__main__": """ """ Takes in the filename and writes the compressed image Takes in the filename and writes the compressed image """ """ newnamesforlater = [] list_dic = np.load("first_dic.npy", allow_pickle=True) list_dic = np.load("first_dic.npy", allow_pickle=True) bins = [21,32,48] bins = [21,32,48] image, new_error, diff = huffman(filename, 4, False) image, new_error, diff = huffman(filename, 4, False) Loading @@ -34,7 +34,6 @@ if __name__ == "__main__": newname = filename[:-5] newname = filename[:-5] else: else: newname = filename[:-4] newname = filename[:-4] newnamesforlater.append(newname + "_Compressed.txt") with open(newname + "_Compressed.txt", 'wb') as f: with open(newname + "_Compressed.txt", 'wb') as f: f.write(inletters) f.write(inletters) def decode_an_image(filename): def decode_an_image(filename): Loading @@ -47,6 +46,6 @@ if __name__ == "__main__": newname = filename[:-4] newname = filename[:-4] encoded_string2 = bytes_to_bitstring(read_from_file(newname + "_Compressed.txt")) encoded_string2 = bytes_to_bitstring(read_from_file(newname + "_Compressed.txt")) reconstruct_image = decoder(encoded_string2, list_dic, bins, False) reconstruct_image = decoder(encoded_string2, list_dic, bins, False) dview.map_sync(save_an_image, images[160:200]) dview.map_sync(save_an_image, images[0]) # dview.map_sync(decode_an_image, images[0:6]) # dview.map_sync(decode_an_image, images[0:6]) print(time() - starttime) print(time() - starttime) No newline at end of file Loading
RunningInParallel.py +3 −4 Original line number Original line Diff line number Diff line Loading @@ -24,7 +24,7 @@ if __name__ == "__main__": """ """ Takes in the filename and writes the compressed image Takes in the filename and writes the compressed image """ """ newnamesforlater = [] list_dic = np.load("first_dic.npy", allow_pickle=True) list_dic = np.load("first_dic.npy", allow_pickle=True) bins = [21,32,48] bins = [21,32,48] image, new_error, diff = huffman(filename, 4, False) image, new_error, diff = huffman(filename, 4, False) Loading @@ -34,7 +34,6 @@ if __name__ == "__main__": newname = filename[:-5] newname = filename[:-5] else: else: newname = filename[:-4] newname = filename[:-4] newnamesforlater.append(newname + "_Compressed.txt") with open(newname + "_Compressed.txt", 'wb') as f: with open(newname + "_Compressed.txt", 'wb') as f: f.write(inletters) f.write(inletters) def decode_an_image(filename): def decode_an_image(filename): Loading @@ -47,6 +46,6 @@ if __name__ == "__main__": newname = filename[:-4] newname = filename[:-4] encoded_string2 = bytes_to_bitstring(read_from_file(newname + "_Compressed.txt")) encoded_string2 = bytes_to_bitstring(read_from_file(newname + "_Compressed.txt")) reconstruct_image = decoder(encoded_string2, list_dic, bins, False) reconstruct_image = decoder(encoded_string2, list_dic, bins, False) dview.map_sync(save_an_image, images[160:200]) dview.map_sync(save_an_image, images[0]) # dview.map_sync(decode_an_image, images[0:6]) # dview.map_sync(decode_an_image, images[0:6]) print(time() - starttime) print(time() - starttime) No newline at end of file