Skip to content

Commit

Permalink
Update pypi to augly==1.0.0 (#206)
Browse files Browse the repository at this point in the history
Summary:
## Related Issue
N/A

- [x] I have read CONTRIBUTING.md to understand how to contribute to this repository :)

Updating the pypi package with recent changes, including the way the dependencies are split.

Pull Request resolved: #206

Reviewed By: jbitton

Differential Revision: D35008009

Pulled By: zpapakipos

fbshipit-source-id: 40fc950be36495837bc53c6bd6d6ff4ec4073bd2
  • Loading branch information
zpapakipos authored and facebook-github-bot committed Mar 29, 2022
1 parent bc7c105 commit dfd8223
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 33 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion augly/audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion augly/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion augly/text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion augly/video/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 6 additions & 8 deletions examples/AugLy_audio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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": []
Expand Down
5 changes: 2 additions & 3 deletions examples/AugLy_image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -218,5 +218,4 @@
"outputs": []
}
]
}

}
4 changes: 2 additions & 2 deletions examples/AugLy_text.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -126,4 +126,4 @@
"outputs": []
}
]
}
}
12 changes: 4 additions & 8 deletions examples/AugLy_video.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -192,4 +188,4 @@
"outputs": []
}
]
}
}
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
1.0.0

0 comments on commit dfd8223

Please sign in to comment.