|
1 |
| -# How to contribute to Computer Vision Annotation Tool (CVAT) |
| 1 | +# Contributing to this project |
2 | 2 |
|
3 |
| -When contributing to this repository, please first discuss the change you wish to make via issue, |
4 |
| -email, or any other method with the owners of this repository before making a change. |
| 3 | +Please take a moment to review this document in order to make the contribution |
| 4 | +process easy and effective for everyone involved. |
| 5 | + |
| 6 | +Following these guidelines helps to communicate that you respect the time of |
| 7 | +the developers managing and developing this open source project. In return, |
| 8 | +they should reciprocate that respect in addressing your issue or assessing |
| 9 | +patches and features. |
| 10 | + |
| 11 | +## Development environment |
| 12 | + |
| 13 | +Next steps should work on clear Ubuntu 18.04. |
| 14 | + |
| 15 | +- Install necessary dependencies: |
| 16 | + |
| 17 | +```sh |
| 18 | +$ sudo apt-get install -y curl redis-server python3-dev python3-pip python3-venv libldap2-dev libsasl2-dev |
| 19 | +``` |
| 20 | + |
| 21 | +- Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux#_debian-and-ubuntu-based-distributions) for development |
| 22 | + |
| 23 | +- Install CVAT on your local host: |
| 24 | + |
| 25 | +```sh |
| 26 | +$ git clone https://github.com/opencv/cvat |
| 27 | +$ cd cvat && mkdir logs keys |
| 28 | +$ python3 -m venv .env |
| 29 | +$ . .env/bin/activate |
| 30 | +$ pip install -U pip wheel |
| 31 | +$ pip install -r cvat/requirements/development.txt |
| 32 | +$ python manage.py migrate |
| 33 | +$ python manage.py collectstatic |
| 34 | +``` |
| 35 | + |
| 36 | +- Create a super user for CVAT: |
| 37 | + |
| 38 | +```sh |
| 39 | +$ python manage.py createsuperuser |
| 40 | +Username (leave blank to use 'django'): *** |
| 41 | +Email address: *** |
| 42 | +Password: *** |
| 43 | +Password (again): *** |
| 44 | +``` |
| 45 | + |
| 46 | +- Run Visual Studio Code from the virtual environment |
| 47 | + |
| 48 | +``` |
| 49 | +$ code . |
| 50 | +``` |
| 51 | + |
| 52 | +- Inside Visual Studio Code install [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) and [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) extensions |
| 53 | + |
| 54 | +- Reload Visual Studio Code |
| 55 | + |
| 56 | +- Select `CVAT Debugging` configuration and start debugging (F5) |
| 57 | + |
| 58 | +You have done! Now it is possible to insert breakpoints and debug server and client of the tool. |
| 59 | + |
| 60 | +## Branching model |
| 61 | + |
| 62 | +The project uses [a successful Git branching model](https://nvie.com/posts/a-successful-git-branching-model). |
| 63 | +Thus it has a couple of branches. Some of them are described below: |
| 64 | + |
| 65 | +- `origin/master` to be the main branch where the source code of |
| 66 | +HEAD always reflects a production-ready state. |
| 67 | +- `origin/develop` to be the main branch where the source code of |
| 68 | +HEAD always reflects a state with the latest delivered development |
| 69 | +changes for the next release. Some would call this the “integration branch”. |
| 70 | + |
| 71 | +## Using the issue tracker |
| 72 | + |
| 73 | +The issue tracker is the preferred channel for [bug reports](#bugs), |
| 74 | +[features requests](#features) and [submitting pull |
| 75 | +requests](#pull-requests), but please respect the following restrictions: |
| 76 | + |
| 77 | +* Please **do not** use the issue tracker for personal support requests (use |
| 78 | + [Stack Overflow](http://stackoverflow.com)). |
| 79 | + |
| 80 | +* Please **do not** derail or troll issues. Keep the discussion on topic and |
| 81 | + respect the opinions of others. |
| 82 | + |
| 83 | + <a name="bugs"></a> |
| 84 | +## Bug reports |
| 85 | + |
| 86 | +A bug is a _demonstrable problem_ that is caused by the code in the repository. |
| 87 | +Good bug reports are extremely helpful - thank you! |
| 88 | + |
| 89 | +Guidelines for bug reports: |
| 90 | + |
| 91 | +1. **Use the GitHub issue search** — check if the issue has already been |
| 92 | + reported. |
| 93 | + |
| 94 | +2. **Check if the issue has been fixed** — try to reproduce it using the |
| 95 | + latest `develop` branch in the repository. |
| 96 | + |
| 97 | +3. **Isolate the problem** — ideally create a reduced test case. |
| 98 | + |
| 99 | +A good bug report shouldn't leave others needing to chase you up for more |
| 100 | +information. Please try to be as detailed as possible in your report. What is |
| 101 | +your environment? What steps will reproduce the issue? What browser(s) and OS |
| 102 | +experience the problem? What would you expect to be the outcome? All these |
| 103 | +details will help people to fix any potential bugs. |
| 104 | + |
| 105 | +Example: |
| 106 | + |
| 107 | +> Short and descriptive example bug report title |
| 108 | +> |
| 109 | +> A summary of the issue and the browser/OS environment in which it occurs. If |
| 110 | +> suitable, include the steps required to reproduce the bug. |
| 111 | +> |
| 112 | +> 1. This is the first step |
| 113 | +> 2. This is the second step |
| 114 | +> 3. Further steps, etc. |
| 115 | +> |
| 116 | +> |
| 117 | +> Any other information you want to share that is relevant to the issue being |
| 118 | +> reported. This might include the lines of code that you have identified as |
| 119 | +> causing the bug, and potential solutions (and your opinions on their |
| 120 | +> merits). |
| 121 | +
|
| 122 | +<a name="features"></a> |
| 123 | +## Feature requests |
| 124 | + |
| 125 | +Feature requests are welcome. But take a moment to find out whether your idea |
| 126 | +fits with the scope and aims of the project. It's up to *you* to make a strong |
| 127 | +case to convince the project's developers of the merits of this feature. Please |
| 128 | +provide as much detail and context as possible. |
| 129 | + |
| 130 | +<a name="pull-requests"></a> |
| 131 | +## Pull requests |
| 132 | + |
| 133 | +Good pull requests - patches, improvements, new features - are a fantastic |
| 134 | +help. They should remain focused in scope and avoid containing unrelated |
| 135 | +commits. |
| 136 | + |
| 137 | +**Please ask first** before embarking on any significant pull request (e.g. |
| 138 | +implementing features, refactoring code, porting to a different language), |
| 139 | +otherwise you risk spending a lot of time working on something that the |
| 140 | +project's developers might not want to merge into the project. |
| 141 | + |
| 142 | +Please adhere to the coding conventions used throughout a project (indentation, |
| 143 | +accurate comments, etc.) and any other requirements (such as test coverage). |
| 144 | + |
| 145 | +Follow this process if you'd like your work considered for inclusion in the |
| 146 | +project: |
| 147 | + |
| 148 | +1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, |
| 149 | + and configure the remotes: |
| 150 | + |
| 151 | + ```bash |
| 152 | + # Clone your fork of the repo into the current directory |
| 153 | + git clone https://github.com/<your-username>/<repo-name> |
| 154 | + # Navigate to the newly cloned directory |
| 155 | + cd <repo-name> |
| 156 | + # Assign the original repo to a remote called "upstream" |
| 157 | + git remote add upstream https://github.com/<upstream-owner>/<repo-name> |
| 158 | + ``` |
| 159 | + |
| 160 | +2. If you cloned a while ago, get the latest changes from upstream: |
| 161 | + |
| 162 | + ```bash |
| 163 | + git checkout <dev-branch> |
| 164 | + git pull upstream <dev-branch> |
| 165 | + ``` |
| 166 | + |
| 167 | +3. Create a new topic branch (off the main project development branch) to |
| 168 | + contain your feature, change, or fix: |
| 169 | + |
| 170 | + ```bash |
| 171 | + git checkout -b <topic-branch-name> |
| 172 | + ``` |
| 173 | + |
| 174 | +4. Commit your changes in logical chunks. Please adhere to these [git commit |
| 175 | + message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) |
| 176 | + or your code is unlikely be merged into the main project. Use Git's |
| 177 | + [interactive rebase](https://help.github.com/articles/interactive-rebase) |
| 178 | + feature to tidy up your commits before making them public. |
| 179 | + |
| 180 | +5. Locally merge (or rebase) the upstream development branch into your topic branch: |
| 181 | + |
| 182 | + ```bash |
| 183 | + git pull [--rebase] upstream <dev-branch> |
| 184 | + ``` |
| 185 | + |
| 186 | +6. Push your topic branch up to your fork: |
| 187 | + |
| 188 | + ```bash |
| 189 | + git push origin <topic-branch-name> |
| 190 | + ``` |
| 191 | + |
| 192 | +7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) |
| 193 | + with a clear title and description. |
| 194 | + |
| 195 | +**IMPORTANT**: By submitting a patch, you agree to allow the project owner to |
| 196 | +license your work under the same license as that used by the project. |
0 commit comments