Skip to content

Commit 0c0a4ea

Browse files
committed
Version 5.7.1
添加了 `conf_thres` 和 `iou_thres` 的设置方法,在初始化识别方法时可以添加。
1 parent 1429233 commit 0c0a4ea

File tree

12 files changed

+145
-13
lines changed

12 files changed

+145
-13
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/YoloDetectAPI.iml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
3+
14
# Introduction
25

36
YoloV5 作为 YoloV4 之后的改进型,在算法上做出了优化,检测的性能得到了一定的提升。其特点之一就是权重文件非常的小,可以在一些配置更低的移动设备上运行,且提高速度的同时准确度更高。本次使用的是最新推出的 YoloV5 Version7 版本。
@@ -55,7 +58,7 @@ import torch
5558

5659
if __name__ == '__main__':
5760
cap = cv2.VideoCapture(0)
58-
a = yolo_detectAPI.DetectAPI(weights='last.pt') # 你要使用的模型的路径
61+
a = yolo_detectAPI.DetectAPI(weights='last.pt', conf_thres=0.5, iou_thres=0.5) # 你要使用的模型的路径
5962
with torch.no_grad():
6063
while True:
6164
rec, img = cap.read()
@@ -65,7 +68,7 @@ if __name__ == '__main__':
6568
for cls, (x1, y1, x2, y2), conf in result[0][1]:
6669
print(names[cls], x1, y1, x2, y2, conf) # 识别物体种类、左上角x坐标、左上角y轴坐标、右下角x轴坐标、右下角y轴坐标,置信度
6770

68-
cv2.imshow("vedio", img)
71+
cv2.imshow("video", img)
6972

7073
if cv2.waitKey(1) == ord('q'):
7174
break
@@ -97,3 +100,12 @@ if __name__ == '__main__':
97100
https://github.com/ultralytics/yolov5/releases/tag/v7.0
98101
https://blog.csdn.net/weixin_51331359/article/details/126012620
99102
https://blog.csdn.net/CharmsLUO/article/details/123422822
103+
104+
# Update Version 5.7.1 2023-03-29
105+
添加了 `conf_thres``iou_thres` 的设置方法,在初始化识别方法时可以添加。
106+
```python
107+
yolo_detectAPI.DetectAPI(weights='last.pt', conf_thres=0.5, iou_thres=0.5)
108+
```
109+
`iou_thres` 过大容易出现一个目标多个检测框;
110+
111+
`iou_thres` 过小容易出现检测结果少的问题。

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33

44
setup(
55
name='yolo_detectAPI',
6-
version='5.7',
6+
version='5.7.1',
77
description='Detect API',
8-
long_description='This is a API for yolov5 version7 detect.py',
8+
long_description='This is a API for yolov5 version7 detect.py, new-version 5.7.1 allow user set <conf_thres> and '
9+
'<iou_thres>',
910
license='GPL Licence',
1011
author='Da Kuang',
1112
author_email='[email protected]',
1213
py_modeles = '__init__.py',
1314
packages=find_packages(),
1415
pakages=['yolo_detectAPI'],
1516
include_package_data=True,
16-
python_requires='>=3.8',
17+
readme = 'README.md',
18+
python_requires='>=3.7',
1719
url = 'http://blogs.kd-mercury.xyz/',
1820
install_requires=['matplotlib>=3.2.2', 'numpy>=1.18.5', 'opencv-python>=4.1.1',
1921
'Pillow>=7.1.2', 'PyYAML>=5.3.1', 'requests>=2.23.0', 'scipy>=1.4.1',
@@ -22,10 +24,11 @@
2224
'ipython>=8.3.0', 'psutil>=5.9.4'],
2325
data_files=['export.py'],
2426
classifiers=[
27+
"Programming Language :: Python :: 3.7",
2528
"Programming Language :: Python :: 3.8",
2629
"Programming Language :: Python :: 3.9",
2730
"License :: OSI Approved :: GNU General Public License (GPL)",
28-
"Development Status :: 4 - Beta"
31+
"Development Status :: 3 - Alpha"
2932
],
3033
scripts=[],
3134
)
167 KB
Binary file not shown.

0 commit comments

Comments
 (0)