Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CONTRIBUTING.md #185

Merged
merged 3 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
125 changes: 112 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,116 @@
# Contributing
# Contributing to yolort

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.
We want to make contributing to this project as easy and transparent as possible.

Please note we have a code of conduct, please follow it in all your interactions with the project.
## TL;DR

## Pull Request Process
We appreciate all contributions. If you are interested in contributing to `yolort`, there are many ways to help out. Your contributions may fall into the following categories:

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
1. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
1. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is \<[SemVer](http://semver.org/)>.
1. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you
- It helps the project if you could

- Report issues you're facing
- Give a :+1: on issues that others reported and that are relevant to you

- Answering queries on the issue tracker, investigating bugs are very valuable contributions to the project.

- You would like to improve the documentation. This is no less important than improving the library itself! If you find a typo in the documentation, do not hesitate to submit a GitHub pull request.

- If you would like to fix a bug

- please pick one from the [list of open issues labelled as "help wanted"](https://github.com/zhiqwang/yolov5-rt-stack/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
- comment on the issue that you want to work on this issue
- send a PR with your fix, see below.

- If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.

## Issues

We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue.

## Development installation

### Install PyTorch and TorchVision

```bash
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
# or with pip (see https://pytorch.org/get-started/locally/)
# pip install numpy
# pip install torch torchvision
```

### Install yolort

```bash
git clone https://github.com/zhiqwang/yolov5-rt-stack.git
cd yolov5-rt-stack
pip install -e .
```

## Development Process

If you plan to modify the code or documentation, please follow the steps below:

1. Fork the repository and create your branch from `master`.
1. If you have modified the code (new feature or bug-fix), please add unit tests.
1. If you have changed APIs, update the documentation. Make sure the documentation builds.
1. Ensure the test suite passes.
1. Make sure your code passes the formatting checks (see below).

Verify your PR is **up-to-date with origin/master**. If your PR is behind origin/master an automatic [GitHub actions](.github/workflows/rebase.yml) rebase may be attempted by including the `/rebase` command in a comment body, or by running the following code, replacing 'feature' with the name of your local branch:

```bash
git remote add upstream https://github.com/zhiqwang/yolov5-rt-stack.git
git fetch upstream
git checkout -b feature # <----- replace 'feature' with local branch name
git rebase upstream/master
git push -u origin -f
```

For more details about pull requests workflow, please read [GitHub's guides](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).

### Code formatting

Contributions should be compatible with Python 3.X versions and be compliant with PEP8. We have already installed the [pre-commit service](https://github.com/apps/pre-commit-ci) to auto fix the pull requests. If you want to check the codebase locally, please either run

```bash
pre-commit run --all-files
```

or run

```bash
pre-commit install
```

once to perform these checks automatically before every `git commit`. If `pre-commit` is not available you can install it with

```bash
pip install pre-commit
```

### Unit tests

If you have modified the code by adding a new feature or a bug-fix, please add unit tests for that. To run a specific test:

```bash
pytest test/<test-module.py> -vvv -k <test_myfunc>
# e.g. pytest test/test_models.py -vvv -k test_load_from_yolov5
```

If you would like to run all tests:

```bash
pytest test -vvv
```

### Documentation

TBD

### Pull Request

If all previous checks (flake8, mypy, unit tests) are passing, please send a PR. Submitted PR will pass other tests on different operation systems, python versions and hardwares.

## License

By contributing to `yolort`, you agree that your contributions will be licensed under the [LICENSE](LICENSE) file in the root directory of this source tree.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ______________________________________________________________________
[Documentation](#hammer_and_wrench-usage) •
[Installation Instructions](#installation-and-inference-examples) •
[Deployment](#rocket-deployment) •
[Contributing](#thinking-contributing) •
[Contributing](CONTRIBUTING.md) •
[Reporting Issues](https://github.com/zhiqwang/yolov5-rt-stack/issues/new?assignees=&labels=&template=bug-report.yml)

______________________________________________________________________
Expand Down Expand Up @@ -124,11 +124,11 @@ predictions = model.predict(img_path)

## :rocket: Deployment

### Inference on `LibTorch` backend
### Inference on LibTorch backend

We provide a [notebook](notebooks/inference-pytorch-export-libtorch.ipynb) to demonstrate how the model is transformed into `torchscript`. And we provide an [C++ example](deployment/libtorch) of how to infer with the transformed `torchscript` model. For details see the [GitHub Actions](.github/workflows/ci_test.yml).

### Inference on `ONNXRuntime` backend
### Inference on ONNXRuntime backend

On the `ONNXRuntime` front you can use the [C++ example](deployment/onnxruntime), and we also provide a tutorial [export-onnx-inference-onnxruntime](notebooks/export-onnx-inference-onnxruntime.ipynb) for using the `ONNXRuntime`.

Expand All @@ -145,4 +145,4 @@ Now, `yolort` can draw the model graph directly, checkout our [model-graph-visua

## :thinking: Contributing

We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us. *BTW, leave a 🌟 if you liked it, and this is the easiest way to support us* :)
See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out. BTW, leave a :star2: if you liked it, and this is the easiest way to support us :)