Myosotis-Researches 0.0.11__tar.gz → 0.0.13__tar.gz
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.
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13/Myosotis_Researches.egg-info}/PKG-INFO +1 -1
- {myosotis_researches-0.0.11/Myosotis_Researches.egg-info → myosotis_researches-0.0.13}/PKG-INFO +1 -1
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/utils/make_h5.py +14 -10
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/setup.py +1 -1
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/LICENSE +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/Myosotis_Researches.egg-info/SOURCES.txt +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/Myosotis_Researches.egg-info/dependency_links.txt +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/Myosotis_Researches.egg-info/top_level.txt +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/README.md +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/__init__.py +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/utils/__init__.py +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/utils/concat_image_horizontal.py +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/utils/concat_image_vertical.py +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/utils/print_hdf5_structure.py +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/__init__.py +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/pyproject.toml +0 -0
- {myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/setup.cfg +0 -0
{myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/utils/make_h5.py
RENAMED
@@ -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
|
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):
|
@@ -17,19 +27,13 @@ def make_h5(image_dir: str, h5_path: str, image_names: list[str], image_labels,
|
|
17
27
|
image = Image.open(image_path).convert("RGB")
|
18
28
|
rgb_array = np.array(image).transpose((2, 0, 1))
|
19
29
|
image_datas.append(rgb_array)
|
20
|
-
|
21
|
-
|
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)
|
30
|
+
image_datas = np.array(image_datas, dtype=np.uint8)
|
27
31
|
|
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=
|
32
|
-
f.create_dataset("indx_valid", data=
|
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
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="Myosotis-Researches",
|
5
|
-
version="0.0.
|
5
|
+
version="0.0.13",
|
6
6
|
description="A repository for storing my progress of researches.",
|
7
7
|
long_description=open("README.md").read(),
|
8
8
|
long_description_content_type="text/markdown",
|
File without changes
|
{myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/Myosotis_Researches.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/Myosotis_Researches.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
{myosotis_researches-0.0.11 → myosotis_researches-0.0.13}/myosotis_researches/CcGAN/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|