Skip to content

Commit

Permalink
quickstart 3d dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
swheaton committed May 22, 2024
1 parent e925518 commit 60eab97
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docs/source/user_guide/dataset_zoo/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://modelnet.cs.princeton.edu>`_ 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 <fiftyone.zoo.datasets.base.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
Expand Down
58 changes: 58 additions & 0 deletions fiftyone/zoo/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://modelnet.cs.princeton.edu>`_ 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
Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit 60eab97

Please sign in to comment.