You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[How to Contribute Changes](#how-to-contribute-changes)
16
+
-[Installation for Contributors](#installation-for-contributors)
17
+
-[Code Style and Quality](#-code-style-and-quality)
18
+
-[Pre-commit tool](#pre-commit-tool)
19
+
-[Docstrings](#docstrings)
20
+
-[Type checking](#type-checking)
21
+
-[Documentation](#-documentation)
22
+
-[Cookbooks](#-cookbooks)
23
+
-[Tests](#-tests)
24
+
-[License](#-license)
25
+
7
26
## Contribution Guidelines
8
27
9
28
We welcome contributions to:
@@ -32,49 +51,49 @@ First, fork this repository to your own GitHub account. Click "fork" in the top
32
51
33
52
Then, run `git clone` to download the project code to your computer.
34
53
35
-
Move to a new branch using the `git checkout` command:
54
+
You should also set up `roboflow/supervision` as an "upstream" remote (that is, tell git that the reference Supervision repository was the source of your fork of it):
This project uses the [pre-commit](https://pre-commit.com/) tool to maintain code quality and consistency. Before submitting a pull request or making any commits, it is important to run the pre-commit tool to ensure that your changes meet the project's guidelines.
56
-
57
-
Furthermore, we have integrated a pre-commit GitHub Action into our workflow. This means that with every pull request opened, the pre-commit checks will be automatically enforced, streamlining the code review process and ensuring that all contributions adhere to our quality standards.
58
-
59
-
To run the pre-commit tool, follow these steps:
60
-
61
-
1. Install pre-commit by running the following command: `poetry install`. It will not only install pre-commit but also install all the deps and dev-deps of project
62
-
63
-
2. Once pre-commit is installed, navigate to the project's root directory.
64
-
65
-
3. Run the command `pre-commit run --all-files`. This will execute the pre-commit hooks configured for this project against the modified files. If any issues are found, the pre-commit tool will provide feedback on how to resolve them. Make the necessary changes and re-run the pre-commit command until all issues are resolved.
67
+
The name you choose for your branch should describe the change you want to make and start with an appropriate prefix:
66
68
67
-
4. You can also install pre-commit as a git hook by execute `pre-commit install`. Every time you made `git commit` pre-commit run automatically for you.
69
+
-`feat/`: for new features (e.g., `feat/line-counter`)
70
+
-`fix/`: for bug fixes (e.g., `fix/memory-leak`)
71
+
-`docs/`: for documentation changes (e.g., `docs/update-readme`)
72
+
-`chore/`: for routine tasks, maintenance, or tooling changes (e.g., `chore/update-dependencies`)
73
+
-`test/`: for adding or modifying tests (e.g., `test/add-unit-tests`)
74
+
-`refactor/`: for code refactoring (e.g., `refactor/simplify-algorithm`)
68
75
69
-
### Docstrings
76
+
Make any changes you want to the project code, then run the following commands to commit your changes:
70
77
71
-
All new functions and classes in `supervision` should include docstrings. This is a prerequisite for any new functions and classes to be added to the library.
78
+
```bash
79
+
git add -A
80
+
git commit -m "feat: add line counter functionality"
81
+
git push -u origin <your_branch_name>
82
+
```
72
83
73
-
`supervision` adheres to the [Google Python docstring style](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods). Please refer to the style guide while writing docstrings for your contribution.
84
+
Use conventional commit messages to clearly describe your changes. The format is:
74
85
75
-
### Type checking
86
+
<type>[optional scope]: <description>
76
87
77
-
So far, **there is no type checking with mypy**. See [issue](https://github.com/roboflow-ai/template-python/issues/4).
88
+
Common types include:
89
+
- feat: A new feature
90
+
- fix: A bug fix
91
+
- docs: Documentation only changes
92
+
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc)
93
+
- refactor: A code change that neither fixes a bug nor adds a feature
94
+
- perf: A code change that improves performance
95
+
- test: Adding missing tests or correcting existing tests
96
+
- chore: Changes to the build process or auxiliary tools and libraries
78
97
79
98
Then, go back to your fork of the `supervision` repository, click "Pull Requests", and click "New Pull Request".
80
99
@@ -104,32 +123,100 @@ All pull requests will be reviewed by the maintainers of the project. We will pr
104
123
105
124
PRs must pass all tests and linting requirements before they can be merged.
106
125
107
-
## 📝 documentation
126
+
## Installation for Contributors
127
+
128
+
Before starting your work on the project, set up your development environment:
Replace `YOUR_USERNAME` with your GitHub username.
136
+
137
+
2. Create and activate a virtual environment:
138
+
```bash
139
+
python3 -m venv .venv
140
+
source .venv/bin/activate
141
+
```
142
+
143
+
3. Install Poetry:
144
+
145
+
Using pip:
146
+
```bash
147
+
pip install -U pip setuptools
148
+
pip install poetry
149
+
```
150
+
151
+
Or using pipx (recommended for global installation):
152
+
```bash
153
+
pipx install poetry
154
+
```
155
+
156
+
4. Install project dependencies:
157
+
```bash
158
+
poetry install
159
+
```
160
+
161
+
5. Run pytest to verify the setup:
162
+
```bash
163
+
poetry run pytest
164
+
```
165
+
166
+
## 🎨 Code Style and Quality
167
+
168
+
### Pre-commit tool
169
+
170
+
This project uses the [pre-commit](https://pre-commit.com/) tool to maintain code quality and consistency. Before submitting a pull request or making any commits, it is important to run the pre-commit tool to ensure that your changes meet the project's guidelines.
171
+
172
+
Furthermore, we have integrated a pre-commit GitHub Action into our workflow. This means that with every pull request opened, the pre-commit checks will be automatically enforced, streamlining the code review process and ensuring that all contributions adhere to our quality standards.
173
+
174
+
To run the pre-commit tool, follow these steps:
175
+
176
+
1. Install pre-commit by running the following command: `poetry install`. It will not only install pre-commit but also install all the deps and dev-deps of project
177
+
178
+
2. Once pre-commit is installed, navigate to the project's root directory.
179
+
180
+
3. Run the command `pre-commit run --all-files`. This will execute the pre-commit hooks configured for this project against the modified files. If any issues are found, the pre-commit tool will provide feedback on how to resolve them. Make the necessary changes and re-run the pre-commit command until all issues are resolved.
181
+
182
+
4. You can also install pre-commit as a git hook by executing `pre-commit install`. Every time you do a `git commit` pre-commit run automatically for you.
183
+
184
+
### Docstrings
185
+
186
+
All new functions and classes in `supervision` should include docstrings. This is a prerequisite for any new functions and classes to be added to the library.
187
+
188
+
`supervision` adheres to the [Google Python docstring style](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods). Please refer to the style guide while writing docstrings for your contribution.
189
+
190
+
### Type checking
191
+
192
+
So far, **there is no type checking with mypy**. See [issue](https://github.com/roboflow-ai/template-python/issues/4).
193
+
194
+
## 📝 Documentation
108
195
109
196
The `supervision` documentation is stored in a folder called `docs`. The project documentation is built using `mkdocs`.
110
197
111
198
To run the documentation, install the project requirements with `poetry install --with dev`. Then, run `mkdocs serve` to start the documentation server.
112
199
113
200
You can learn more about mkdocs on the [mkdocs website](https://www.mkdocs.org/).
114
201
115
-
## 🧑🍳 cookbooks
202
+
## 🧑🍳 Cookbooks
116
203
117
204
We are always looking for new examples and cookbooks to add to the `supervision`
118
205
documentation. If you have a use case that you think would be helpful to others, please
119
206
submit a PR with your example. Here are some guidelines for submitting a new example:
120
207
121
-
- Create a new notebook in the [`docs/nodebooks`](https://github.com/roboflow/supervision/tree/develop/docs/notebooks) folder.
208
+
- Create a new notebook in the [`docs/notebooks`](https://github.com/roboflow/supervision/tree/develop/docs/notebooks) folder.
122
209
- Add a link to the new notebook in [`docs/theme/cookbooks.html`](https://github.com/roboflow/supervision/blob/develop/docs/theme/cookbooks.html). Make sure to add the path to the new notebook, as well as a title, labels, author and supervision version.
123
210
- Use the [Count Objects Crossing the Line](https://supervision.roboflow.com/develop/notebooks/count-objects-crossing-the-line/) example as a template for your new example.
124
211
- Freeze the version of `supervision` you are using.
125
212
- Place an appropriate Open in Colab button at the top of the notebook. You can find an example of such a button in the aforementioned `Count Objects Crossing the Line` cookbook.
126
213
- Notebook should be self-contained. If you rely on external data ( videos, images, etc.) or libraries, include download and installation commands in the notebook.
127
214
- Annotate the code with appropriate comments, including links to the documentation describing each of the tools you have used.
128
215
129
-
## 🧪 tests
216
+
## 🧪 Tests
130
217
131
218
[`pytests`](https://docs.pytest.org/en/7.1.x/) is used to run our tests.
132
219
133
-
## 📄 license
220
+
## 📄 License
134
221
135
222
By contributing, you agree that your contributions will be licensed under an [MIT license](https://github.com/roboflow/supervision/blob/develop/LICENSE.md).
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@
28
28
29
29
**We write your reusable computer vision tools.** Whether you need to load your dataset from your hard drive, draw detections on an image or video, or count how many detections are in a zone. You can count on us! 🤝
Supervision offers a wide range of highly customizable [annotators](https://supervision.roboflow.com/latest/annotators/), allowing you to compose the perfect visualization for your use case.
89
+
Supervision offers a wide range of highly customizable [annotators](https://supervision.roboflow.com/latest/detection/annotators/), allowing you to compose the perfect visualization for your use case.
Supervision provides a set of [utils](https://supervision.roboflow.com/latest/datasets/) that allow you to load, split, merge, and save datasets in one of the supported formats.
109
+
Supervision provides a set of [utils](https://supervision.roboflow.com/latest/datasets/core/) that allow you to load, split, merge, and save datasets in one of the supported formats.
110
110
111
111
```python
112
112
import supervision as sv
@@ -216,7 +216,7 @@ len(dataset)
216
216
217
217
## 🎬 tutorials
218
218
219
-
Want to learn how to use Supervision? Explore our [how-to guides](https://supervision.roboflow.com/develop/how_to/detect_and_annotate/), [end-to-end examples](https://github.com/roboflow/supervision/tree/develop/examples), and [cookbooks](https://supervision.roboflow.com/develop/cookbooks/)!
219
+
Want to learn how to use Supervision? Explore our [how-to guides](https://supervision.roboflow.com/develop/how_to/detect_and_annotate/), [end-to-end examples](https://github.com/roboflow/supervision/tree/develop/examples), [cheatsheet](https://roboflow.github.io/cheatsheet-supervision/), and [cookbooks](https://supervision.roboflow.com/develop/cookbooks/)!
0 commit comments