Skip to content

Commit

Permalink
调整权重存储目录。
Browse files Browse the repository at this point in the history
  • Loading branch information
LIU42 committed Sep 29, 2024
1 parent 1dd46d2 commit 34ce2bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,5 @@ examples/outputs/*

*/datasets/*
*/runs/*
*/weights/develop/*
*/weights/deploy/*
*/weights/*
*/checkpoints/*
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pip install -r requirements.txt
pip install onnxruntime-gpu
```

待识别图像默认在 <u>examples/sources/</u> 下 ,识别结果默认保存在 <u>examples/outputs/</u> 下,如果不存在请先创建。将所有待识别的图像放入待识别图像目录下,要求图像尺寸为 640x480,可以在本项目 Releases 中下载我训练好的模型权重文件,解压到项目中相应的位置(位于 <u>detect/weights/deploy/</u> 和 <u>classify/weights/deploy/</u>),运行 main.py 即可。
待识别图像默认在 <u>examples/sources/</u> 下 ,识别结果默认保存在 <u>examples/outputs/</u> 下,如果不存在请先创建。将所有待识别的图像放入待识别图像目录下,要求图像尺寸为 640x480,可以在本项目 Releases 中下载我训练好的模型权重文件,解压到项目中相应的位置(位于 <u>detect/weights/</u> 和 <u>classify/weights/</u>),运行 main.py 即可。

```bash
python main.py
Expand Down Expand Up @@ -79,3 +79,5 @@ strategy: "conservative" # 通行规则识别策略,“conservative”(
```bash
pip install ultralytics
```


2 changes: 1 addition & 1 deletion classify/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, configs):
providers = ['CPUExecutionProvider']

self.configs = configs
self.session = ort.InferenceSession(f'classify/weights/deploy/classify-{self.precision}.onnx', providers=providers)
self.session = ort.InferenceSession(f'classify/weights/classify-{self.precision}.onnx', providers=providers)

def __call__(self, image, signals):
for signal in signals:
Expand Down
2 changes: 1 addition & 1 deletion detect/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, configs):
providers = ['CPUExecutionProvider']

self.configs = configs
self.session = ort.InferenceSession(f'detect/weights/deploy/detect-{self.precision}.onnx', providers=providers)
self.session = ort.InferenceSession(f'detect/weights/detect-{self.precision}.onnx', providers=providers)

def __call__(self, image):
inputs = process.preprocess(image, size=640, padding_color=127, precision=self.precision)
Expand Down

0 comments on commit 34ce2bb

Please sign in to comment.