Myosotis-Researches 0.1.0__py3-none-any.whl → 0.1.2__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.
- myosotis_researches/CcGAN/utils/concat_image.py +2 -2
- myosotis_researches/CcGAN/utils/make_h5.py +32 -41
- {myosotis_researches-0.1.0.dist-info → myosotis_researches-0.1.2.dist-info}/METADATA +6 -5
- {myosotis_researches-0.1.0.dist-info → myosotis_researches-0.1.2.dist-info}/RECORD +7 -7
- {myosotis_researches-0.1.0.dist-info → myosotis_researches-0.1.2.dist-info}/WHEEL +0 -0
- {myosotis_researches-0.1.0.dist-info → myosotis_researches-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {myosotis_researches-0.1.0.dist-info → myosotis_researches-0.1.2.dist-info}/top_level.txt +0 -0
@@ -62,9 +62,9 @@ def _concat_image_vertical(img_list: list[Image], gap=2) -> Image:
|
|
62
62
|
def concat_image(img_list: list[Image], gap=2, direction="vertical"):
|
63
63
|
|
64
64
|
if direction == "vertical":
|
65
|
-
_concat_image_vertical(img_list, gap=gap)
|
65
|
+
return _concat_image_vertical(img_list, gap=gap)
|
66
66
|
elif direction == "horizontal":
|
67
|
-
_concat_image_horizontal(img_list, gap=gap)
|
67
|
+
return _concat_image_horizontal(img_list, gap=gap)
|
68
68
|
else:
|
69
69
|
raise ValueError("Direction should be 'vertical' or 'horizontal'.")
|
70
70
|
|
@@ -1,43 +1,34 @@
|
|
1
1
|
import h5py
|
2
|
-
|
2
|
+
from importlib import resources
|
3
3
|
import os
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def make_h5(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
f.create_dataset("indx_train", data=indx_train)
|
36
|
-
f.create_dataset("indx_valid", data=indx_valid)
|
37
|
-
f.create_dataset("labels", data=image_labels)
|
38
|
-
f.create_dataset("types", data=image_types)
|
39
|
-
|
40
|
-
# Visualize
|
41
|
-
f.visititems(print_hdf5)
|
42
|
-
|
43
|
-
__all__ = ["make_h5"]
|
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, old_datasets_name, 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"]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: Myosotis-Researches
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
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
|
@@ -59,10 +59,11 @@ Import with code
|
|
59
59
|
from myosotis_researches.utils import *
|
60
60
|
```
|
61
61
|
|
62
|
-
| Function
|
63
|
-
|
|
64
|
-
| `concat_image(img_list, gap=2, direction="vertical")`
|
65
|
-
| `
|
62
|
+
| Function | Description |
|
63
|
+
| ------------------------------------------------------------ | ----------------------------------------- |
|
64
|
+
| `concat_image(img_list, gap=2, direction="vertical")` | Concat images vertically or horizontally. |
|
65
|
+
| `make_h5(old_datasets_name, size, new_datasets_path, image_indexes, train_indexes, val_indexes)` | Get piece of original HDF5 datasets. |
|
66
|
+
| `print_hdf5(name, obj)` | Print a basic structure of an HDF5 file. |
|
66
67
|
|
67
68
|
**Note**:
|
68
69
|
|
@@ -45,11 +45,11 @@ myosotis_researches/CcGAN/train_128_output_10/train_cgan_concat.py,sha256=PYctY3
|
|
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
47
|
myosotis_researches/CcGAN/utils/__init__.py,sha256=azZ2ZSSmWREoptI_5oQ180HojMoCqv2oleveRswq40w,155
|
48
|
-
myosotis_researches/CcGAN/utils/concat_image.py,sha256=
|
49
|
-
myosotis_researches/CcGAN/utils/make_h5.py,sha256=
|
48
|
+
myosotis_researches/CcGAN/utils/concat_image.py,sha256=BIGKz52Inn9S7M5fBFKye2V9bLJ0DqEQILoOVWAXUiE,2165
|
49
|
+
myosotis_researches/CcGAN/utils/make_h5.py,sha256=HS0wzFVMh_Hh2xxoOpc47SUfhU6S2wR0wtveDJUkpOg,940
|
50
50
|
myosotis_researches/CcGAN/utils/print_hdf5.py,sha256=VvmNAWtMDmg6D9V6ZbSUXrQTKRh9WIJeC4BR_ORJkco,300
|
51
|
-
myosotis_researches-0.1.
|
52
|
-
myosotis_researches-0.1.
|
53
|
-
myosotis_researches-0.1.
|
54
|
-
myosotis_researches-0.1.
|
55
|
-
myosotis_researches-0.1.
|
51
|
+
myosotis_researches-0.1.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
52
|
+
myosotis_researches-0.1.2.dist-info/METADATA,sha256=uDjW4mHEPM12GtiuomEAPnk_GJbBD9Pwxwo3_lBZ4G8,2663
|
53
|
+
myosotis_researches-0.1.2.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
54
|
+
myosotis_researches-0.1.2.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
|
55
|
+
myosotis_researches-0.1.2.dist-info/RECORD,,
|
File without changes
|
{myosotis_researches-0.1.0.dist-info → myosotis_researches-0.1.2.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|