-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[torchcodec] Add contributing guide (#66)
Summary: Pull Request resolved: #66 I copied the relevant sections from torchvision: https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md Reviewed By: NicolasHug Differential Revision: D59344144 fbshipit-source-id: ad0bf8dc8a496ad9b88f4fc57f050b00b53f31fe
- Loading branch information
1 parent
d69971b
commit 8d7c088
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Contributing to TorchCodec | ||
|
||
You can contribute to this project by writing code, fixing issues or simply by | ||
using the library and reporting your feedback. | ||
|
||
## Development installation | ||
|
||
### Dependencies | ||
|
||
Start by installing the **nightly** build of PyTorch following the | ||
[official instructions](https://pytorch.org/get-started/locally/). Note that the | ||
official instructions may ask you to install TorchCodec itself. If you are doing | ||
development on TorchCodec, you should not install prebuilt TorchCodec packages. | ||
|
||
To build, run and test locally you will need the following packages | ||
(dependencies): | ||
|
||
1. C++ compiler+linker (g++) and C++ runtime library (libstdc++). This is | ||
typically available on a baseline Linux installation already. | ||
1. python | ||
1. cmake | ||
1. pkg-config | ||
1. libtorch (this is part of Pytorch) | ||
1. ffmpeg | ||
1. pytest (for testing) | ||
|
||
You can install these using your favorite package manager. Example, for conda | ||
use: | ||
|
||
```bash | ||
# After installing the nightly pytorch version run this: | ||
conda install cmake pkg-config ffmpeg pytest -c conda-forge | ||
``` | ||
|
||
### Clone and build torchcodec | ||
|
||
```bash | ||
git clone https://github.com/pytorch-labs/torchcodec.git | ||
cd torchcodec | ||
|
||
pip install -e ".[dev]" --no-build-isolation -vv | ||
|
||
# This should decode the sample video and generate a png file that is a frame in the video. | ||
python test/decoders/manual_smoke_test.py | ||
``` | ||
|
||
### Running unit tests | ||
|
||
To run python tests run: | ||
|
||
```bash | ||
pytest test -vvv | ||
``` | ||
|
||
To run C++ tests run: | ||
|
||
```bash | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=1 -DCMAKE_PREFIX_PATH=$(python3 -c 'import torch;print(torch.utils.cmake_prefix_path)) .. | ||
cmake --build . -- VERBOSE=1 | ||
ctest --rerun-failed --output-on-failure | ||
``` | ||
## Development Process | ||
TBD | ||
### Code formatting and typing | ||
TBD | ||
## License | ||
By contributing to TorchCodec, you agree that your contributions will be | ||
licensed under the LICENSE file in the root directory of this source tree. | ||
Contributors are also required to | ||
[sign our Contributor License Agreement](https://code.facebook.com/cla). |