hafnia 0.3.0__py3-none-any.whl → 0.4.0__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.
Files changed (34) hide show
  1. cli/__main__.py +3 -1
  2. cli/config.py +43 -3
  3. cli/keychain.py +88 -0
  4. cli/profile_cmds.py +5 -2
  5. hafnia/__init__.py +1 -1
  6. hafnia/dataset/dataset_helpers.py +9 -2
  7. hafnia/dataset/dataset_names.py +2 -1
  8. hafnia/dataset/dataset_recipe/dataset_recipe.py +49 -37
  9. hafnia/dataset/dataset_recipe/recipe_transforms.py +18 -2
  10. hafnia/dataset/dataset_upload_helper.py +60 -4
  11. hafnia/dataset/format_conversions/image_classification_from_directory.py +106 -0
  12. hafnia/dataset/format_conversions/torchvision_datasets.py +281 -0
  13. hafnia/dataset/hafnia_dataset.py +176 -50
  14. hafnia/dataset/operations/dataset_stats.py +2 -3
  15. hafnia/dataset/operations/dataset_transformations.py +19 -15
  16. hafnia/dataset/operations/table_transformations.py +4 -3
  17. hafnia/dataset/primitives/bbox.py +25 -12
  18. hafnia/dataset/primitives/bitmask.py +26 -14
  19. hafnia/dataset/primitives/classification.py +16 -8
  20. hafnia/dataset/primitives/point.py +7 -3
  21. hafnia/dataset/primitives/polygon.py +16 -9
  22. hafnia/dataset/primitives/segmentation.py +10 -7
  23. hafnia/experiment/hafnia_logger.py +0 -9
  24. hafnia/platform/dataset_recipe.py +7 -2
  25. hafnia/platform/datasets.py +3 -3
  26. hafnia/platform/download.py +23 -18
  27. hafnia/utils.py +17 -0
  28. hafnia/visualizations/image_visualizations.py +1 -1
  29. {hafnia-0.3.0.dist-info → hafnia-0.4.0.dist-info}/METADATA +8 -6
  30. hafnia-0.4.0.dist-info/RECORD +56 -0
  31. hafnia-0.3.0.dist-info/RECORD +0 -53
  32. {hafnia-0.3.0.dist-info → hafnia-0.4.0.dist-info}/WHEEL +0 -0
  33. {hafnia-0.3.0.dist-info → hafnia-0.4.0.dist-info}/entry_points.txt +0 -0
  34. {hafnia-0.3.0.dist-info → hafnia-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hafnia
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Python SDK for communication with Hafnia platform.
5
5
  Author-email: Milestone Systems <hafniaplatform@milestone.dk>
6
6
  License-File: LICENSE
@@ -9,7 +9,9 @@ Requires-Dist: boto3>=1.35.91
9
9
  Requires-Dist: click>=8.1.8
10
10
  Requires-Dist: emoji>=2.14.1
11
11
  Requires-Dist: flatten-dict>=0.4.2
12
- Requires-Dist: mlflow>=3.2.0
12
+ Requires-Dist: keyring>=25.6.0
13
+ Requires-Dist: mcp==1.16.0
14
+ Requires-Dist: mlflow>=3.4.0
13
15
  Requires-Dist: more-itertools>=10.7.0
14
16
  Requires-Dist: opencv-python-headless>=4.11.0.86
15
17
  Requires-Dist: pathspec>=0.12.1
@@ -22,7 +24,6 @@ Requires-Dist: rich>=13.9.4
22
24
  Requires-Dist: s5cmd>=0.2.0
23
25
  Requires-Dist: sagemaker-mlflow>=0.1.0
24
26
  Requires-Dist: seedir>=0.5.0
25
- Requires-Dist: tqdm>=4.67.1
26
27
  Requires-Dist: xxhash>=3.5.0
27
28
  Description-Content-Type: text/markdown
28
29
 
@@ -80,6 +81,7 @@ Copy the key and save it for later use.
80
81
  Hafnia API Key: # Pass your HAFNIA API key
81
82
  Hafnia Platform URL [https://api.mdi.milestonesys.com]: # Press [Enter]
82
83
  ```
84
+
83
85
  1. Download `mnist` from terminal to verify that your configuration is working.
84
86
 
85
87
  ```bash
@@ -91,7 +93,7 @@ With Hafnia configured on your local machine, it is now possible to download
91
93
  and explore the dataset sample with a python script:
92
94
 
93
95
  ```python
94
- from hafnia.data import load_dataset, get_dataset_path
96
+ from hafnia.data import get_dataset_path
95
97
  from hafnia.dataset.hafnia_dataset import HafniaDataset
96
98
 
97
99
  # To download the sample dataset use:
@@ -360,7 +362,7 @@ logger.log_scalar("validation/loss", value=0.1, step=100)
360
362
  logger.log_metric("validation/accuracy", value=0.95, step=100)
361
363
  ```
362
364
 
363
- Similar to `load_dataset`, the tracker behaves differently when running locally or in the cloud.
365
+ The tracker behaves differently when running locally or in the cloud.
364
366
  Locally, experiment data is stored in a local folder `.data/experiments/{DATE_TIME}`.
365
367
 
366
368
  In the cloud, the experiment data will be available in the Hafnia platform under
@@ -384,7 +386,7 @@ and datasets available in the data library.
384
386
 
385
387
  ```python
386
388
  # Load Hugging Face dataset
387
- dataset_splits = load_dataset("midwest-vehicle-detection")
389
+ dataset_splits = HafniaDataset.from_name("midwest-vehicle-detection")
388
390
 
389
391
  # Define transforms
390
392
  train_transforms = v2.Compose(
@@ -0,0 +1,56 @@
1
+ cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ cli/__main__.py,sha256=1IOe1Ewd3QMeuzUMfoWv663_jQpd7_pTn_R1sDdEmbI,1747
3
+ cli/config.py,sha256=xCLdgqBqFN3EInzJ1AO5Nj1e35jOjcc_jaukaodrrMc,7681
4
+ cli/consts.py,sha256=uCpYX44NCu_Zvte0QwChunxOo-qqhcaJRSYDAIsoJ8A,972
5
+ cli/dataset_cmds.py,sha256=KOPYdAJ1SyzTMlEi_J-70vSGIJ5acHPGIPOCKVIdlQ4,1418
6
+ cli/dataset_recipe_cmds.py,sha256=O1Pd-VvFFsmZ-nE1Mh6sCC9x45ztCJEpPCZK93qz_HQ,2887
7
+ cli/experiment_cmds.py,sha256=vc7J9JJog4EvRdgkpoMvr0kceb0QF_Rk7mn6H2KNvFE,7963
8
+ cli/keychain.py,sha256=bNyjjULVQu7kV338wUC65UvbCwmSGOmEjKWPLIQjT0k,2555
9
+ cli/profile_cmds.py,sha256=3OwpomV6Wb21ZG43xrwhvoB5S4IN1IqmVCxs-MItAho,3463
10
+ cli/runc_cmds.py,sha256=qV-LOwbFlbegH8XSELOo4h_2ajFAzdB5LtuVKKoRq8Y,5009
11
+ cli/trainer_package_cmds.py,sha256=nL7yTtR41BKzo1DWZdBdpRXGPZZIbmBe0byHAi6_n2c,2312
12
+ hafnia/__init__.py,sha256=5_DWVYRRh3ZWUo5QSRpl3tKCDDoX7YNiB14o1aaBhfo,179
13
+ hafnia/http.py,sha256=bjXbV_3uKbBdudqMdYtnsMttUAsNRMsetYZ4F2xXlEs,3635
14
+ hafnia/log.py,sha256=sWF8tz78yBtwZ9ddzm19L1MBSBJ3L4G704IGeT1_OEU,784
15
+ hafnia/torch_helpers.py,sha256=ho65B0WIu_SjbaKPRL4wabDNrnVumWH8QSXVH4r7NAY,11605
16
+ hafnia/utils.py,sha256=ieNNL8IK3IqDsRf7NJnF_NU3eMLi8d3tSQzOgW5sVOw,7319
17
+ hafnia/data/__init__.py,sha256=o9QjiGbEcNa6r-qDmwwmxPXf-1UitNl5-WxFNcujqsg,111
18
+ hafnia/data/factory.py,sha256=kHkvOtBUbwaShZBGf1kZzocDJBn_1dHHLrQxnUpJmfY,778
19
+ hafnia/dataset/dataset_helpers.py,sha256=0GbS6PfaiYBulDKRCbd0miN5LHaUIp-XzGt_wZay8xs,5044
20
+ hafnia/dataset/dataset_names.py,sha256=ZFdxsc-R6yOusT0kyh0GppjZbrDycp2Pn4WbIR060Ss,2325
21
+ hafnia/dataset/dataset_upload_helper.py,sha256=v7EwsatnD7HF3MxbGU7q7HNgRISqguKcx7qYZ56Ok-0,29911
22
+ hafnia/dataset/hafnia_dataset.py,sha256=BvJ63luf06kleR-lkqfVgU5p0ZI_JxHBbBY0FdShYKI,41864
23
+ hafnia/dataset/license_types.py,sha256=xpanTfui1pGG76mGQ9r6EywcUe1scI_zullEpmCO4GI,2190
24
+ hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=mwNL7VMhbEFHC2p6L_OO7os7bVVb05YFKZxvzQ_BySk,19059
25
+ hafnia/dataset/dataset_recipe/recipe_transforms.py,sha256=j3Oiytt3LI2rCaJid7Y44oT9MXvlZVqvZanngMebIWg,3088
26
+ hafnia/dataset/dataset_recipe/recipe_types.py,sha256=AcrG6gpRt3Igl-CCJ60uyh-WkfI1NCnQ55M8yClSI9Q,5328
27
+ hafnia/dataset/format_conversions/image_classification_from_directory.py,sha256=PVjvwjxMjvCLXSBzg0W-XRDRsZP4XkazPFK6I-S6CiE,4272
28
+ hafnia/dataset/format_conversions/torchvision_datasets.py,sha256=akDB8JpeRGJgAVgZNWgg_a4mw3uJTbYNdcYy8eadz9A,11612
29
+ hafnia/dataset/operations/dataset_stats.py,sha256=AKi17FfcnoSQLZzs64EZlIElUQ16PO2cCICkVHWj1kI,11565
30
+ hafnia/dataset/operations/dataset_transformations.py,sha256=fHN5-0FPZZ_SeaJKcAHPsQPhqOlEQCX-9B54J8tiBwk,16868
31
+ hafnia/dataset/operations/table_transformations.py,sha256=BoUmm0TDz7Iuw7942nzYjVLHGQAVDZmzI3CoCV0chR8,9305
32
+ hafnia/dataset/primitives/__init__.py,sha256=xFLJ3R7gpbuQnNJuFhuu836L3nicwoaY5aHkqk7Bbr8,927
33
+ hafnia/dataset/primitives/bbox.py,sha256=WMXnU5ISTkqkHapOxQlovU1PD9Ap_2WaSFE6fSEXOGk,6409
34
+ hafnia/dataset/primitives/bitmask.py,sha256=zldW2SrJE-8I9qEpbUMTua_ARqg5OeUljJDGVbB4QJo,8045
35
+ hafnia/dataset/primitives/classification.py,sha256=cg_ndGy5Pt1rkqV1oMN7oUZ6Y2shk-vwCod7uDMS0e4,2637
36
+ hafnia/dataset/primitives/point.py,sha256=VzCNLTQOPA6wyJVVKddZHGhltkep6V_B7pg5pk7rd9Y,879
37
+ hafnia/dataset/primitives/polygon.py,sha256=Y3c8lc54qEXB9K1netVz3BzbjMDGVukyFfxNb-7LKto,4518
38
+ hafnia/dataset/primitives/primitive.py,sha256=7jxcyFADVGf95pjeQHEOqAnR9eucLpxA2h8Blz3ppXI,1253
39
+ hafnia/dataset/primitives/segmentation.py,sha256=3kSEcz56xz149Y7WpJh-rYzdO8Oe-n3JvRIOXRgosgw,1970
40
+ hafnia/dataset/primitives/utils.py,sha256=3gT1as-xXEj8CamoIuBb9gQwUN9Ae9qnqtqF_uEe0zo,1993
41
+ hafnia/experiment/__init__.py,sha256=OEFE6HqhO5zcTCLZcPcPVjIg7wMFFnvZ1uOtAVhRz7M,85
42
+ hafnia/experiment/hafnia_logger.py,sha256=Qia8orPu7PZk12geB97alJaq6AjxYedDmKri_tmyldo,10408
43
+ hafnia/platform/__init__.py,sha256=L_Q7CNpsJ0HMNPy_rLlLK5RhmuCU7IF4BchxKv6amYc,782
44
+ hafnia/platform/builder.py,sha256=kUEuj5-qtL1uk5v2tUvOCREn5yV-G4Fr6F31haIAb5E,5808
45
+ hafnia/platform/dataset_recipe.py,sha256=ybfSSHVPG0eFUbzg_1McezPSOtMoDZEg7l6rFYndtb4,3857
46
+ hafnia/platform/datasets.py,sha256=8liAntg1GCBqqS2l80_1jaWchjBhc2Y4aVHfEEo4gsU,9036
47
+ hafnia/platform/download.py,sha256=IpxQNUABHHXTY42ET0K7qyVGlZZddYJRVRImuLWE6Ic,7337
48
+ hafnia/platform/experiment.py,sha256=SrEH0nuwwBXf1Iu4diB1BEPqL-TxW3aQkZWBbM1-tY0,1846
49
+ hafnia/platform/trainer_package.py,sha256=w6JC7o-279ujcwtNTbUaQ9AnPcYRPPbD8EACa6XyUHA,2206
50
+ hafnia/visualizations/colors.py,sha256=003eAJVnBal4abaYIIpsrT7erIOIjTUHHYVJ1Tj1CDc,5226
51
+ hafnia/visualizations/image_visualizations.py,sha256=wDWtJ7_5ACb83QtyCCslHJGK7NRWxHpRPbdop8ELE4o,7355
52
+ hafnia-0.4.0.dist-info/METADATA,sha256=fyGToq0jzW7lOf21Cr2o0pyU4eVAimYbvfxzPjB4yj0,19236
53
+ hafnia-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
54
+ hafnia-0.4.0.dist-info/entry_points.txt,sha256=FCJVIQ8GP2VE9I3eeGVF5eLxVDNW_01pOJCpG_CGnMM,45
55
+ hafnia-0.4.0.dist-info/licenses/LICENSE,sha256=wLZw1B7_mod_CO1H8LXqQgfqlWD6QceJR8--LJYRZGE,1078
56
+ hafnia-0.4.0.dist-info/RECORD,,
@@ -1,53 +0,0 @@
1
- cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- cli/__main__.py,sha256=04iqem4UAw6zSVujBt8ER0HQbEhno6rgmARmECUwRPA,1634
3
- cli/config.py,sha256=m9jrka0Rnh8_mnxnU4S_JgoYA7l1pvp2o2a7KgkYInY,6115
4
- cli/consts.py,sha256=uCpYX44NCu_Zvte0QwChunxOo-qqhcaJRSYDAIsoJ8A,972
5
- cli/dataset_cmds.py,sha256=KOPYdAJ1SyzTMlEi_J-70vSGIJ5acHPGIPOCKVIdlQ4,1418
6
- cli/dataset_recipe_cmds.py,sha256=O1Pd-VvFFsmZ-nE1Mh6sCC9x45ztCJEpPCZK93qz_HQ,2887
7
- cli/experiment_cmds.py,sha256=vc7J9JJog4EvRdgkpoMvr0kceb0QF_Rk7mn6H2KNvFE,7963
8
- cli/profile_cmds.py,sha256=eRo4FtPvXPG5LK2fINVFMsBd_HpkNygY468essBb57o,3285
9
- cli/runc_cmds.py,sha256=qV-LOwbFlbegH8XSELOo4h_2ajFAzdB5LtuVKKoRq8Y,5009
10
- cli/trainer_package_cmds.py,sha256=nL7yTtR41BKzo1DWZdBdpRXGPZZIbmBe0byHAi6_n2c,2312
11
- hafnia/__init__.py,sha256=xXUwwQ18P1YqmsZkvlkavaDqq8DbrrHf38pv5_JyV_M,179
12
- hafnia/http.py,sha256=bjXbV_3uKbBdudqMdYtnsMttUAsNRMsetYZ4F2xXlEs,3635
13
- hafnia/log.py,sha256=sWF8tz78yBtwZ9ddzm19L1MBSBJ3L4G704IGeT1_OEU,784
14
- hafnia/torch_helpers.py,sha256=ho65B0WIu_SjbaKPRL4wabDNrnVumWH8QSXVH4r7NAY,11605
15
- hafnia/utils.py,sha256=x2dPsiO0EPP6YnpQX4HBtbl29UN9hV4zHvOnDa9xYTg,6850
16
- hafnia/data/__init__.py,sha256=o9QjiGbEcNa6r-qDmwwmxPXf-1UitNl5-WxFNcujqsg,111
17
- hafnia/data/factory.py,sha256=kHkvOtBUbwaShZBGf1kZzocDJBn_1dHHLrQxnUpJmfY,778
18
- hafnia/dataset/dataset_helpers.py,sha256=HHm4KG_-upIEmxHWeSJO4m8RmrCUxKgseRNs4WD6kUQ,4781
19
- hafnia/dataset/dataset_names.py,sha256=wdLoH48ph1PjVpUYPEDnAfQYVDCvYGQCyqFmR0-ixDU,2286
20
- hafnia/dataset/dataset_upload_helper.py,sha256=QdJl92aKm3czpkgXt3G_AgwBjyOV9R4iKn4bjjlPyXA,28007
21
- hafnia/dataset/hafnia_dataset.py,sha256=XiCHv-ZSzjA4CImpyMevJ2qIJlFcKBLzwNB_HMuQGHo,36841
22
- hafnia/dataset/license_types.py,sha256=xpanTfui1pGG76mGQ9r6EywcUe1scI_zullEpmCO4GI,2190
23
- hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=A54N5qEPcM0Yswg26qaOvnr-uj3xUq-KbOInJayzbEI,19269
24
- hafnia/dataset/dataset_recipe/recipe_transforms.py,sha256=6tY4jG1Bzx15-BXp5RavjtVRWcms3o9svzfUO9-m9Ps,2154
25
- hafnia/dataset/dataset_recipe/recipe_types.py,sha256=AcrG6gpRt3Igl-CCJ60uyh-WkfI1NCnQ55M8yClSI9Q,5328
26
- hafnia/dataset/operations/dataset_stats.py,sha256=V2lCmTfIbJ-LeAyu1fZf0_1jSa4MMfP0psuXi77gOYk,11630
27
- hafnia/dataset/operations/dataset_transformations.py,sha256=JVxfw4fV51eGB7ekYfLB5FKQql6l1whTqRY_BwfX0Us,16593
28
- hafnia/dataset/operations/table_transformations.py,sha256=6LFQfFRAb1B25cS3QeliRzj26EgVyub5kE-6Sab5Ymo,9250
29
- hafnia/dataset/primitives/__init__.py,sha256=xFLJ3R7gpbuQnNJuFhuu836L3nicwoaY5aHkqk7Bbr8,927
30
- hafnia/dataset/primitives/bbox.py,sha256=HXYYy5BLNZwh-bO7aiAWg3z0OurUev8ISa-vYey8b8A,6055
31
- hafnia/dataset/primitives/bitmask.py,sha256=mq_wchMqGupJDc-a-mJh9uBO_mjHcXpLH49g591doAM,7619
32
- hafnia/dataset/primitives/classification.py,sha256=ri4lTtS5gBQX13vF07YbeN11rKl1CJaKeTIzCmoT9Iw,2363
33
- hafnia/dataset/primitives/point.py,sha256=JCRwb-E4sDafodkg6wqyuAS1Yj-yaJbwiD8aB69_Ros,635
34
- hafnia/dataset/primitives/polygon.py,sha256=vhPrYHv6TqQZMTAyv9r3NV8Hu6YRSSD0srB0wOCIwQ4,4289
35
- hafnia/dataset/primitives/primitive.py,sha256=7jxcyFADVGf95pjeQHEOqAnR9eucLpxA2h8Blz3ppXI,1253
36
- hafnia/dataset/primitives/segmentation.py,sha256=jUMjOmYr9j4An3YSCw5CJC1W8ihXAbus3CXaTOpc7Xw,1905
37
- hafnia/dataset/primitives/utils.py,sha256=3gT1as-xXEj8CamoIuBb9gQwUN9Ae9qnqtqF_uEe0zo,1993
38
- hafnia/experiment/__init__.py,sha256=OEFE6HqhO5zcTCLZcPcPVjIg7wMFFnvZ1uOtAVhRz7M,85
39
- hafnia/experiment/hafnia_logger.py,sha256=k8UIK3mXNyxpmfFndTD_u8pFA6TKbjmR-9EJ6JjvY-U,10729
40
- hafnia/platform/__init__.py,sha256=L_Q7CNpsJ0HMNPy_rLlLK5RhmuCU7IF4BchxKv6amYc,782
41
- hafnia/platform/builder.py,sha256=kUEuj5-qtL1uk5v2tUvOCREn5yV-G4Fr6F31haIAb5E,5808
42
- hafnia/platform/dataset_recipe.py,sha256=-scelPECr1eLn5tB_jFm5bJdygw_guktrWfoVquSu2A,3790
43
- hafnia/platform/datasets.py,sha256=orWdZUwrNk7BTJFJP_8TLhf0CB5PYopZug4u36w08FQ,9018
44
- hafnia/platform/download.py,sha256=Tzycmb6I6LmwACDHmJmR1zsrOX6OLgYWRbfkCXKEAdQ,6903
45
- hafnia/platform/experiment.py,sha256=SrEH0nuwwBXf1Iu4diB1BEPqL-TxW3aQkZWBbM1-tY0,1846
46
- hafnia/platform/trainer_package.py,sha256=w6JC7o-279ujcwtNTbUaQ9AnPcYRPPbD8EACa6XyUHA,2206
47
- hafnia/visualizations/colors.py,sha256=003eAJVnBal4abaYIIpsrT7erIOIjTUHHYVJ1Tj1CDc,5226
48
- hafnia/visualizations/image_visualizations.py,sha256=6mPnRAc0dMPZCUCTqnHjgtAhQdVL_QrtyToXUuJjwxQ,7355
49
- hafnia-0.3.0.dist-info/METADATA,sha256=nP2mgz_AtfOAq2OX5NgLq6lJG3fTLOog8AbKLGWYSyM,19235
50
- hafnia-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
- hafnia-0.3.0.dist-info/entry_points.txt,sha256=FCJVIQ8GP2VE9I3eeGVF5eLxVDNW_01pOJCpG_CGnMM,45
52
- hafnia-0.3.0.dist-info/licenses/LICENSE,sha256=wLZw1B7_mod_CO1H8LXqQgfqlWD6QceJR8--LJYRZGE,1078
53
- hafnia-0.3.0.dist-info/RECORD,,
File without changes