From e4103504548ea150a9a933e35ba5e282cf008692 Mon Sep 17 00:00:00 2001 From: Martin Kozlovsky Date: Fri, 5 Jan 2024 15:51:53 +0100 Subject: [PATCH] cosmetic changes, small bug fixes --- data/.gitkeep | 0 docs/requirements.txt | 1 - examples/COCO_people_subset.ipynb | 2 ++ luxonis_ml/data/augmentations.py | 3 +-- luxonis_ml/data/parsers.py | 42 +++++++++++++++---------------- pyproject.toml | 8 +++--- 6 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 data/.gitkeep delete mode 100644 docs/requirements.txt diff --git a/data/.gitkeep b/data/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 7dfc27b0..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pydoctor diff --git a/examples/COCO_people_subset.ipynb b/examples/COCO_people_subset.ipynb index 03397abc..dd4e76ff 100644 --- a/examples/COCO_people_subset.ipynb +++ b/examples/COCO_people_subset.ipynb @@ -66,6 +66,8 @@ "output_zip = \"../data/COCO_people_subset.zip\"\n", "output_folder = \"../data/\"\n", "\n", + "if not os.path.exists(output_folder):\n", + " os.mkdir(output_folder)\n", "# Check if the data already exists\n", "if not os.path.exists(output_zip) and not os.path.exists(\n", " os.path.join(output_folder, \"COCO_people_subset\")\n", diff --git a/luxonis_ml/data/augmentations.py b/luxonis_ml/data/augmentations.py index 7d625e6b..02832884 100644 --- a/luxonis_ml/data/augmentations.py +++ b/luxonis_ml/data/augmentations.py @@ -14,10 +14,9 @@ KeypointType, ) +from luxonis_ml.enums import LabelType from luxonis_ml.utils.registry import Registry -from .loader import LabelType - AUGMENTATIONS = Registry(name="augmentations") diff --git a/luxonis_ml/data/parsers.py b/luxonis_ml/data/parsers.py index cae77ae9..180414d0 100644 --- a/luxonis_ml/data/parsers.py +++ b/luxonis_ml/data/parsers.py @@ -22,6 +22,27 @@ """ +def parsing_wrapper(func: Callable) -> Callable: + """Wrapper for parsing functions that adds data to LDF. + + @type func: Callable + @param func: Parsing function + @rtype: Callable + @return: Wrapper function + """ + + def wrapper(*args, **kwargs): + dataset = args[0].dataset + generator, class_names, skeletons, added_images = func(*args, **kwargs) + dataset.set_classes(class_names) + dataset.set_skeletons(skeletons) + dataset.add(generator) + + return added_images + + return wrapper + + class LuxonisParser: def __init__(self, **ldf_kwargs): """A parser class used for parsing common dataset formats to LDF. @@ -36,27 +57,6 @@ def __init__(self, **ldf_kwargs): ) self.dataset = LuxonisDataset(**ldf_kwargs) - @staticmethod - def parsing_wrapper(func: Callable) -> Callable: - """Wrapper for parsing functions that adds data to LDF. - - @type func: Callable - @param func: Parsing function - @rtype: Callable - @return: Wrapper function - """ - - def wrapper(*args, **kwargs): - dataset = args[0].dataset - generator, class_names, skeletons, added_images = func(*args, **kwargs) - dataset.set_classes(class_names) - dataset.set_skeletons(skeletons) - dataset.add(generator) - - return added_images - - return wrapper - def parse_dir( self, dataset_type: DatasetType, diff --git a/pyproject.toml b/pyproject.toml index aa8d4621..30fc6de3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "luxonis-ml" version = "0.0.1" -description = "This package provides MLOps tools for training models for OAK devices" +description = "MLOps tools for training models for Luxonis devices" readme = "README.md" requires-python = ">=3.8" license = { file = "LICENSE" } @@ -10,7 +10,7 @@ maintainers = [{ name = "Luxonis", email = "support@luxonis.com" }] keywords = ["ml", "ops", "camera", "luxonis", "oak"] dynamic = ["dependencies", "optional-dependencies"] classifiers = [ - "License :: Apache License 2.0", + "License :: OSI Approved :: Apache Software License", "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -24,8 +24,8 @@ classifiers = [ luxonis_ml = "luxonis_ml.luxonis_ml:main" [project.urls] -repository = "https://github.com/luxonis/models" -issues = "https://github.com/luxonis/models/issues" +repository = "https://github.com/luxonis/luxonis-ml" +issues = "https://github.com/luxonis/luxonis-ml/issues" [build-system] requires = ["setuptools", "wheel"]