hafnia 0.4.3__py3-none-any.whl → 0.5.1__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.
- hafnia/dataset/dataset_details_uploader.py +41 -54
- hafnia/dataset/dataset_helpers.py +60 -16
- hafnia/dataset/dataset_names.py +1 -94
- hafnia/dataset/dataset_recipe/dataset_recipe.py +48 -4
- hafnia/dataset/format_conversions/torchvision_datasets.py +8 -5
- hafnia/dataset/hafnia_dataset.py +261 -92
- hafnia/dataset/hafnia_dataset_types.py +145 -19
- hafnia/dataset/operations/dataset_s3_storage.py +216 -0
- hafnia/dataset/operations/table_transformations.py +2 -19
- hafnia/http.py +2 -1
- hafnia/platform/datasets.py +144 -153
- hafnia/platform/download.py +1 -1
- hafnia/platform/s5cmd_utils.py +266 -0
- hafnia/utils.py +4 -0
- {hafnia-0.4.3.dist-info → hafnia-0.5.1.dist-info}/METADATA +3 -3
- {hafnia-0.4.3.dist-info → hafnia-0.5.1.dist-info}/RECORD +22 -20
- {hafnia-0.4.3.dist-info → hafnia-0.5.1.dist-info}/WHEEL +1 -1
- hafnia_cli/dataset_cmds.py +36 -12
- hafnia_cli/profile_cmds.py +0 -1
- hafnia_cli/runc_cmds.py +7 -2
- {hafnia-0.4.3.dist-info → hafnia-0.5.1.dist-info}/entry_points.txt +0 -0
- {hafnia-0.4.3.dist-info → hafnia-0.5.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
hafnia/__init__.py,sha256=0qpjWfVbcfKzLSnfUW6RdclSGkesMQRFS-n_aTJJoSE,179
|
|
2
|
-
hafnia/http.py,sha256=
|
|
2
|
+
hafnia/http.py,sha256=PkEuanlUKeERABXttaGAJT6hOZ1_B2CwJodbUV4uZdg,3710
|
|
3
3
|
hafnia/log.py,sha256=sWF8tz78yBtwZ9ddzm19L1MBSBJ3L4G704IGeT1_OEU,784
|
|
4
4
|
hafnia/torch_helpers.py,sha256=Qj8pV5P8tGw6F3W2Rj9Kel7O8hWuUqiKfTdXd3h5UOo,14080
|
|
5
|
-
hafnia/utils.py,sha256=
|
|
5
|
+
hafnia/utils.py,sha256=l_awkrb3OttxqSMkPiYcpuP3c_kejkSmiqndSahc1s0,8703
|
|
6
6
|
hafnia/data/__init__.py,sha256=o9QjiGbEcNa6r-qDmwwmxPXf-1UitNl5-WxFNcujqsg,111
|
|
7
7
|
hafnia/data/factory.py,sha256=kHkvOtBUbwaShZBGf1kZzocDJBn_1dHHLrQxnUpJmfY,778
|
|
8
|
-
hafnia/dataset/dataset_details_uploader.py,sha256=
|
|
9
|
-
hafnia/dataset/dataset_helpers.py,sha256=
|
|
10
|
-
hafnia/dataset/dataset_names.py,sha256=
|
|
11
|
-
hafnia/dataset/hafnia_dataset.py,sha256=
|
|
12
|
-
hafnia/dataset/hafnia_dataset_types.py,sha256=
|
|
8
|
+
hafnia/dataset/dataset_details_uploader.py,sha256=H_zz67bBwbgo4StUwBNmH89WlqydIc-tEQbrRnZDwgg,24161
|
|
9
|
+
hafnia/dataset/dataset_helpers.py,sha256=N8W_ioDlxP2VvNJXzqXLDbcEqgPKz0WyPNOBakHoBUc,6443
|
|
10
|
+
hafnia/dataset/dataset_names.py,sha256=42_UKrDwcKEW48oTbtBaeyi5qVFVaMAj8vRvDv-mcEI,3616
|
|
11
|
+
hafnia/dataset/hafnia_dataset.py,sha256=OOenIMPm8K23AgxHvmc_y05KCzxIwaZa-gv3uNC50NU,38519
|
|
12
|
+
hafnia/dataset/hafnia_dataset_types.py,sha256=eCLawdjIFoul67AAtQ4xaKjbVSNAFA-mvbJYofiu2Sg,26848
|
|
13
13
|
hafnia/dataset/license_types.py,sha256=b1Jt5e8N89sujIs4T9y39sJEkzpAwCoLDTHDTpkiEOI,2166
|
|
14
|
-
hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=
|
|
14
|
+
hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=Ln49jcpOQ4qzumv-SkWSBCqNgSP1dGQloKSLs7psP90,20991
|
|
15
15
|
hafnia/dataset/dataset_recipe/recipe_transforms.py,sha256=j3Oiytt3LI2rCaJid7Y44oT9MXvlZVqvZanngMebIWg,3088
|
|
16
16
|
hafnia/dataset/dataset_recipe/recipe_types.py,sha256=AcrG6gpRt3Igl-CCJ60uyh-WkfI1NCnQ55M8yClSI9Q,5328
|
|
17
17
|
hafnia/dataset/format_conversions/format_coco.py,sha256=7GjeF016ZBaKxu-VYiqXxuPw8HuuODV1cxc2TbDDZBw,19628
|
|
18
18
|
hafnia/dataset/format_conversions/format_helpers.py,sha256=-lNgn_mrpVM_Xwb3jHH0BlBEPCMKjLqTeYf4PbssbuQ,1144
|
|
19
19
|
hafnia/dataset/format_conversions/format_image_classification_folder.py,sha256=ALVsQfSvBfAkpmUDijznqqd2JBh0Qtnvzq7igxMjMb8,7170
|
|
20
20
|
hafnia/dataset/format_conversions/format_yolo.py,sha256=zvCHo2L_0mPJScMbDtwvZUts9UX2ERKhhYbY31Q6tQA,9912
|
|
21
|
-
hafnia/dataset/format_conversions/torchvision_datasets.py,sha256=
|
|
21
|
+
hafnia/dataset/format_conversions/torchvision_datasets.py,sha256=sC8DgAt10PEaCHFk_Lm-dIzr_0EF-2g24kG9EINYk7c,12096
|
|
22
|
+
hafnia/dataset/operations/dataset_s3_storage.py,sha256=xPC77Og47xTpI0JBFAR1pgb5u7l18byAA6p7IlpnpGE,8971
|
|
22
23
|
hafnia/dataset/operations/dataset_stats.py,sha256=Ltf-V4_o_IB4UXw9WG9bsVoqeX90yGsjivK0CDggriw,11930
|
|
23
24
|
hafnia/dataset/operations/dataset_transformations.py,sha256=qUNno0rAT1A452uzlR-k1WbatyY9VuMp1QJjkMg9GzE,19495
|
|
24
|
-
hafnia/dataset/operations/table_transformations.py,sha256=
|
|
25
|
+
hafnia/dataset/operations/table_transformations.py,sha256=mdjUE1lSQ7QyONjQapSHDg1MkYuKaflcoVUq1Y6Lkqc,13606
|
|
25
26
|
hafnia/dataset/primitives/__init__.py,sha256=xFLJ3R7gpbuQnNJuFhuu836L3nicwoaY5aHkqk7Bbr8,927
|
|
26
27
|
hafnia/dataset/primitives/bbox.py,sha256=QJJBebltOd9J3idisp3QdX0gCgz6P5xlIlGbth19fG0,6669
|
|
27
28
|
hafnia/dataset/primitives/bitmask.py,sha256=Q7RiNYvMDlcFPkXAWXDJkCIERjnUTCrHu6VeEPX1jEA,7212
|
|
@@ -36,9 +37,10 @@ hafnia/experiment/hafnia_logger.py,sha256=BHIOLAds_3JxT0cev_ikUH0XQVIxBJTkcBSx2Q
|
|
|
36
37
|
hafnia/platform/__init__.py,sha256=L_Q7CNpsJ0HMNPy_rLlLK5RhmuCU7IF4BchxKv6amYc,782
|
|
37
38
|
hafnia/platform/builder.py,sha256=kUEuj5-qtL1uk5v2tUvOCREn5yV-G4Fr6F31haIAb5E,5808
|
|
38
39
|
hafnia/platform/dataset_recipe.py,sha256=ybfSSHVPG0eFUbzg_1McezPSOtMoDZEg7l6rFYndtb4,3857
|
|
39
|
-
hafnia/platform/datasets.py,sha256=
|
|
40
|
-
hafnia/platform/download.py,sha256=
|
|
40
|
+
hafnia/platform/datasets.py,sha256=nXHg3I14p3tJeDX2woPH9NMiOxn_54zlIOPJXvXFI_w,9448
|
|
41
|
+
hafnia/platform/download.py,sha256=e73Pm0afwRPTHxBvRy0gUZSFfDuePHPnfasyhaZ-KGQ,5019
|
|
41
42
|
hafnia/platform/experiment.py,sha256=SrEH0nuwwBXf1Iu4diB1BEPqL-TxW3aQkZWBbM1-tY0,1846
|
|
43
|
+
hafnia/platform/s5cmd_utils.py,sha256=hHsGPJ1S9_hFIVfCO-efvTF4qbLYreK1nl3VC5caU1w,9491
|
|
42
44
|
hafnia/platform/trainer_package.py,sha256=w6JC7o-279ujcwtNTbUaQ9AnPcYRPPbD8EACa6XyUHA,2206
|
|
43
45
|
hafnia/visualizations/colors.py,sha256=003eAJVnBal4abaYIIpsrT7erIOIjTUHHYVJ1Tj1CDc,5226
|
|
44
46
|
hafnia/visualizations/image_visualizations.py,sha256=rB7c-KK-qq0BsSdkaFxCAHOOCTXTUQx0VMEhib7ig0k,7509
|
|
@@ -46,15 +48,15 @@ hafnia_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
46
48
|
hafnia_cli/__main__.py,sha256=CqD_7RfbfwB6MED3WZ8WxclrFxWcRMtZ5A1Snnst3GM,1761
|
|
47
49
|
hafnia_cli/config.py,sha256=X0dJBYH-7mNAFkHgeZvDbawlQqoyCwoY4C-QhlyYCA0,7695
|
|
48
50
|
hafnia_cli/consts.py,sha256=uCpYX44NCu_Zvte0QwChunxOo-qqhcaJRSYDAIsoJ8A,972
|
|
49
|
-
hafnia_cli/dataset_cmds.py,sha256=
|
|
51
|
+
hafnia_cli/dataset_cmds.py,sha256=JfSj7Cei1T2oYUXP1bpz63uQopgL3R_dMMYnPGGcuU8,2072
|
|
50
52
|
hafnia_cli/dataset_recipe_cmds.py,sha256=OYSmpKL0Wxo1ZSxIGfH6w7pEWoI7CjUTmfIELJSZjGQ,2894
|
|
51
53
|
hafnia_cli/experiment_cmds.py,sha256=_KxsMhbjlkIno1PIMXJ0Omw_PSJi8qi9hmtCUqwcj1M,7970
|
|
52
54
|
hafnia_cli/keychain.py,sha256=bNyjjULVQu7kV338wUC65UvbCwmSGOmEjKWPLIQjT0k,2555
|
|
53
|
-
hafnia_cli/profile_cmds.py,sha256=
|
|
54
|
-
hafnia_cli/runc_cmds.py,sha256=
|
|
55
|
+
hafnia_cli/profile_cmds.py,sha256=yTyOsPsUssLCzFIxURkxbKrFEhYIVDlUC0G2s5Uks-U,3476
|
|
56
|
+
hafnia_cli/runc_cmds.py,sha256=7P5TjF6KA9K4OKPG1qC_0gteXfLJbXlA858WWrosoGQ,5098
|
|
55
57
|
hafnia_cli/trainer_package_cmds.py,sha256=hUBc6gCMV28fcAA0xQdXKL1z-a3aL9lMWcVqjvHO1Uo,2326
|
|
56
|
-
hafnia-0.
|
|
57
|
-
hafnia-0.
|
|
58
|
-
hafnia-0.
|
|
59
|
-
hafnia-0.
|
|
60
|
-
hafnia-0.
|
|
58
|
+
hafnia-0.5.1.dist-info/METADATA,sha256=QkN31qwV-oFfSrp_s2pXEc5GFRhY0sn5dBVo8r-qOAs,19272
|
|
59
|
+
hafnia-0.5.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
60
|
+
hafnia-0.5.1.dist-info/entry_points.txt,sha256=j2jsj1pqajLAiSOnF7sq66A3d1SVeHPKVTVyIFzipSA,52
|
|
61
|
+
hafnia-0.5.1.dist-info/licenses/LICENSE,sha256=wLZw1B7_mod_CO1H8LXqQgfqlWD6QceJR8--LJYRZGE,1078
|
|
62
|
+
hafnia-0.5.1.dist-info/RECORD,,
|
hafnia_cli/dataset_cmds.py
CHANGED
|
@@ -3,8 +3,8 @@ from typing import Optional
|
|
|
3
3
|
|
|
4
4
|
import click
|
|
5
5
|
|
|
6
|
+
import hafnia.dataset.hafnia_dataset
|
|
6
7
|
from hafnia import utils
|
|
7
|
-
from hafnia_cli import consts
|
|
8
8
|
from hafnia_cli.config import Config
|
|
9
9
|
|
|
10
10
|
|
|
@@ -26,6 +26,13 @@ def cmd_list_datasets(cfg: Config) -> None:
|
|
|
26
26
|
|
|
27
27
|
@dataset.command("download")
|
|
28
28
|
@click.argument("dataset_name")
|
|
29
|
+
@click.option(
|
|
30
|
+
"--version",
|
|
31
|
+
"-v",
|
|
32
|
+
default="latest",
|
|
33
|
+
required=False,
|
|
34
|
+
help="Dataset version to download e.g. '0.0.1' or '1.0.1'. Defaults to the latest version.",
|
|
35
|
+
)
|
|
29
36
|
@click.option(
|
|
30
37
|
"--destination",
|
|
31
38
|
"-d",
|
|
@@ -35,18 +42,35 @@ def cmd_list_datasets(cfg: Config) -> None:
|
|
|
35
42
|
)
|
|
36
43
|
@click.option("--force", "-f", is_flag=True, default=False, help="Flag to enable force redownload")
|
|
37
44
|
@click.pass_obj
|
|
38
|
-
def cmd_dataset_download(
|
|
45
|
+
def cmd_dataset_download(
|
|
46
|
+
cfg: Config, dataset_name: str, version: Optional[str], destination: Optional[click.Path], force: bool
|
|
47
|
+
) -> Path:
|
|
39
48
|
"""Download dataset from Hafnia platform"""
|
|
40
49
|
|
|
50
|
+
path_dataset = hafnia.dataset.hafnia_dataset.download_or_get_dataset_path(
|
|
51
|
+
dataset_name=dataset_name,
|
|
52
|
+
version=version,
|
|
53
|
+
cfg=cfg,
|
|
54
|
+
path_datasets_folder=destination,
|
|
55
|
+
force_redownload=force,
|
|
56
|
+
)
|
|
57
|
+
return path_dataset
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@dataset.command("delete")
|
|
61
|
+
@click.argument("dataset_name")
|
|
62
|
+
@click.option(
|
|
63
|
+
"--interactive/--no-interactive",
|
|
64
|
+
default=True,
|
|
65
|
+
help="Whether to ask for confirmation before deleting the dataset.",
|
|
66
|
+
)
|
|
67
|
+
@click.pass_obj
|
|
68
|
+
def cmd_dataset_delete(cfg: Config, dataset_name: str, interactive: bool) -> None:
|
|
69
|
+
"""Delete dataset from Hafnia platform"""
|
|
41
70
|
from hafnia.platform import datasets
|
|
42
71
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
force_redownload=force,
|
|
49
|
-
)
|
|
50
|
-
except Exception:
|
|
51
|
-
raise click.ClickException(consts.ERROR_GET_RESOURCE)
|
|
52
|
-
return path_dataset
|
|
72
|
+
datasets.delete_dataset_completely_by_name(
|
|
73
|
+
dataset_name=dataset_name,
|
|
74
|
+
interactive=interactive,
|
|
75
|
+
cfg=cfg,
|
|
76
|
+
)
|
hafnia_cli/profile_cmds.py
CHANGED
|
@@ -94,7 +94,6 @@ def cmd_profile_active(cfg: Config) -> None:
|
|
|
94
94
|
def profile_show(cfg: Config) -> None:
|
|
95
95
|
masked_key = f"{cfg.api_key[:11]}...{cfg.api_key[-4:]}" if len(cfg.api_key) > 20 else "****"
|
|
96
96
|
console = Console()
|
|
97
|
-
|
|
98
97
|
table = Table(title=f"{consts.PROFILE_TABLE_HEADER} {cfg.active_profile}", show_header=False)
|
|
99
98
|
table.add_column("Property", style="cyan")
|
|
100
99
|
table.add_column("Value")
|
hafnia_cli/runc_cmds.py
CHANGED
|
@@ -38,7 +38,7 @@ def runc():
|
|
|
38
38
|
@click.pass_obj
|
|
39
39
|
def launch_local(cfg: Config, exec_cmd: str, dataset: str, image_name: str) -> None:
|
|
40
40
|
"""Launch a job within the image."""
|
|
41
|
-
from hafnia.
|
|
41
|
+
from hafnia.dataset.hafnia_dataset import download_or_get_dataset_path
|
|
42
42
|
|
|
43
43
|
is_local_dataset = "/" in dataset
|
|
44
44
|
if is_local_dataset:
|
|
@@ -48,7 +48,12 @@ def launch_local(cfg: Config, exec_cmd: str, dataset: str, image_name: str) -> N
|
|
|
48
48
|
raise click.ClickException(f"Dataset path does not exist: {path_dataset}")
|
|
49
49
|
else:
|
|
50
50
|
click.echo(f"Using Hafnia dataset: {dataset}")
|
|
51
|
-
path_dataset = download_or_get_dataset_path(
|
|
51
|
+
path_dataset = download_or_get_dataset_path(
|
|
52
|
+
dataset_name=dataset,
|
|
53
|
+
version="latest",
|
|
54
|
+
cfg=cfg,
|
|
55
|
+
force_redownload=False,
|
|
56
|
+
)
|
|
52
57
|
|
|
53
58
|
if image_name is None:
|
|
54
59
|
# Load image name from state.json
|
|
File without changes
|
|
File without changes
|