Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Mark unstable features as Beta (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris authored Apr 6, 2022
1 parent 2bee23d commit 1d926b5
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 6 deletions.
9 changes: 5 additions & 4 deletions docs/extensions/stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<p class="admonition-title">{title}</p>
<p>
This {scope} is currently in Beta. The API and functionality may change without warning in future
{message} The API and functionality may change without warning in future
releases. :ref:`More details <stability>`.
.. raw:: html
Expand All @@ -33,15 +33,16 @@


class Beta(Directive):
has_content = True
has_content = False
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = True

def run(self):

scope = self.arguments[0]
message = self.arguments[-1].strip()

admonition_rst = ADMONITION_TEMPLATE.format(type="beta", title="Beta", scope=scope)
admonition_rst = ADMONITION_TEMPLATE.format(type="beta", title="Beta", message=message)
admonition_list = StringList(admonition_rst.split("\n"))
admonition = nodes.paragraph()
self.state.nested_parse(admonition_list, self.content_offset, admonition)
Expand Down
2 changes: 2 additions & 0 deletions docs/source/general/flash_zero.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. beta:: Flash Zero is currently in Beta.

.. _flash_zero:

**********
Expand Down
2 changes: 2 additions & 0 deletions docs/source/integrations/baal.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. beta:: The BaaL integration is currently in Beta.

.. _baal:

####
Expand Down
2 changes: 2 additions & 0 deletions docs/source/integrations/learn2learn.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. beta:: The Learn2Learn integration is currently in Beta.

.. _learn2learn:

###########
Expand Down
2 changes: 2 additions & 0 deletions docs/source/integrations/vissl.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. beta:: The VISSL integration is currently in Beta.

.. _vissl:

#####
Expand Down
3 changes: 3 additions & 0 deletions docs/source/reference/image_embedder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
:card_description: Learn to generate embeddings from images with Flash.
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_embedder.svg
:tags: Image,Embedding
:beta:

.. beta:: The VISSL integration is currently in Beta.

.. warning::

Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/pointcloud_object_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:tags: Point-Cloud,Detection
:beta:

.. beta:: task
.. beta:: Point cloud object detection is currently in Beta.

.. _pointcloud_object_detection:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/pointcloud_segmentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:tags: Point-Cloud,Segmentation
:beta:

.. beta:: task
.. beta:: Point cloud segmentation is currently in Beta.

.. _pointcloud_segmentation:

Expand Down
3 changes: 3 additions & 0 deletions docs/source/reference/style_transfer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
:card_description: Learn about image style transfer with Flash and build an example which transfers style from The Starry Night to images from the COCO data set.
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/style_transfer.svg
:tags: Image,Style-Transfer
:beta:

.. beta:: Style transfer is currently in Beta.

.. _style_transfer:

Expand Down
2 changes: 2 additions & 0 deletions flash/core/utilities/flash_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
LightningCLI,
SaveConfigCallback,
)
from flash.core.utilities.stability import beta


class ModelExcludeSaveConfigCallback(SaveConfigCallback):
Expand Down Expand Up @@ -115,6 +116,7 @@ def get_overlapping_args(func_a, func_b) -> Set[str]:
return set(inspect.signature(func_a).parameters.keys() & inspect.signature(func_b).parameters.keys())


@beta("Flash Zero is currently in Beta.")
class FlashCLI(LightningCLI):

datamodule: DataModule
Expand Down
2 changes: 2 additions & 0 deletions flash/image/classification/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from flash.core.utilities.compatibility import accelerator_connector
from flash.core.utilities.imports import _LEARN2LEARN_AVAILABLE
from flash.core.utilities.providers import _LEARN2LEARN
from flash.core.utilities.stability import beta
from flash.core.utilities.url_error import catch_url_error
from flash.image.classification.integrations.learn2learn import TaskDataParallel, TaskDistributedDataParallel

Expand Down Expand Up @@ -72,6 +73,7 @@ def forward(self, x):
return self.head(x)


@beta("The Learn2Learn integration is currently in Beta.")
class Learn2LearnAdapter(Adapter):

required_extras: str = "image"
Expand Down
2 changes: 2 additions & 0 deletions flash/image/classification/integrations/baal/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import flash
from flash.core.data.utils import _STAGES_PREFIX
from flash.core.utilities.imports import _PL_GREATER_EQUAL_1_4_0, _PL_GREATER_EQUAL_1_5_0, requires
from flash.core.utilities.stability import beta
from flash.core.utilities.stages import RunningStage
from flash.image.classification.integrations.baal.data import ActiveLearningDataModule
from flash.image.classification.integrations.baal.dropout import InferenceMCDropoutTask
Expand All @@ -41,6 +42,7 @@
from pytorch_lightning.trainer.connectors.data_connector import _DataLoaderSource


@beta("The BaaL integration is currently in Beta.")
class ActiveLearningLoop(Loop):
max_epochs: int
inference_model: InferenceMCDropoutTask
Expand Down
2 changes: 2 additions & 0 deletions flash/image/embedding/vissl/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from flash.core.data.io.input import DataKeys
from flash.core.model import Task
from flash.core.utilities.imports import _VISSL_AVAILABLE
from flash.core.utilities.stability import beta
from flash.image.embedding.vissl.hooks import AdaptVISSLHooks

