Commit d94c08ed authored by Bryce Hepner's avatar Bryce Hepner

changed some things for minor testing

parent 310f8c6b
......@@ -507,28 +507,28 @@ if __name__ == "__main__":
images = image_extractor(scenes)
newnamesforlater = []
# print(len(images))
list_dic, bins = make_dictionary(images, 4, False)
# file_sizes_new = []
# file_sizes_old = []
# list_dic, bins = make_dictionary(images, 4, False)
file_sizes_new = []
file_sizes_old = []
np.save("first_dic.npy", list_dic)
# for i in range(6):
# image, new_error, diff = huffman(images[i], 4, False)
# encoded_string = encoder(new_error, list_dic, diff, bins)
# inletters = bitstring_to_bytes(encoded_string)
# np.save("first_dic.npy", list_dic)
for i in range(200,len(images)):
# image, new_error, diff = huffman(images[i], 4, False)
# encoded_string = encoder(new_error, list_dic, diff, bins)
# inletters = bitstring_to_bytes(encoded_string)
# if images[i][-5:] == ".tiff":
# newname = images[i][:-5]
# else:
# newname = images[i][:-4]
if images[i][-5:] == ".tiff":
newname = images[i][:-5]
else:
newname = images[i][:-4]
# print(newname)
# newnamesforlater.append(newname + "_Compressed.txt")
newnamesforlater.append(newname + "_Compressed.txt")
# with open(newname + "_Compressed.txt", 'wb') as f:
# f.write(inletters)
# file_sizes_new.append((os.path.getsize(newname + "_Compressed.txt")))
# file_sizes_old.append((os.path.getsize(images[i])))
# file_sizes_new.append(os.path.getsize("first_dic.npy"))
# # print(np.sum(file_sizes_new)/np.sum(file_sizes_old))
file_sizes_new.append((os.path.getsize(newname + "_Compressed.txt")))
file_sizes_old.append((os.path.getsize(images[i])))
file_sizes_new.append(os.path.getsize("first_dic.npy"))
print(np.sum(file_sizes_new)/np.sum(file_sizes_old))
# list_dic = np.load("first_dic.npy", allow_pickle="TRUE")
# bins = [21,32,48]
# starttime = time()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment