Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
63e09fdc
Unverified
提交
63e09fdc
authored
8月 14, 2021
作者:
Glenn Jocher
提交者:
GitHub
8月 14, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove `encoding='ascii'` (#4413)
* Remove `encoding='ascii'` * Reinstate `encoding='ascii'` in emojis()
上级
4e8c81a3
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
7 行增加
和
7 行删除
+7
-7
autoanchor.py
utils/autoanchor.py
+1
-1
datasets.py
utils/datasets.py
+1
-1
general.py
utils/general.py
+2
-2
wandb_utils.py
utils/loggers/wandb/wandb_utils.py
+3
-3
没有找到文件。
utils/autoanchor.py
浏览文件 @
63e09fdc
...
...
@@ -104,7 +104,7 @@ def kmean_anchors(dataset='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen
return
k
if
isinstance
(
dataset
,
str
):
# *.yaml file
with
open
(
dataset
,
e
ncoding
=
'ascii'
,
e
rrors
=
'ignore'
)
as
f
:
with
open
(
dataset
,
errors
=
'ignore'
)
as
f
:
data_dict
=
yaml
.
safe_load
(
f
)
# model dict
from
utils.datasets
import
LoadImagesAndLabels
dataset
=
LoadImagesAndLabels
(
data_dict
[
'train'
],
augment
=
True
,
rect
=
True
)
...
...
utils/datasets.py
浏览文件 @
63e09fdc
...
...
@@ -931,7 +931,7 @@ def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False, profil
im
.
save
(
im_dir
/
Path
(
f
)
.
name
,
quality
=
75
)
# save
zipped
,
data_dir
,
yaml_path
=
unzip
(
Path
(
path
))
with
open
(
check_file
(
yaml_path
),
e
ncoding
=
'ascii'
,
e
rrors
=
'ignore'
)
as
f
:
with
open
(
check_file
(
yaml_path
),
errors
=
'ignore'
)
as
f
:
data
=
yaml
.
safe_load
(
f
)
# data dict
if
zipped
:
data
[
'path'
]
=
data_dir
# TODO: should this be dir.resolve()?
...
...
utils/general.py
浏览文件 @
63e09fdc
...
...
@@ -112,7 +112,7 @@ def is_pip():
def
emojis
(
str
=
''
):
# Return platform-dependent emoji-safe version of string
return
str
.
encode
()
.
decode
(
'ascii'
,
'ignore'
)
if
platform
.
system
()
==
'Windows'
else
str
return
str
.
encode
()
.
decode
(
encoding
=
'ascii'
,
errors
=
'ignore'
)
if
platform
.
system
()
==
'Windows'
else
str
def
file_size
(
file
):
...
...
@@ -250,7 +250,7 @@ def check_dataset(data, autodownload=True):
# Read yaml (optional)
if
isinstance
(
data
,
(
str
,
Path
)):
with
open
(
data
,
e
ncoding
=
'ascii'
,
e
rrors
=
'ignore'
)
as
f
:
with
open
(
data
,
errors
=
'ignore'
)
as
f
:
data
=
yaml
.
safe_load
(
f
)
# dictionary
# Parse yaml
...
...
utils/loggers/wandb/wandb_utils.py
浏览文件 @
63e09fdc
...
...
@@ -62,7 +62,7 @@ def check_wandb_resume(opt):
def
process_wandb_config_ddp_mode
(
opt
):
with
open
(
check_file
(
opt
.
data
),
e
ncoding
=
'ascii'
,
e
rrors
=
'ignore'
)
as
f
:
with
open
(
check_file
(
opt
.
data
),
errors
=
'ignore'
)
as
f
:
data_dict
=
yaml
.
safe_load
(
f
)
# data dict
train_dir
,
val_dir
=
None
,
None
if
isinstance
(
data_dict
[
'train'
],
str
)
and
data_dict
[
'train'
]
.
startswith
(
WANDB_ARTIFACT_PREFIX
):
...
...
@@ -152,7 +152,7 @@ class WandbLogger():
self
.
wandb_artifact_data_dict
=
self
.
check_and_upload_dataset
(
opt
)
elif
opt
.
data
.
endswith
(
'_wandb.yaml'
):
# When dataset is W&B artifact
with
open
(
opt
.
data
,
e
ncoding
=
'ascii'
,
e
rrors
=
'ignore'
)
as
f
:
with
open
(
opt
.
data
,
errors
=
'ignore'
)
as
f
:
data_dict
=
yaml
.
safe_load
(
f
)
self
.
data_dict
=
data_dict
else
:
# Local .yaml dataset file or .zip file
...
...
@@ -186,7 +186,7 @@ class WandbLogger():
opt
.
single_cls
,
'YOLOv5'
if
opt
.
project
==
'runs/train'
else
Path
(
opt
.
project
)
.
stem
)
print
(
"Created dataset config file "
,
config_path
)
with
open
(
config_path
,
e
ncoding
=
'ascii'
,
e
rrors
=
'ignore'
)
as
f
:
with
open
(
config_path
,
errors
=
'ignore'
)
as
f
:
wandb_data_dict
=
yaml
.
safe_load
(
f
)
return
wandb_data_dict
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论