From dca2632a4801add0e5a87f8f44d2559bd430e611 Mon Sep 17 00:00:00 2001 From: zhiqiang Date: Sun, 3 Oct 2021 17:51:14 +0800 Subject: [PATCH 1/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 125 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 112 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f57bb357..6bb93d6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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/ -vvv -k +# 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 file in the root directory of this source tree. From d8ce576542623752700558a8f2aa7e04c6fab492 Mon Sep 17 00:00:00 2001 From: zhiqiang Date: Sun, 3 Oct 2021 17:51:34 +0800 Subject: [PATCH 2/3] Update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a4a7cb84..39073eaf 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -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 :) From 4dbd8443fdf5fd1344536c6b5e3ddde73847b950 Mon Sep 17 00:00:00 2001 From: zhiqiang Date: Sun, 3 Oct 2021 17:55:41 +0800 Subject: [PATCH 3/3] Update links --- CONTRIBUTING.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6bb93d6d..800a332b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -113,4 +113,4 @@ If all previous checks (flake8, mypy, unit tests) are passing, please send a PR. ## License -By contributing to `yolort`, you agree that your contributions will be licensed under the LICENSE file in the root directory of this source tree. +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. diff --git a/README.md b/README.md index 39073eaf..9bc2c67d 100644 --- a/README.md +++ b/README.md @@ -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) ______________________________________________________________________