Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
30674293
Unverified
提交
30674293
authored
4月 06, 2021
作者:
Ayush Chaurasia
提交者:
GitHub
4月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for list-of-directory data format for wandb (#2719)
上级
ec8979f1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
+6
-4
wandb_utils.py
utils/wandb_logging/wandb_utils.py
+6
-4
没有找到文件。
utils/wandb_logging/wandb_utils.py
浏览文件 @
30674293
...
...
@@ -57,14 +57,14 @@ def process_wandb_config_ddp_mode(opt):
with
open
(
opt
.
data
)
as
f
:
data_dict
=
yaml
.
load
(
f
,
Loader
=
yaml
.
SafeLoader
)
# data dict
train_dir
,
val_dir
=
None
,
None
if
data_dict
[
'train'
]
.
startswith
(
WANDB_ARTIFACT_PREFIX
):
if
isinstance
(
data_dict
[
'train'
],
str
)
and
data_dict
[
'train'
]
.
startswith
(
WANDB_ARTIFACT_PREFIX
):
api
=
wandb
.
Api
()
train_artifact
=
api
.
artifact
(
remove_prefix
(
data_dict
[
'train'
])
+
':'
+
opt
.
artifact_alias
)
train_dir
=
train_artifact
.
download
()
train_path
=
Path
(
train_dir
)
/
'data/images/'
data_dict
[
'train'
]
=
str
(
train_path
)
if
data_dict
[
'val'
]
.
startswith
(
WANDB_ARTIFACT_PREFIX
):
if
isinstance
(
data_dict
[
'val'
],
str
)
and
data_dict
[
'val'
]
.
startswith
(
WANDB_ARTIFACT_PREFIX
):
api
=
wandb
.
Api
()
val_artifact
=
api
.
artifact
(
remove_prefix
(
data_dict
[
'val'
])
+
':'
+
opt
.
artifact_alias
)
val_dir
=
val_artifact
.
download
()
...
...
@@ -158,7 +158,7 @@ class WandbLogger():
return
data_dict
def
download_dataset_artifact
(
self
,
path
,
alias
):
if
path
and
path
.
startswith
(
WANDB_ARTIFACT_PREFIX
):
if
isinstance
(
path
,
str
)
and
path
.
startswith
(
WANDB_ARTIFACT_PREFIX
):
dataset_artifact
=
wandb
.
use_artifact
(
remove_prefix
(
path
,
WANDB_ARTIFACT_PREFIX
)
+
":"
+
alias
)
assert
dataset_artifact
is
not
None
,
"'Error: W&B dataset artifact doesn
\'
t exist'"
datadir
=
dataset_artifact
.
download
()
...
...
@@ -229,7 +229,9 @@ class WandbLogger():
def
create_dataset_table
(
self
,
dataset
,
class_to_id
,
name
=
'dataset'
):
# TODO: Explore multiprocessing to slpit this loop parallely| This is essential for speeding up the the logging
artifact
=
wandb
.
Artifact
(
name
=
name
,
type
=
"dataset"
)
for
img_file
in
tqdm
([
dataset
.
path
])
if
Path
(
dataset
.
path
)
.
is_dir
()
else
tqdm
(
dataset
.
img_files
):
img_files
=
tqdm
([
dataset
.
path
])
if
isinstance
(
dataset
.
path
,
str
)
and
Path
(
dataset
.
path
)
.
is_dir
()
else
None
img_files
=
tqdm
(
dataset
.
img_files
)
if
not
img_files
else
img_files
for
img_file
in
img_files
:
if
Path
(
img_file
)
.
is_dir
():
artifact
.
add_dir
(
img_file
,
name
=
'data/images'
)
labels_path
=
'labels'
.
join
(
dataset
.
path
.
rsplit
(
'images'
,
1
))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论