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

Commit

Permalink
Update docstring empty output
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris committed Jan 25, 2022
1 parent a21e29c commit be7214f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
6 changes: 4 additions & 2 deletions flash/image/classification/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,8 @@ def from_fiftyone(
>>> train_dataset = fo.Dataset.from_images(
... ["image_1.png", "image_2.png", "image_3.png"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> samples = [train_dataset[filepath] for filepath in train_dataset.values("filepath")]
>>> for sample, label in zip(samples, ["cat", "dog", "cat"]):
... sample["ground_truth"] = fo.Classification(label=label)
Expand All @@ -858,7 +859,8 @@ def from_fiftyone(
>>> predict_dataset = fo.Dataset.from_images(
... ["predict_image_1.png", "predict_image_2.png", "predict_image_3.png"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> datamodule = ImageClassificationData.from_fiftyone(
... train_dataset=train_dataset,
... predict_dataset=predict_dataset,
Expand Down
9 changes: 6 additions & 3 deletions flash/image/detection/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ def from_fiftyone(
>>> train_dataset = fo.Dataset.from_images(
... ["image_1.png", "image_2.png", "image_3.png"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> samples = [train_dataset[filepath] for filepath in train_dataset.values("filepath")]
>>> for sample, label, bounding_box in zip(
... samples,
Expand All @@ -670,14 +671,16 @@ def from_fiftyone(
>>> predict_dataset = fo.Dataset.from_images(
... ["predict_image_1.png", "predict_image_2.png", "predict_image_3.png"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> datamodule = ObjectDetectionData.from_fiftyone(
... train_dataset=train_dataset,
... predict_dataset=predict_dataset,
... transform_kwargs=dict(image_size=(128, 128)),
... batch_size=2,
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
Computing...
<BLANKLINE>
...
>>> datamodule.num_classes
3
>>> datamodule.labels
Expand Down
6 changes: 4 additions & 2 deletions flash/image/segmentation/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ def from_fiftyone(
>>> train_dataset = fo.Dataset.from_images(
... ["image_1.png", "image_2.png", "image_3.png"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> samples = [train_dataset[filepath] for filepath in train_dataset.values("filepath")]
>>> for sample in samples:
... sample["ground_truth"] = fo.Segmentation(mask=np.random.randint(0, 10, (64, 64), dtype="uint8"))
Expand All @@ -593,7 +594,8 @@ def from_fiftyone(
>>> predict_dataset = fo.Dataset.from_images(
... ["predict_image_1.png", "predict_image_2.png", "predict_image_3.png"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> datamodule = SemanticSegmentationData.from_fiftyone(
... train_dataset=train_dataset,
... predict_dataset=predict_dataset,
Expand Down
6 changes: 4 additions & 2 deletions flash/video/classification/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,8 @@ def from_fiftyone(
>>> train_dataset = fo.Dataset.from_videos(
... ["video_1.mp4", "video_2.mp4", "video_3.mp4"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> samples = [train_dataset[filepath] for filepath in train_dataset.values("filepath")]
>>> for sample, label in zip(samples, ["cat", "dog", "cat"]):
... sample["ground_truth"] = fo.Classification(label=label)
Expand All @@ -827,7 +828,8 @@ def from_fiftyone(
>>> predict_dataset = fo.Dataset.from_images(
... ["predict_video_1.mp4", "predict_video_2.mp4", "predict_video_3.mp4"]
... ) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
33%...
<BLANKLINE>
...
>>> datamodule = VideoClassificationData.from_fiftyone(
... train_dataset=train_dataset,
... predict_dataset=predict_dataset,
Expand Down

0 comments on commit be7214f

Please sign in to comment.