Myosotis-Researches 0.1.33__py3-none-any.whl → 0.1.34__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import cv2
2
+ import math
2
3
  import numpy as np
3
4
  from PIL import Image
4
5
  from skimage.metrics import structural_similarity as ssim
@@ -41,8 +42,26 @@ def SSIM(images):
41
42
  return SSIM_sum / (n * (n - 1) / 2)
42
43
 
43
44
 
45
+ # PSNR
46
+ def _PSNR(image_1, image_2):
47
+ mse = _MSE(image_1, image_2)
48
+ if mse == 0:
49
+ return float("inf")
50
+ else:
51
+ return 20 * math.log10(1.0 / math.sqrt(mse))
52
+
53
+
54
+ def PSNR(images):
55
+ PSNR_sum = 0
56
+ n = len(images)
57
+ for i in range(n):
58
+ for j in range(i + 1, n):
59
+ PSNR_sum += _PSNR(images[i], images[j])
60
+ return PSNR_sum / (n * (n - 1) / 2)
61
+
62
+
44
63
  # Similarity
45
- _method_dict = {"MSE": MSE, "SSIM": SSIM}
64
+ _method_dict = {"MSE": MSE, "SSIM": SSIM, "PSNR": PSNR}
46
65
 
47
66
 
48
67
  def similarity(images, method):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Myosotis-Researches
3
- Version: 0.1.33
3
+ Version: 0.1.34
4
4
  Summary: A repository for storing my progress of researches.
5
5
  Home-page: https://github.com/Zeyu-Xie/Myosotis-Researches
6
6
  Author: Zeyu Xie
@@ -29,13 +29,13 @@ myosotis_researches/CcGAN/train/train_net_for_label_embed.py,sha256=4j6r4_o4rXgA
29
29
  myosotis_researches/CcGAN/utils/__init__.py,sha256=yH4I2QzSoBsjcdjvOH0YKLTeEji_oWrzBGm5EkVZpoI,146
30
30
  myosotis_researches/CcGAN/utils/concat_image.py,sha256=BIGKz52Inn9S7M5fBFKye2V9bLJ0DqEQILoOVWAXUiE,2165
31
31
  myosotis_researches/CcGAN/utils/dataset.py,sha256=TXJSLMpwI1h0xb6lXpq5iUjjurheKPZnPbR2KIU-Py4,4216
32
- myosotis_researches/CcGAN/utils/similarity.py,sha256=piSlF7bNw2Yt8AO-KAd0vLxmAt0X_1KSmfY-rSbP_9k,1061
32
+ myosotis_researches/CcGAN/utils/similarity.py,sha256=iZkafWjlBp6d1lp0ukwJVWn0gbtYMFc9lGmqAHmp84o,1472
33
33
  myosotis_researches/CcGAN/utils/src/style.css,sha256=bNp3_nlpg0W5qA7Rx8MM5ayeprEbYH3_6AIDRTN8UhM,566
34
34
  myosotis_researches/CcGAN/utils/src/style.css.map,sha256=GTGPet_xXnKQnsz-E2CMUWtrgu3D5t0g4J_A_amFdvw,246
35
35
  myosotis_researches/CcGAN/utils/src/style.scss,sha256=_Wa7VPmFzCkEHtrzdG35tj89QNwPd-fpiT-YL4ohcMs,526
36
36
  myosotis_researches/CcGAN/utils/src/template.html,sha256=S35ak_uJ0Zd3_PhX-YoCRBP2TMKxdFPMMaBdpARdKcU,3890
37
- myosotis_researches-0.1.33.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
38
- myosotis_researches-0.1.33.dist-info/METADATA,sha256=zwWCoiP9p8m7aoFn0DDbU-wiHUeTcjzqRb59Sa0A1EQ,3484
39
- myosotis_researches-0.1.33.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
40
- myosotis_researches-0.1.33.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
41
- myosotis_researches-0.1.33.dist-info/RECORD,,
37
+ myosotis_researches-0.1.34.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
38
+ myosotis_researches-0.1.34.dist-info/METADATA,sha256=wyTa_RGFwYHdC8v5cCkOd6qbUtWf8qzy10mWcejKeow,3484
39
+ myosotis_researches-0.1.34.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
40
+ myosotis_researches-0.1.34.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
41
+ myosotis_researches-0.1.34.dist-info/RECORD,,