if _VISSL_AVAILABLE:
Expand Down Expand Up @@ -70,6 +71,7 @@ def __init__(self, vissl_adapter, vissl_loss, task_config, vissl_model) -> None:
self.last_batch = AttrDict({"sample": AttrDict({"input": None, "data_momentum": None})})


@beta("The VISSL integration is currently in Beta.")
class VISSLAdapter(Adapter, AdaptVISSLHooks):
"""The ``VISSLAdapter`` is an :class:`~flash.core.adapter.Adapter` for integrating with VISSL.
Expand Down
2 changes: 2 additions & 0 deletions flash/image/face_detection/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

from flash.core.data.data_module import DataModule
from flash.core.data.io.input import Input
from flash.core.utilities.stability import beta
from flash.core.utilities.stages import RunningStage
from flash.core.utilities.types import INPUT_TRANSFORM_TYPE
from flash.image.classification.data import ImageClassificationFilesInput, ImageClassificationFolderInput
from flash.image.face_detection.input import FaceDetectionInput
from flash.image.face_detection.input_transform import FaceDetectionInputTransform


@beta("Face detection is currently in Beta.")
class FaceDetectionData(DataModule):
input_transform_cls = FaceDetectionInputTransform

Expand Down
2 changes: 2 additions & 0 deletions flash/image/face_detection/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from flash.core.data.io.input import DataKeys
from flash.core.model import Task
from flash.core.utilities.imports import _FASTFACE_AVAILABLE
from flash.core.utilities.stability import beta
from flash.core.utilities.types import LOSS_FN_TYPE, LR_SCHEDULER_TYPE, METRICS_TYPE, OPTIMIZER_TYPE
from flash.image.face_detection.backbones import FACE_DETECTION_BACKBONES
from flash.image.face_detection.output_transform import FaceDetectionOutputTransform
Expand All @@ -27,6 +28,7 @@
import fastface as ff


@beta("Face detection is currently in Beta.")
class FaceDetector(Task):
"""The ``FaceDetector`` is a :class:`~flash.Task` for detecting faces in images.
Expand Down
2 changes: 2 additions & 0 deletions flash/image/style_transfer/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from flash.core.data.data_module import DataModule
from flash.core.data.io.input import Input
from flash.core.utilities.imports import _IMAGE_TESTING
from flash.core.utilities.stability import beta
from flash.core.utilities.stages import RunningStage
from flash.core.utilities.types import INPUT_TRANSFORM_TYPE
from flash.image.classification.input import ImageClassificationFilesInput, ImageClassificationFolderInput
Expand All @@ -30,6 +31,7 @@
__doctest_skip__ = ["StyleTransferData", "StyleTransferData.*"]


@beta("Style transfer is currently in Beta.")
class StyleTransferData(DataModule):
"""The ``StyleTransferData`` class is a :class:`~flash.core.data.data_module.DataModule` with a set of
classmethods for loading data for image style transfer."""
Expand Down
2 changes: 2 additions & 0 deletions flash/image/style_transfer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from flash.core.model import Task
from flash.core.registry import FlashRegistry
from flash.core.utilities.imports import _IMAGE_AVAILABLE
from flash.core.utilities.stability import beta
from flash.core.utilities.types import LR_SCHEDULER_TYPE, OPTIMIZER_TYPE
from flash.image.style_transfer import STYLE_TRANSFER_BACKBONES

Expand All @@ -46,6 +47,7 @@ class PerceptualLoss:
__all__ = ["StyleTransfer"]


@beta("Style transfer is currently in Beta.")
class StyleTransfer(Task):
"""``StyleTransfer`` is a :class:`~flash.Task` for transferring the style from one image onto another. For more
details, see :ref:`style_transfer`.
Expand Down
2 changes: 2 additions & 0 deletions flash/pointcloud/segmentation/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
from flash.core.data.data_module import DataModule
from flash.core.data.io.input import Input
from flash.core.data.io.input_transform import InputTransform
from flash.core.utilities.stability import beta
from flash.core.utilities.stages import RunningStage
from flash.core.utilities.types import INPUT_TRANSFORM_TYPE
from flash.pointcloud.segmentation.input import PointCloudSegmentationDatasetInput, PointCloudSegmentationFoldersInput


@beta("Point cloud segmentation is currently in Beta.")
class PointCloudSegmentationData(DataModule):

input_transform_cls = InputTransform
Expand Down
2 changes: 2 additions & 0 deletions flash/pointcloud/segmentation/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from flash.core.data.io.input_transform import InputTransform
from flash.core.registry import FlashRegistry
from flash.core.utilities.imports import _POINTCLOUD_AVAILABLE, _TM_GREATER_EQUAL_0_7_0
from flash.core.utilities.stability import beta
from flash.core.utilities.types import LOSS_FN_TYPE, LR_SCHEDULER_TYPE, METRICS_TYPE, OPTIMIZER_TYPE
from flash.pointcloud.segmentation.backbones import POINTCLOUD_SEGMENTATION_BACKBONES

Expand All @@ -36,6 +37,7 @@
from torchmetrics import IoU as JaccardIndex


@beta("Point cloud segmentation is currently in Beta.")
class PointCloudSegmentation(ClassificationTask):
"""The ``PointCloudClassifier`` is a :class:`~flash.core.classification.ClassificationTask` that classifies
pointcloud data.
Expand Down

0 comments on commit 1d926b5

Please sign in to comment.