Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
2683b180
Unverified
提交
2683b180
authored
7月 28, 2021
作者:
Glenn Jocher
提交者:
GitHub
7月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Hub Path inputs (#4200)
上级
1f31b7c5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
3 行删除
+5
-3
hubconf.py
hubconf.py
+3
-1
common.py
models/common.py
+2
-2
没有找到文件。
hubconf.py
浏览文件 @
2683b180
...
@@ -115,9 +115,11 @@ if __name__ == '__main__':
...
@@ -115,9 +115,11 @@ if __name__ == '__main__':
import
cv2
import
cv2
import
numpy
as
np
import
numpy
as
np
from
PIL
import
Image
from
PIL
import
Image
from
pathlib
import
Path
imgs
=
[
'data/images/zidane.jpg'
,
# filename
imgs
=
[
'data/images/zidane.jpg'
,
# filename
'https://github.com/ultralytics/yolov5/releases/download/v1.0/zidane.jpg'
,
# URI
Path
(
'data/images/zidane.jpg'
),
# Path
'https://ultralytics.com/images/zidane.jpg'
,
# URI
cv2
.
imread
(
'data/images/bus.jpg'
)[:,
:,
::
-
1
],
# OpenCV
cv2
.
imread
(
'data/images/bus.jpg'
)[:,
:,
::
-
1
],
# OpenCV
Image
.
open
(
'data/images/bus.jpg'
),
# PIL
Image
.
open
(
'data/images/bus.jpg'
),
# PIL
np
.
zeros
((
320
,
640
,
3
))]
# numpy
np
.
zeros
((
320
,
640
,
3
))]
# numpy
...
...
models/common.py
浏览文件 @
2683b180
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
logging
import
logging
from
copy
import
copy
from
copy
import
copy
from
pathlib
import
Path
,
PosixPath
from
pathlib
import
Path
import
math
import
math
import
numpy
as
np
import
numpy
as
np
...
@@ -248,7 +248,7 @@ class AutoShape(nn.Module):
...
@@ -248,7 +248,7 @@ class AutoShape(nn.Module):
shape0
,
shape1
,
files
=
[],
[],
[]
# image and inference shapes, filenames
shape0
,
shape1
,
files
=
[],
[],
[]
# image and inference shapes, filenames
for
i
,
im
in
enumerate
(
imgs
):
for
i
,
im
in
enumerate
(
imgs
):
f
=
f
'image{i}'
# filename
f
=
f
'image{i}'
# filename
if
isinstance
(
im
,
(
str
,
P
osixP
ath
)):
# filename or uri
if
isinstance
(
im
,
(
str
,
Path
)):
# filename or uri
im
,
f
=
Image
.
open
(
requests
.
get
(
im
,
stream
=
True
)
.
raw
if
str
(
im
)
.
startswith
(
'http'
)
else
im
),
im
im
,
f
=
Image
.
open
(
requests
.
get
(
im
,
stream
=
True
)
.
raw
if
str
(
im
)
.
startswith
(
'http'
)
else
im
),
im
im
=
np
.
asarray
(
exif_transpose
(
im
))
im
=
np
.
asarray
(
exif_transpose
(
im
))
elif
isinstance
(
im
,
Image
.
Image
):
# PIL Image
elif
isinstance
(
im
,
Image
.
Image
):
# PIL Image
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论