Myosotis-Researches 0.0.12__py3-none-any.whl → 0.0.13__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.
@@ -5,10 +5,20 @@ from PIL import Image
5
5
  from print_hdf5_structure import print_hdf5_structure
6
6
 
7
7
  # Make all images to a HDF5 file
8
- def make_h5(image_dir: str, h5_path: str, image_names: list[str], image_labels, image_types):
8
+ def make_h5(image_dir, h5_path, image_names = [], indx_train = None, indx_valid = None, image_labels = None, image_types = None):
9
9
 
10
10
  N = len(image_names)
11
11
 
12
+ # Process none
13
+ if indx_train == None:
14
+ indx_train = np.array(range(1, N, 2), dtype=np.int32)
15
+ if indx_valid == None:
16
+ indx_valid = np.array(range(0, N, 2), dtype=np.int32)
17
+ if image_labels == None:
18
+ image_labels = np.zeros(N)
19
+ if image_types == None:
20
+ image_types = np.zeros(N)
21
+
12
22
  # Get image data
13
23
  image_datas = []
14
24
  for i in range(N):
@@ -19,17 +29,11 @@ def make_h5(image_dir: str, h5_path: str, image_names: list[str], image_labels,
19
29
  image_datas.append(rgb_array)
20
30
  image_datas = np.array(image_datas, dtype=np.uint8)
21
31
 
22
- # Set train_idx = 1, 3, 5, ...
23
- train_idx = np.array(range(1, N, 2), dtype=np.int32)
24
-
25
- # Set val_idx = 0, 2, 4, ...
26
- val_idx = np.array(range(0, N, 2), dtype=np.int32)
27
-
28
32
  # Create a new HDF5 file
29
33
  with h5py.File(h5_path, "w") as f:
30
34
  f.create_dataset("images", data=image_datas)
31
- f.create_dataset("indx_train", data=train_idx)
32
- f.create_dataset("indx_valid", data=val_idx)
35
+ f.create_dataset("indx_train", data=indx_train)
36
+ f.create_dataset("indx_valid", data=indx_valid)
33
37
  f.create_dataset("labels", data=image_labels)
34
38
  f.create_dataset("types", data=image_types)
35
39
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Myosotis-Researches
3
- Version: 0.0.12
3
+ Version: 0.0.13
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
@@ -3,10 +3,10 @@ myosotis_researches/CcGAN/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
3
3
  myosotis_researches/CcGAN/utils/__init__.py,sha256=Pu9COV4zcXHGXuczhObersyeshVChmlEtwqp8VLUDxw,300
4
4
  myosotis_researches/CcGAN/utils/concat_image_horizontal.py,sha256=e6WsfO9IiSoP8zkZNz7IGimPUASr9VvyJUJdF-d40iw,954
5
5
  myosotis_researches/CcGAN/utils/concat_image_vertical.py,sha256=97-SuE8ZWpaeBm_ed6MAEaUOvtpzlYq_X3yWt4OEUTY,951
6
- myosotis_researches/CcGAN/utils/make_h5.py,sha256=baY4lElNUzoCkEcoYrE1bulEYFHr1l6vKAof2WtbMQI,1239
6
+ myosotis_researches/CcGAN/utils/make_h5.py,sha256=bZGNx_SgWOaG8h3FpRk4WffC70hF6f9iIwj8z6dCKHI,1421
7
7
  myosotis_researches/CcGAN/utils/print_hdf5_structure.py,sha256=leaR8H3GhlX6EuIXDMh36xG2zBdV-XlJkaXBuoorl6I,320
8
- myosotis_researches-0.0.12.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
9
- myosotis_researches-0.0.12.dist-info/METADATA,sha256=_awkE9siKuYkbBqvK9sc9p69z7KN6NJh8Pxf3Qqp994,765
10
- myosotis_researches-0.0.12.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
11
- myosotis_researches-0.0.12.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
12
- myosotis_researches-0.0.12.dist-info/RECORD,,
8
+ myosotis_researches-0.0.13.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
9
+ myosotis_researches-0.0.13.dist-info/METADATA,sha256=2fWviTcvbMENj0D2O6asJIdg5wBWIGJLTqZgo3juQlk,765
10
+ myosotis_researches-0.0.13.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
11
+ myosotis_researches-0.0.13.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
12
+ myosotis_researches-0.0.13.dist-info/RECORD,,