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

Flash CLI and Flash Zero #611

Merged
merged 50 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
57272e9
Use the LightningCLI in the image classification example
carmocca May 10, 2021
216397e
FlashCLI
carmocca May 12, 2021
cf94e2a
Merge branch 'master' into feature/cli-examples
carmocca May 12, 2021
b18a8b9
Merge branch 'master' into feature/cli-examples
carmocca May 12, 2021
1b6de76
Finetune support
carmocca May 12, 2021
d8c28ec
Merge branch 'master' into feature/cli-examples
ethanwharris Jul 21, 2021
4b3786e
Port LightningCLI
ethanwharris Jul 21, 2021
4c7b54f
Update requirements
ethanwharris Jul 21, 2021
68a93d4
Initial commit
ethanwharris Jul 22, 2021
f1134c1
Updates
ethanwharris Jul 22, 2021
23f7bd8
Merge branch 'master' into feature/flash_cli_ethan
ethanwharris Jul 23, 2021
882764a
Updates
ethanwharris Jul 23, 2021
70ccdbf
Updates
ethanwharris Jul 23, 2021
ee18906
Temp fill reqs
ethanwharris Jul 23, 2021
26283e9
Bump PL req
ethanwharris Jul 23, 2021
dcf5183
Test
ethanwharris Jul 23, 2021
2604f34
Update
ethanwharris Jul 23, 2021
f59a3bc
Update
ethanwharris Jul 23, 2021
ef822a5
Remove debug code
ethanwharris Jul 23, 2021
6795abd
Merge branch 'master' into feature/flash_cli_ethan
ethanwharris Jul 30, 2021
079618b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2021
dcaadc8
Updates
ethanwharris Jul 30, 2021
51d7adc
Add speech recognition
ethanwharris Jul 30, 2021
5b7cee4
Merge branch 'master' into feature/flash_cli_ethan
ethanwharris Jul 30, 2021
a0e192e
Add text classification
ethanwharris Aug 2, 2021
32a0347
Add tabular and seq2seq
ethanwharris Aug 2, 2021
1a20743
Remove extra reqs
ethanwharris Aug 2, 2021
f2add64
Fix test
ethanwharris Aug 2, 2021
5c51c27
Merge branch 'master' into feature/flash_cli_ethan
ethanwharris Aug 2, 2021
433abb1
Add pointcloud
ethanwharris Aug 2, 2021
a5eabc9
Merge branch 'feature/flash_cli_ethan' of https://github.com/PyTorchL…
ethanwharris Aug 2, 2021
d9640ac
Add graph
ethanwharris Aug 2, 2021
2ee48aa
Fix test
ethanwharris Aug 2, 2021
b2c6ede
A fix
ethanwharris Aug 2, 2021
5fe8cb4
Try fix
ethanwharris Aug 2, 2021
787fb58
Try fix
ethanwharris Aug 2, 2021
8fa1b33
Try fix
ethanwharris Aug 2, 2021
2b64560
Add tests
ethanwharris Aug 2, 2021
55c2982
Add click CLI
ethanwharris Aug 2, 2021
1c890ae
Add click CLI
ethanwharris Aug 3, 2021
274ca54
Add some docs
ethanwharris Aug 3, 2021
7484c55
Update docs
ethanwharris Aug 3, 2021
570cd27
Punctuation
ethanwharris Aug 3, 2021
8cbce0f
Add some tests
ethanwharris Aug 3, 2021
19a1262
Update CHANGELOG.md
ethanwharris Aug 3, 2021
184ba1f
Fix test
ethanwharris Aug 3, 2021
ebd14d3
Add some tests
ethanwharris Aug 3, 2021
16e6101
Test
ethanwharris Aug 4, 2021
fbad52e
Updates
ethanwharris Aug 4, 2021
543912c
Try fix
ethanwharris Aug 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,5 @@ jigsaw_toxic_comments
flash_examples/serve/tabular_classification/data
logs/cache/*
flash_examples/data
flash_examples/cli/*/data
timit/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Added a `SpeechRecognition` task for speech to text using Wav2Vec ([#586](https://github.com/PyTorchLightning/lightning-flash/pull/586))

- Added Flash Zero, a zero code command line ML platform built with flash ([#611](https://github.com/PyTorchLightning/lightning-flash/pull/611))

### Changed

- Changed how pretrained flag works for loading weights for ImageClassifier task ([#560](https://github.com/PyTorchLightning/lightning-flash/pull/560))
Expand All @@ -46,6 +48,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Fixed a bug where an uncaught ValueError could be raised when checking if a module is available ([#615](https://github.com/PyTorchLightning/lightning-flash/pull/615))

- Fixed a bug where some tasks were not compatible with PyTorch 1.7 due to use of `torch.jit.isinstance` ([#611](https://github.com/PyTorchLightning/lightning-flash/pull/611))

## [0.4.0] - 2021-06-22

### Added
Expand Down
56 changes: 56 additions & 0 deletions docs/source/general/flash_zero.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. _flash_zero:

**********
Flash Zero
**********

Flash Zero is a zero-code machine learning platform built directly into lightning-flash.
To get started and view the available tasks, run:

.. code-block:: bash

flash --help

Customize Trainer and Model arguments
_____________________________________

Flash Zero is built on top of the
`lightning CLI <https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_cli.html>`_, so the trainer and
model arguments can be configured either from the command line or from a config file.
For example, to run the image classifier for 10 epochs with a `resnet50` backbone you can use:

.. code-block:: bash

flash image-classification --trainer.max_epochs 10 --model.backbone resnet50

To view all of the available options for a task, run:

.. code-block:: bash

flash image-classification --help

Using Custom Data
_________________

Flash Zero works with your own data through subcommands. The available subcommands for each task are given at the bottom
of their help pages (e.g. when running :code:`flash image-classification --help`). You can then use the required
subcommand to train on your own data. Let's look at an example using the Hymenoptera data from the
:ref:`image_classification` guide. First, download and unzip your data:

.. code-block:: bash

curl https://pl-flash-data.s3.amazonaws.com/hymenoptera_data.zip -o hymenoptera_data
unzip hymenoptera_data.zip

Now train with Flash Zero:

.. code-block:: bash

flash image-classification from_folders --train_folder ./hymenoptera_data/train

You can view the help page for each subcommand. For example, to view the options for training an image classifier from
folders, you can run:

.. code-block:: bash

flash image-classification from_folders --help
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Lightning Flash
general/jit
general/data
general/registry
general/flash_zero
general/serve

.. toctree::
Expand Down
19 changes: 19 additions & 0 deletions docs/source/reference/audio_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,22 @@ Here's the full example:
.. literalinclude:: ../../../flash_examples/audio_classification.py
:language: python
:lines: 14-

------

**********
Flash Zero
**********

The audio classifier can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash audio-classification

To view configuration options and options for running the audio classifier with your own data, use:

.. code-block:: bash

flash audio-classification --help
19 changes: 19 additions & 0 deletions docs/source/reference/graph_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,22 @@ Here's the full example:
.. literalinclude:: ../../../flash_examples/graph_classification.py
:language: python
:lines: 14-

------

**********
Flash Zero
**********

The graph classifier can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash graph-classifier

To view configuration options and options for running the graph classifier with your own data, use:

.. code-block:: bash

flash graph-classifier --help
19 changes: 19 additions & 0 deletions docs/source/reference/image_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ Here's the full example:

------

**********
Flash Zero
**********

The image classifier can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the hymenoptera example with:

.. code-block:: bash

flash image-classification

To view configuration options and options for running the image classifier with your own data, use:

.. code-block:: bash

flash image-classification --help

------

*******
Serving
*******
Expand Down
21 changes: 21 additions & 0 deletions docs/source/reference/image_classification_multi_label.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ Here's the full example:
:language: python
:lines: 14-


------

**********
Flash Zero
**********

The multi-label image classifier can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the movie posters example with:

.. code-block:: bash

flash image-classification from_movie_posters

To view configuration options and options for running the image classifier with your own data, use:

.. code-block:: bash

flash image-classification --help


------

*******
Expand Down
19 changes: 19 additions & 0 deletions docs/source/reference/object_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,22 @@ Here's the full example:
.. literalinclude:: ../../../flash_examples/object_detection.py
:language: python
:lines: 14-

------

**********
Flash Zero
**********

The object detector can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash object-detection

To view configuration options and options for running the object detector with your own data, use:

.. code-block:: bash

flash object-detection --help
21 changes: 19 additions & 2 deletions docs/source/reference/pointcloud_object_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,24 @@ Here's the full example:
:language: python
:lines: 14-



.. image:: https://raw.githubusercontent.com/intel-isl/Open3D-ML/master/docs/images/visualizer_BoundingBoxes.png
:width: 100%

------

**********
Flash Zero
**********

The point cloud object detector can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash pointcloud-detection

To view configuration options and options for running the point cloud object detector with your own data, use:

.. code-block:: bash

flash pointcloud-detection --help
21 changes: 19 additions & 2 deletions docs/source/reference/pointcloud_segmentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,24 @@ Here's the full example:
:language: python
:lines: 14-



.. image:: https://raw.githubusercontent.com/intel-isl/Open3D-ML/master/docs/images/getting_started_ml_visualizer.gif
:width: 100%

------

**********
Flash Zero
**********

The point cloud segmentation task can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash pointcloud-segmentation

To view configuration options and options for running the point cloud segmentation task with your own data, use:

.. code-block:: bash

flash pointcloud-segmentation --help
21 changes: 21 additions & 0 deletions docs/source/reference/semantic_segmentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@ Here's the full example:
:language: python
:lines: 14-


------

**********
Flash Zero
**********

The semantic segmentation task can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash semantic-segmentation

To view configuration options and options for running the semantic segmentation task with your own data, use:

.. code-block:: bash

flash semantic-segmentation --help


------

*******
Expand Down
19 changes: 19 additions & 0 deletions docs/source/reference/speech_recognition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ Here's the full example:

------

**********
Flash Zero
**********

The speech recognition task can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash speech-recognition

To view configuration options and options for running the speech recognition task with your own data, use:

.. code-block:: bash

flash speech-recognition --help

------

*******
Serving
*******
Expand Down
19 changes: 19 additions & 0 deletions docs/source/reference/style_transfer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,22 @@ Here's the full example:
.. literalinclude:: ../../../flash_examples/style_transfer.py
:language: python
:lines: 14-

------

**********
Flash Zero
**********

The style transfer task can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash style-transfer

To view configuration options and options for running the style transfer task with your own data, use:

.. code-block:: bash

flash style-transfer --help
19 changes: 19 additions & 0 deletions docs/source/reference/summarization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ Here's the full example:

------

**********
Flash Zero
**********

The summarization task can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash summarization

To view configuration options and options for running the summarization task with your own data, use:

.. code-block:: bash

flash summarization --help

------

*******
Serving
*******
Expand Down
19 changes: 19 additions & 0 deletions docs/source/reference/tabular_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ Here's the full example:

------

**********
Flash Zero
**********

The tabular classifier can be used directly from the command line with zero code using :ref:`flash_zero`.
You can run the above example with:

.. code-block:: bash

flash tabular-classifier

To view configuration options and options for running the tabular classifier with your own data, use:

.. code-block:: bash

flash tabular-classifier --help

------

*******
Serving
*******
Expand Down
Loading