diff --git a/README.md b/README.md index ad95b3a8..f19db1a7 100644 --- a/README.md +++ b/README.md @@ -37,26 +37,32 @@ The library is Python-based and requires at least Python 3.6, as we use dataclas ## Authors -[**Joanna Bitton**](https://www.linkedin.com/in/joanna-bitton/) — Software Engineer at Facebook AI +[**Joanna Bitton**](https://www.linkedin.com/in/joanna-bitton/) — Software Engineer at Meta AI -[**Zoe Papakipos**](https://www.linkedin.com/in/zoe-papakipos-8637155b/) — Research Engineer at FAIR +[**Zoe Papakipos**](https://www.linkedin.com/in/zoe-papakipos-8637155b/) — Software Engineer at Meta AI ## Installation `AugLy` is a Python 3.6+ library. It can be installed with: ```bash -pip install augly +pip install augly[all] +``` + +If you want to only install the dependencies needed for one sub-library e.g. audio, you can install like so: + +```bash +pip install augly[audio] ``` Or clone AugLy if you want to be able to run our unit tests, contribute a pull request, etc: ```bash git clone git@github.com:facebookresearch/AugLy.git && cd AugLy [Optional, but recommended] conda create -n augly && conda activate augly && conda install pip -pip install -e . +pip install -e .[all] ``` -**Note**: If you want to use the audio or video modalities in AugLy, you can install the extra dependencies required with `pip install augly[av]`. Otherwise, installing with `pip install augly` will only install the base requirements and is sufficient to use the image & text modalities, since the audio & video dependencies are unnecessarily heavy if you won't be using them. +**Backwards compatibility note**: In versions `augly<=0.2.1` we did not separate the dependencies by modality. For those versions to install most dependencies you could use `pip install augly`, and if you want to use the audio or video modalities you would install with `pip install augly[av]`. In some environments, `pip` doesn't install `python-magic` as expected. In that case, you will need to additionally run: ```bash diff --git a/augly/audio/README.md b/augly/audio/README.md index 502cd9b9..a78fc5dc 100644 --- a/augly/audio/README.md +++ b/augly/audio/README.md @@ -4,7 +4,7 @@ If you would like to use the audio augmentations, please install AugLy using the following command: ```bash -pip install augly[av] +pip install augly[audio] ``` This ensures that not only the base dependencies, but also the heavier dependencies required for audio & video processing, are installed. diff --git a/augly/image/README.md b/augly/image/README.md index 7b6b41c4..c7e4e540 100644 --- a/augly/image/README.md +++ b/augly/image/README.md @@ -3,7 +3,7 @@ ## Installation If you would like to use the image augmentations, please install AugLy using the following command: ```bash -pip install augly +pip install augly[image] ``` ## Augmentations diff --git a/augly/text/README.md b/augly/text/README.md index b10024e8..9bbc3c0b 100644 --- a/augly/text/README.md +++ b/augly/text/README.md @@ -3,7 +3,7 @@ ## Installation If you would like to use the text augmentations, please install AugLy using the following command: ```bash -pip install augly +pip install augly[text] ``` ## Augmentations diff --git a/augly/video/README.md b/augly/video/README.md index 7ad41b4b..3d704145 100644 --- a/augly/video/README.md +++ b/augly/video/README.md @@ -3,7 +3,7 @@ ## Installation If you would like to use the video augmentations, please install AugLy using the following command: ```bash -pip install augly[av] +pip install augly[video] ``` This ensures that not only the base dependencies, but also the heavier dependencies required for audio & video processing, are installed. diff --git a/examples/AugLy_audio.ipynb b/examples/AugLy_audio.ipynb index caf918af..039b4243 100644 --- a/examples/AugLy_audio.ipynb +++ b/examples/AugLy_audio.ipynb @@ -9,10 +9,12 @@ }, "kernelspec": { "name": "python3", - "display_name": "Python 3" + "display_name": "Python 3", + "language": "python" }, "language_info": { - "name": "python" + "name": "python", + "version": "3.8.5-final" } }, "cells": [ @@ -23,12 +25,8 @@ }, "source": [ "# Note: restart runtime after this import before running the augmentations\n", - "!pip install -U augly[av]\n", - "!sudo apt-get install python3-magic\n", - "\n", - "# Manually install version of torchaudio compatible with colab\n", - "!pip uninstall -y torchaudio\n", - "!pip install torchaudio==0.10.0 -f https://download.pytorch.org/whl/cu111/torch_stable.html" + "!pip install -U augly[audio]\n", + "!sudo apt-get install python3-magic" ], "execution_count": null, "outputs": [] diff --git a/examples/AugLy_image.ipynb b/examples/AugLy_image.ipynb index d0144cae..117190d0 100644 --- a/examples/AugLy_image.ipynb +++ b/examples/AugLy_image.ipynb @@ -23,7 +23,7 @@ }, "source": [ "# Note: restart runtime after this import before running the augmentations\n", - "!pip install -U augly\n", + "!pip install -U augly[image]\n", "!sudo apt-get install python3-magic" ], "execution_count": null, @@ -218,5 +218,4 @@ "outputs": [] } ] -} - +} \ No newline at end of file diff --git a/examples/AugLy_text.ipynb b/examples/AugLy_text.ipynb index ce4a054a..c56610c1 100644 --- a/examples/AugLy_text.ipynb +++ b/examples/AugLy_text.ipynb @@ -23,7 +23,7 @@ }, "source": [ "# Note: restart runtime after this import before running the augmentations\n", - "!pip install -U augly\n", + "!pip install -U augly[text]\n", "!sudo apt-get install python3-magic" ], "execution_count": null, @@ -126,4 +126,4 @@ "outputs": [] } ] -} +} \ No newline at end of file diff --git a/examples/AugLy_video.ipynb b/examples/AugLy_video.ipynb index 65836954..bae3f92a 100644 --- a/examples/AugLy_video.ipynb +++ b/examples/AugLy_video.ipynb @@ -23,12 +23,8 @@ }, "source": [ "# Note: restart runtime after this import before running the augmentations\n", - "!pip install -U augly[av]\n", - "!sudo apt-get install python3-magic\n", - "\n", - "# Manually install version of torchaudio compatible with colab\n", - "!pip uninstall -y torchaudio\n", - "!pip install torchaudio==0.10.0 -f https://download.pytorch.org/whl/cu111/torch_stable.html" + "!pip install -U augly[video]\n", + "!sudo apt-get install python3-magic" ], "execution_count": null, "outputs": [] @@ -56,7 +52,7 @@ "from base64 import b64encode\n", "\n", "def display_video(path):\n", - " mp4 = open(path,'rb').read()\n", + " mp4 = open(path, \"rb\").read()\n", " data_url = \"data:video/mp4;base64,\" + b64encode(mp4).decode()\n", " display(\n", " HTML(\n", @@ -192,4 +188,4 @@ "outputs": [] } ] -} +} \ No newline at end of file diff --git a/setup.py b/setup.py index 87476aa4..37ebd8ce 100644 --- a/setup.py +++ b/setup.py @@ -26,8 +26,12 @@ for module in ["audio", "image", "text", "video"] } -extra_requirements["video"].extend(extra_requirements["audio"]) -extra_requirements["all"] = [r for reqs in extra_requirements.values() for r in reqs] +extra_requirements["video"].extend( + extra_requirements["audio"] + extra_requirements["image"] +) +extra_requirements["all"] = list( + {r for reqs in extra_requirements.values() for r in reqs} +) with open("README.md", encoding="utf8") as f: readme = f.read() diff --git a/version.txt b/version.txt index 0c62199f..3eefcb9d 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.2.1 +1.0.0