diff --git a/docs/source/user_guide/dataset_zoo/datasets.rst b/docs/source/user_guide/dataset_zoo/datasets.rst index 29cc2a10f98..00e42aae1ab 100644 --- a/docs/source/user_guide/dataset_zoo/datasets.rst +++ b/docs/source/user_guide/dataset_zoo/datasets.rst @@ -3450,6 +3450,57 @@ annotation data. :alt: quickstart-groups :align: center +.. _dataset-zoo-quickstart-3d: + +Quickstart 3D +------------- + +A small 3D dataset with meshes, point clouds, and oriented bounding boxes. + +The dataset consists of 200 3D mesh samples from the test split of the +`ModelNet40 `_ dataset, with point +clouds generated using a Poisson disk sampling method, and oriented +bounding boxes generated based on the convex hull. + +Objects have been rescaled and recentered from the original dataset. + +**Details** + +- Dataset name: ``quickstart-3d`` +- Dataset size: 223.40 MB +- Tags: ``3d, point-cloud, mesh, quickstart`` +- Supported splits: ``N/A`` +- ZooDataset class: + :class:`Quickstart3DDataset ` + +**Example usage** + +.. tabs:: + + .. group-tab:: Python + + .. code-block:: python + :linenos: + + import fiftyone as fo + import fiftyone.zoo as foz + + dataset = foz.load_zoo_dataset("quickstart-3d") + + session = fo.launch_app(dataset) + + .. group-tab:: CLI + + .. code-block:: shell + + fiftyone zoo datasets load quickstart-3d + + fiftyone app launch quickstart-3d + +.. image:: /images/dataset_zoo/quickstart.png + :alt: quickstart + :align: center + .. _dataset-zoo-sama-coco: Sama-COCO diff --git a/fiftyone/zoo/datasets/base.py b/fiftyone/zoo/datasets/base.py index deeb3a3ccda..3a638e9f23f 100644 --- a/fiftyone/zoo/datasets/base.py +++ b/fiftyone/zoo/datasets/base.py @@ -3179,6 +3179,63 @@ def _patch_if_necessary(self, dataset_dir, _): etau.delete_dir(scratch_dir) +class Quickstart3DDataset(FiftyOneDataset): + """A small 3D dataset with meshes, point clouds, and oriented bounding boxes. + + The dataset consists of 200 3D mesh samples from the test split of the + `ModelNet40 `_ dataset, with point + clouds generated using a Poisson disk sampling method, and oriented + bounding boxes generated based on the convex hull. + + Objects have been rescaled and recentered from the original dataset. + + Example usage:: + + import fiftyone as fo + import fiftyone.zoo as foz + + dataset = foz.load_zoo_dataset("quickstart-3d") + + session = fo.launch_app(dataset) + + Dataset size + 223.40 MB + """ + + _GDRIVE_ID = "1EnQ2-gGDktEd8pAWwdXNK-FeHUFTFl5K" + _ARCHIVE_NAME = "quickstart-3d.zip" + _DIR_IN_ARCHIVE = "quickstart-3d" + + @property + def name(self): + return "quickstart-3d" + + @property + def tags(self): + return ("3d", "point-cloud", "mesh", "quickstart") + + @property + def supported_splits(self): + return None + + def _download_and_prepare(self, dataset_dir, scratch_dir, _): + _download_and_extract_archive( + self._GDRIVE_ID, + self._ARCHIVE_NAME, + self._DIR_IN_ARCHIVE, + dataset_dir, + scratch_dir, + ) + + logger.info("Parsing dataset metadata") + dataset_type = fot.FiftyOneDataset() + importer = foud.FiftyOneDatasetImporter + num_samples = importer._get_num_samples(dataset_dir) + logger.info("Found %d samples", num_samples) + + return dataset_type, num_samples, None + + class UCF101Dataset(FiftyOneDataset): """UCF101 is an action recognition data set of realistic action videos, collected from YouTube, having 101 action categories. This data set is an @@ -3289,6 +3346,7 @@ def _download_and_prepare(self, dataset_dir, scratch_dir, split): "quickstart-geo": QuickstartGeoDataset, "quickstart-video": QuickstartVideoDataset, "quickstart-groups": QuickstartGroupsDataset, + "quickstart-3d": Quickstart3DDataset, "sama-coco": SamaCOCODataset, "ucf101": UCF101Dataset, }