]> AND Private Git Repository - Cipher_code.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
update
authorRaphaël Couturier <raphael.couturier@univ-fcomte.fr>
Sun, 11 Jul 2021 16:01:57 +0000 (18:01 +0200)
committerRaphaël Couturier <raphael.couturier@univ-fcomte.fr>
Sun, 11 Jul 2021 16:01:57 +0000 (18:01 +0200)
measure_energy_iot/image_compression.py

index c33b8db5be759b5cc49712b46d61dcea8ebc31a9..da8f6b30eeb661b048638ccf187ab6a5d9156b2a 100644 (file)
@@ -11,7 +11,7 @@ print("quality ",quality)
 im=Image.open("lena.jpg")
 elapsed_time=0
 
-for i in range(100):
+for i in range(10):
     t = time.process_time()
     im.save("lena2.jpg",quality=quality)
     elapsed_time += time.process_time() - t
@@ -21,9 +21,8 @@ print("time pil",elapsed_time)
 
 
 
-
 elapsed_time=0
-for i in range(100):
+for i in range(10):
     t = time.process_time()
     im2=im.resize((256, 256))
     im2.save("lena3.jpg",quality=quality)
@@ -31,7 +30,7 @@ for i in range(100):
 
 print("time resize + pil",elapsed_time)
 
-
+"""
 
 
 img = cv2.imread('lena.jpg')
@@ -54,22 +53,26 @@ for i in range(100):
     elapsed_time += time.process_time() - t
 
 print("time resize + cv2",elapsed_time)
+"""
+
 
 elapsed_time=0
+t = time.process_time()
 for i in range(10):
-    t = time.process_time()
-    proc=subprocess.Popen("scp lena4.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
-    proc.wait()
-    elapsed_time += time.process_time() - t
 
+    proc=subprocess.Popen("scp lena3.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
+    proc.wait()
+    
+elapsed_time += time.process_time() - t
 print("ssh normal",elapsed_time)
 
 
 elapsed_time=0
+t = time.process_time()
 for i in range(10):
-    t = time.process_time()
-    proc=subprocess.Popen("scp lena5.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
+
+    proc=subprocess.Popen("scp lena3.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
     proc.wait()
-    elapsed_time += time.process_time() - t
 
+elapsed_time += time.process_time() - t
 print("ssh reduce",elapsed_time)