Myosotis-Researches 0.1.31__py3-none-any.whl → 0.1.32__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,2 +1,3 @@
1
1
  from .concat_image import concat_image
2
2
  from .dataset import view_dataset, visualize_dataset, download_datasets
3
+ from .similarity import similarity
@@ -0,0 +1,30 @@
1
+ import numpy as np
2
+ from PIL import Image
3
+
4
+
5
+ # MSE
6
+ def _MSE(image_1, image_2):
7
+ array_1 = np.array(image_1) / 255
8
+ array_2 = np.array(image_2) / 255
9
+ n, m, _ = array_1.shape
10
+ return np.sum((array_1 - array_2) ** 2) / (n * m * 3)
11
+
12
+
13
+ def MSE(images):
14
+ MSE_sum = 0
15
+ n = len(images)
16
+ for i in range(n):
17
+ for j in range(i + 1, n):
18
+ MSE_sum += _MSE(images[i], images[j])
19
+ return MSE_sum / (n * (n - 1) / 2)
20
+
21
+
22
+ # Similarity
23
+ _method_dict = {"MSE": MSE}
24
+
25
+
26
+ def similarity(images, method):
27
+ return _method_dict[method](images)
28
+
29
+
30
+ __all__ = ["similarity"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Myosotis-Researches
3
- Version: 0.1.31
3
+ Version: 0.1.32
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
@@ -26,15 +26,16 @@ myosotis_researches/CcGAN/train/train_ccgan.py,sha256=oCslxSPzycUT5W7DWfcS0lBr-L
26
26
  myosotis_researches/CcGAN/train/train_cgan.py,sha256=6lfeWMXzIGScs2s1zI06HqAAl80HJVhvcnyblH7_DvM,9617
27
27
  myosotis_researches/CcGAN/train/train_cgan_concat.py,sha256=xSL6Femdvt1hFncgPlHEApeELjOlZNl8APqHFA-tyHQ,8859
28
28
  myosotis_researches/CcGAN/train/train_net_for_label_embed.py,sha256=4j6r4_o4rXgAN4MdUQL-TXqZJpbhH7d9gWQR8YzBlXw,6976
29
- myosotis_researches/CcGAN/utils/__init__.py,sha256=ggtg8y4tNLiPQyGHvANu2uEicqA891LSGJ-xDHM8DFA,111
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=DhAnj1_-lv9RfWIAE3cKfOXnCEFjD24yNmIYWlwupQ8,584
32
33
  myosotis_researches/CcGAN/utils/src/style.css,sha256=bNp3_nlpg0W5qA7Rx8MM5ayeprEbYH3_6AIDRTN8UhM,566
33
34
  myosotis_researches/CcGAN/utils/src/style.css.map,sha256=GTGPet_xXnKQnsz-E2CMUWtrgu3D5t0g4J_A_amFdvw,246
34
35
  myosotis_researches/CcGAN/utils/src/style.scss,sha256=_Wa7VPmFzCkEHtrzdG35tj89QNwPd-fpiT-YL4ohcMs,526
35
36
  myosotis_researches/CcGAN/utils/src/template.html,sha256=S35ak_uJ0Zd3_PhX-YoCRBP2TMKxdFPMMaBdpARdKcU,3890
36
- myosotis_researches-0.1.31.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
37
- myosotis_researches-0.1.31.dist-info/METADATA,sha256=hYoRiDpIGWUFH2ce7lZSqptQjxX2OwyJJVMjvrzIZI0,3484
38
- myosotis_researches-0.1.31.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
39
- myosotis_researches-0.1.31.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
40
- myosotis_researches-0.1.31.dist-info/RECORD,,
37
+ myosotis_researches-0.1.32.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
38
+ myosotis_researches-0.1.32.dist-info/METADATA,sha256=pl9xXu9D-dFL--CIyAU0q0lwU0a0_aJQwg-PKfRPrnk,3484
39
+ myosotis_researches-0.1.32.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
40
+ myosotis_researches-0.1.32.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
41
+ myosotis_researches-0.1.32.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.1)
2
+ Generator: setuptools (80.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5