Myosotis-Researches 0.0.31__py3-none-any.whl → 0.0.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,5 +1,5 @@
1
- from .print_hdf5_structure import print_hdf5_structure
1
+ from .print_hdf5 import print_hdf5
2
2
  from .concat_image import concat_image
3
3
  from .make_h5 import make_h5
4
4
 
5
- __all__ = ["print_hdf5_structure", "concat_image", "make_h5"]
5
+ __all__ = ["print_hdf5", "concat_image", "make_h5"]
@@ -2,7 +2,7 @@ import h5py
2
2
  import numpy as np
3
3
  import os
4
4
  from PIL import Image
5
- from .print_hdf5_structure import print_hdf5_structure
5
+ from .print_hdf5 import print_hdf5
6
6
 
7
7
  # Make all images to a HDF5 file
8
8
  def make_h5(image_dir, h5_path, image_names = [], indx_train = None, indx_valid = None, image_labels = None, image_types = None):
@@ -38,6 +38,6 @@ def make_h5(image_dir, h5_path, image_names = [], indx_train = None, indx_valid
38
38
  f.create_dataset("types", data=image_types)
39
39
 
40
40
  # Visualize
41
- f.visititems(print_hdf5_structure)
41
+ f.visititems(print_hdf5)
42
42
 
43
43
  __all__ = ["make_h5"]
@@ -1,11 +1,11 @@
1
1
  import h5py
2
2
 
3
3
 
4
- def print_hdf5_structure(name, obj):
4
+ def print_hdf5(name, obj):
5
5
  indent = " " * name.count("/")
6
6
  if isinstance(obj, h5py.Dataset):
7
7
  print(f"{indent}[Dataset] {name} shape={obj.shape} dtype={obj.dtype}")
8
8
  elif isinstance(obj, h5py.Group):
9
9
  print(f"{indent}[Group] {name}")
10
10
 
11
- __all__ = ["print_hdf5_structure"]
11
+ __all__ = ["print_hdf5"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Myosotis-Researches
3
- Version: 0.0.31
3
+ Version: 0.0.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
@@ -23,4 +23,15 @@ Dynamic: summary
23
23
 
24
24
  # Myosotis-Researches
25
25
 
26
- A repository for storing my progress of researches.
26
+ ## `CcGAN` (`myosotis_researches.CcGAN`)
27
+
28
+ ### `internal`
29
+
30
+ Import
31
+
32
+ ```
33
+ from myosotis_researches.internal import *
34
+ ```
35
+
36
+ ### `utils`
37
+
@@ -44,13 +44,12 @@ myosotis_researches/CcGAN/train_128_output_10/train_cgan.py,sha256=bYJbBskTpESfC
44
44
  myosotis_researches/CcGAN/train_128_output_10/train_cgan_concat.py,sha256=PYctY3IZiHGh4TshXx3mUZBf9su_8NuV_D8InkxKQZ4,8940
45
45
  myosotis_researches/CcGAN/train_128_output_10/train_net_for_label_embed.py,sha256=4j6r4_o4rXgAN4MdUQL-TXqZJpbhH7d9gWQR8YzBlXw,6976
46
46
  myosotis_researches/CcGAN/train_128_output_10/utils.py,sha256=B-V6ct4WDisVVCOLO0W7VIBL8StPVNJJTZZ2b2NkMFU,3766
47
- myosotis_researches/CcGAN/utils/__init__.py,sha256=b6bOVso_Yx6wa380sk0PPON1vSzjLBPKK1_I2NEFqHk,185
47
+ myosotis_researches/CcGAN/utils/__init__.py,sha256=azZ2ZSSmWREoptI_5oQ180HojMoCqv2oleveRswq40w,155
48
48
  myosotis_researches/CcGAN/utils/concat_image.py,sha256=zSVFkIgj18m9wKTNWxBmZIdqMgVKF2IB2m1C65l_qyo,2151
49
- myosotis_researches/CcGAN/utils/install_datasets.py,sha256=1WAhrzaCsWqI6vbW0awyovU2nqAtJQAEfWOdIRPQ7Jo,1121
50
- myosotis_researches/CcGAN/utils/make_h5.py,sha256=Q5OW1JA35ormmsrlAJp6XdC6x0uJBRNjsE31wM3zBiI,1422
51
- myosotis_researches/CcGAN/utils/print_hdf5_structure.py,sha256=leaR8H3GhlX6EuIXDMh36xG2zBdV-XlJkaXBuoorl6I,320
52
- myosotis_researches-0.0.31.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
53
- myosotis_researches-0.0.31.dist-info/METADATA,sha256=4b_2L49zDh717Wi710yY_-aE4M8put7HXRFUTDEmeRM,765
54
- myosotis_researches-0.0.31.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
55
- myosotis_researches-0.0.31.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
56
- myosotis_researches-0.0.31.dist-info/RECORD,,
49
+ myosotis_researches/CcGAN/utils/make_h5.py,sha256=Jzsr9q7lneHyvi5HX1m4WBNarUYU1jUsXJuHnyQlAGc,1392
50
+ myosotis_researches/CcGAN/utils/print_hdf5.py,sha256=VvmNAWtMDmg6D9V6ZbSUXrQTKRh9WIJeC4BR_ORJkco,300
51
+ myosotis_researches-0.0.32.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
52
+ myosotis_researches-0.0.32.dist-info/METADATA,sha256=no1tptSMdyKbj2_EdXmaoP1Ep2qoodtWj9n6D3JfQmo,844
53
+ myosotis_researches-0.0.32.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
54
+ myosotis_researches-0.0.32.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
55
+ myosotis_researches-0.0.32.dist-info/RECORD,,
@@ -1,46 +0,0 @@
1
- import gdown
2
- import getpass
3
- from importlib import resources
4
- import os
5
- import subprocess
6
-
7
- # Paths
8
- datasets_dir = resources.files("myosotis_researches").joinpath("CcGAN", "datasets")
9
- if not os.path.exists(datasets_dir):
10
- os.makedirs(datasets_dir, exist_ok=True)
11
-
12
- # File ID dictionary
13
- file_id_dict = {
14
- "Ra": "1CcXp7ga4Ebj7XeMA_fYH2RxTMOWvA0v5",
15
- "MNIST": "1LCQmQEBAGBI7ouBEWvIAjGKZsKcYasoe",
16
- }
17
-
18
-
19
- # Function
20
- def install_datasets(datasets_name):
21
-
22
- # Path
23
- zipped_dataset_path = os.path.join(datasets_dir, f"{datasets_name}_datasets.rar")
24
-
25
- # File ID
26
- file_id = file_id_dict[datasets_name]
27
-
28
- # URL
29
- url = f"https://drive.google.com/uc?id={file_id}"
30
-
31
- # Download
32
- gdown.download(url, zipped_dataset_path, quiet=False, use_cookies=False)
33
-
34
- # Unzip
35
- unzip_password = getpass.getpass("Password:")
36
- cmd = ["unrar", "x", f"-p{unzip_password}", zipped_dataset_path, datasets_dir]
37
- try:
38
- subprocess.run(cmd, check=True)
39
- except subprocess.CalledProcessError as e:
40
- print(e)
41
-
42
- # Delete zipped datasets
43
- os.remove(zipped_dataset_path)
44
-
45
-
46
- __all__ = ["install_datasets"]