-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pre-commit hooks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add ufmt as code formatter * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Move create_small_table to _helper.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use exists to check an existing file * Add mdformat as markdown formatter * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use exists to check an existing file * Fixing flake8 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleanup codes * Fixing pre-commit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixing pre-commit * Catch exception in v5/utils/downloads.py * Fixing exception in check_font * Use exists to check an existing file * Fixing exception in parse_model * Fixing format * Decrease max-line-length in setup.cfg * Fixing flake8 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
97f507d
commit c9b5b6f
Showing
77 changed files
with
4,106 additions
and
2,204 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,33 @@ | ||
repos: | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-docstring-first | ||
- id: check-toml | ||
- id: check-yaml | ||
exclude: packaging/.* | ||
- id: end-of-file-fixer | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: [--config=setup.cfg] | ||
|
||
- repo: https://github.com/omnilib/ufmt | ||
rev: v1.3.0 | ||
hooks: | ||
- id: ufmt | ||
additional_dependencies: | ||
- black == 21.9b0 | ||
- usort == 0.6.4 | ||
|
||
- repo: https://github.com/executablebooks/mdformat | ||
rev: 0.7.9 | ||
hooks: | ||
- id: mdformat | ||
additional_dependencies: | ||
- mdformat-gfm | ||
- mdformat-black | ||
- mdformat_frontmatter |
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
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Contributing | ||
|
||
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. | ||
email, or any other method with the owners of this repository before making a change. | ||
|
||
Please note we have a code of conduct, please follow it in all your interactions with the project. | ||
|
||
## Pull Request Process | ||
|
||
1. Ensure any install or build dependencies are removed before the end of the layer when doing a | ||
1. Ensure any install or build dependencies are removed before the end of the layer when doing a | ||
build. | ||
2. Update the README.md with details of changes to the interface, this includes new environment | ||
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. | ||
3. 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/)>. | ||
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you | ||
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 |
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
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
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
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 |
---|---|---|
|
@@ -12,37 +12,37 @@ The ncnn inference for `yolort`, both GPU and CPU are supported. | |
|
||
1. First, Setup the environment variables. | ||
|
||
```bash | ||
export TORCH_PATH=$(dirname $(python -c "import torch; print(torch.__file__)")) | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TORCH_PATH/lib/ | ||
``` | ||
```bash | ||
export TORCH_PATH=$(dirname $(python -c "import torch; print(torch.__file__)")) | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TORCH_PATH/lib/ | ||
``` | ||
|
||
1. First, compile `ncnn` using the following scripts. | ||
|
||
```bash | ||
git clone --recursive [email protected]:Tencent/ncnn.git | ||
cd ncnn | ||
mkdir build && cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_SYSTEM_GLSLANG=ON -DNCNN_BUILD_EXAMPLES=ON .. # Set -DNCNN_VULKAN=ON if you're using VULKAN | ||
make -j4 | ||
make install | ||
``` | ||
```bash | ||
git clone --recursive [email protected]:Tencent/ncnn.git | ||
cd ncnn | ||
mkdir build && cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_SYSTEM_GLSLANG=ON -DNCNN_BUILD_EXAMPLES=ON .. # Set -DNCNN_VULKAN=ON if you're using VULKAN | ||
make -j4 | ||
make install | ||
``` | ||
|
||
Or follow the [official instructions](https://github.com/Tencent/ncnn/wiki/how-to-build) to install ncnn. | ||
Or follow the [official instructions](https://github.com/Tencent/ncnn/wiki/how-to-build) to install ncnn. | ||
|
||
1. Then compile the source code. | ||
|
||
```bash | ||
cd deployment/ncnn | ||
mkdir build && cd build | ||
cmake .. -Dncnn_DIR=<ncnn_install_dir>/lib/cmake/ncnn/ | ||
make | ||
``` | ||
```bash | ||
cd deployment/ncnn | ||
mkdir build && cd build | ||
cmake .. -Dncnn_DIR=<ncnn_install_dir>/lib/cmake/ncnn/ | ||
make | ||
``` | ||
|
||
_Note: you have to change <ncnn_install_dir> to your machine's directory, it is the directory that contains ncnnConfig.cmake, if you are following the above operations, you should set it to <./ncnn/build/install>_ | ||
_Note: you have to change \<ncnn_install_dir> to your machine's directory, it is the directory that contains ncnnConfig.cmake, if you are following the above operations, you should set it to \<./ncnn/build/install>_ | ||
1. Now, you can infer your own images with ncnn. | ||
```bash | ||
./yolort_ncnn ../../../test/assets/zidane.jpg | ||
``` | ||
```bash | ||
./yolort_ncnn ../../../test/assets/zidane.jpg | ||
``` |
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
Oops, something went wrong.