Myosotis-Researches 0.1.20__py3-none-any.whl → 0.1.22__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,20 +1,20 @@
1
1
  from .print_hdf5 import print_hdf5
2
2
  from .concat_image import concat_image
3
- from .make_h5 import make_h5
4
3
  from .SimpleProgressBar import SimpleProgressBar
5
4
  from .IMGs_dataset import IMGs_dataset
6
5
  from .train import PlotLoss, compute_entropy, predict_class_labels, DiffAugment
7
6
  from .opts import parse_opts
7
+ from .view_dataset import view_dataset
8
8
 
9
9
  __all__ = [
10
10
  "print_hdf5",
11
11
  "concat_image",
12
- "make_h5",
13
12
  "SimpleProgressBar",
14
13
  "IMGs_dataset",
15
14
  "PlotLoss",
16
15
  "compute_entropy",
17
16
  "predict_class_labels",
18
17
  "DiffAugment",
19
- "parse_opts"
18
+ "parse_opts",
19
+ "view_dataset"
20
20
  ]
@@ -0,0 +1,16 @@
1
+ import h5py
2
+
3
+
4
+ def _print_hdf5(name, obj):
5
+ indent = " " * name.count("/")
6
+ if isinstance(obj, h5py.Dataset):
7
+ print(f"{indent}[Dataset] {name} shape={obj.shape} dtype={obj.dtype}")
8
+ elif isinstance(obj, h5py.Group):
9
+ print(f"{indent}[Group] {name}")
10
+
11
+
12
+ def view_dataset(dataset_path):
13
+ with h5py.File(dataset_path, "r") as f:
14
+ f.visititems(_print_hdf5)
15
+
16
+ __all__ = ["view_dataset"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Myosotis-Researches
3
- Version: 0.1.20
3
+ Version: 0.1.22
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
@@ -27,20 +27,20 @@ myosotis_researches/CcGAN/train/train_cgan_concat.py,sha256=OrQbwdU_ujUeKFGixUUp
27
27
  myosotis_researches/CcGAN/train/train_net_for_label_embed.py,sha256=4j6r4_o4rXgAN4MdUQL-TXqZJpbhH7d9gWQR8YzBlXw,6976
28
28
  myosotis_researches/CcGAN/utils/IMGs_dataset.py,sha256=i45PBNSCeAEB5uUG0SluYRTuHWZwH_5ldz2wm6afkYs,927
29
29
  myosotis_researches/CcGAN/utils/SimpleProgressBar.py,sha256=S4eD_m6ysHRMHAmRtkTXVRNfXTR8kuHv-d3lUN0BVn4,546
30
- myosotis_researches/CcGAN/utils/__init__.py,sha256=em3aB0C-V230NQtT64hyuHGo4CjV6p2DwIdtNM0dk4k,516
30
+ myosotis_researches/CcGAN/utils/__init__.py,sha256=kQnoDFFS0EKCMjKnmhWZEuSIyNBjZowKYkQ0DvooiUs,531
31
31
  myosotis_researches/CcGAN/utils/concat_image.py,sha256=BIGKz52Inn9S7M5fBFKye2V9bLJ0DqEQILoOVWAXUiE,2165
32
- myosotis_researches/CcGAN/utils/make_h5.py,sha256=VtFYjr_i-JktsEW_BvofpilcDmChRmyLykv0VvlMuY0,963
33
32
  myosotis_researches/CcGAN/utils/opts.py,sha256=pd7-wknNPBO5hWRpO3YAPmmAsPKgZUUpKc4gWMs6Wto,5397
34
33
  myosotis_researches/CcGAN/utils/print_hdf5.py,sha256=VvmNAWtMDmg6D9V6ZbSUXrQTKRh9WIJeC4BR_ORJkco,300
35
34
  myosotis_researches/CcGAN/utils/train.py,sha256=5ZXgkGesuInqUooJRpLej_KHqYQtlSDq90_5wig5elQ,5152
35
+ myosotis_researches/CcGAN/utils/view_dataset.py,sha256=BaAKII7BAItVhL--H5q88H9cUR7nSDTtAvV_uz6b6hs,415
36
36
  myosotis_researches/CcGAN/visualize/__init__.py,sha256=RHfzFo7FgcJhZVQ9DkEIGELK-lQNC5X915kPH8XGSiM,85
37
37
  myosotis_researches/CcGAN/visualize/visualize_datasets.py,sha256=TVyKFxyJCQl0ele_M1zp8kGP2eyXWyGnb1i2fu16ixg,2604
38
38
  myosotis_researches/CcGAN/visualize/src/style.css,sha256=4XFbetMeTKBZcG2EJH2sq4EIuvfSO_AyiVeM63ixvSI,584
39
39
  myosotis_researches/CcGAN/visualize/src/style.css.map,sha256=GTGPet_xXnKQnsz-E2CMUWtrgu3D5t0g4J_A_amFdvw,246
40
40
  myosotis_researches/CcGAN/visualize/src/style.scss,sha256=qk50CR-6wZ3lUHV5QvRWTUyqgCqOcKVEndi2Miv3Yig,533
41
41
  myosotis_researches/CcGAN/visualize/src/template.html,sha256=5b_gnguXoXw9ugaLPXQFpiv0bix4wFELABx4pzV6_ac,2371
42
- myosotis_researches-0.1.20.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
43
- myosotis_researches-0.1.20.dist-info/METADATA,sha256=c4e5_hFH0llweh-1pdZTcFRfuviPuBr8amr3FaSsR8E,3484
44
- myosotis_researches-0.1.20.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
45
- myosotis_researches-0.1.20.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
46
- myosotis_researches-0.1.20.dist-info/RECORD,,
42
+ myosotis_researches-0.1.22.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
43
+ myosotis_researches-0.1.22.dist-info/METADATA,sha256=gp66R2kQOpaIKq7jzvzY3zoJ9tT94kAb5AMRRwBBvZY,3484
44
+ myosotis_researches-0.1.22.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
45
+ myosotis_researches-0.1.22.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
46
+ myosotis_researches-0.1.22.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,34 +0,0 @@
1
- import h5py
2
- from importlib import resources
3
- import os
4
-
5
- datasets_dir = resources.files("myosotis_researches").joinpath("CcGAN", "datasets")
6
-
7
-
8
- def make_h5(
9
- old_datasets_name,
10
- size,
11
- new_datasets_path,
12
- image_indexes,
13
- train_indexes,
14
- val_indexes,
15
- ):
16
-
17
- old_datasets_path = os.path.join(
18
- datasets_dir, f"{old_datasets_name}_datasets", f"{old_datasets_name}_{size}x{size}.h5"
19
- )
20
-
21
- with h5py.File(old_datasets_path, "r") as f:
22
- image_datas = f["images"][:]
23
- image_labels = f["labels"][:]
24
- image_types = f["types"][:]
25
-
26
- with h5py.File(new_datasets_path, "w") as f:
27
- f.create_dataset("images", data=image_datas[image_indexes])
28
- f.create_dataset("indx_train", data=train_indexes)
29
- f.create_dataset("indx_valid", data=val_indexes)
30
- f.create_dataset("labels", data=image_labels[image_indexes])
31
- f.create_dataset("types", data=image_types[image_indexes])
32
-
33
-
34
- __all__ = ["make_h5"]