Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
欲游山河十万里
yolov8V4
提交
6d0af1ed
Y
yolov8V4
项目概览
欲游山河十万里
/
yolov8V4
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yolov8V4
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6d0af1ed
编写于
10月 08, 2023
作者:
欲游山河十万里
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交数据处理的代码
上级
76a76433
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
124 addition
and
2 deletion
+124
-2
datadeal/deepfasion2_to_yolo.py
datadeal/deepfasion2_to_yolo.py
+51
-0
demo1.py
demo1.py
+3
-2
myfourtrain.py
myfourtrain.py
+2
-0
ultralytics/cfg/datasets/yolov8_four.yaml
ultralytics/cfg/datasets/yolov8_four.yaml
+10
-0
ultralytics/cfg/datasets/yolov8_seg_four.yaml
ultralytics/cfg/datasets/yolov8_seg_four.yaml
+10
-0
ultralytics/cfg/models/v3/yolov3-swinV2-RTViT.yaml
ultralytics/cfg/models/v3/yolov3-swinV2-RTViT.yaml
+48
-0
ultralytics/cfg/models/v8/yolov8-swinV2-RTViT.yaml
ultralytics/cfg/models/v8/yolov8-swinV2-RTViT.yaml
+0
-0
未找到文件。
datadeal/deepfasion2_to_yolo.py
0 → 100644
浏览文件 @
6d0af1ed
# coding:utf-8
import
json
import
os
import
os.path
from
PIL
import
Image
from
tqdm
import
tqdm
def
listPathAllfiles
(
dirname
):
result
=
[]
for
maindir
,
subdir
,
file_name_list
in
os
.
walk
(
dirname
):
for
filename
in
file_name_list
:
apath
=
os
.
path
.
join
(
maindir
,
filename
)
result
.
append
(
apath
)
return
result
if
__name__
==
'__main__'
:
annos_path
=
r
"E:\06服饰\Deepfashion2\train\train\annos"
# 改成需要路径
image_path
=
r
"E:\06服饰\Deepfashion2\train\train\images"
# 改成需要路径
labels_path
=
r
"E:\06服饰\Deepfashion2\train\train\labels"
# 改成需要路径
num_images
=
len
(
os
.
listdir
(
annos_path
))
for
num
in
tqdm
(
range
(
1
,
num_images
+
1
)):
json_name
=
os
.
path
.
join
(
annos_path
,
str
(
num
).
zfill
(
6
)
+
'.json'
)
image_name
=
os
.
path
.
join
(
image_path
,
str
(
num
).
zfill
(
6
)
+
'.jpg'
)
txtfile
=
os
.
path
.
join
(
labels_path
,
str
(
num
).
zfill
(
6
)
+
'.txt'
)
imag
=
Image
.
open
(
image_name
)
width
,
height
=
imag
.
size
res
=
[]
with
open
(
json_name
,
'r'
)
as
f
:
temp
=
json
.
loads
(
f
.
read
())
for
i
in
temp
:
if
i
==
'source'
or
i
==
'pair_id'
:
continue
else
:
box
=
temp
[
i
][
'bounding_box'
]
x_1
=
round
((
box
[
0
]
+
box
[
2
])
/
2
/
width
,
6
)
y_1
=
round
((
box
[
1
]
+
box
[
3
])
/
2
/
height
,
6
)
w
=
round
((
box
[
2
]
-
box
[
0
])
/
width
,
6
)
h
=
round
((
box
[
3
]
-
box
[
1
])
/
height
,
6
)
category_id
=
int
(
temp
[
i
][
'category_id'
]
-
1
)
res
.
append
(
" "
.
join
([
str
(
category_id
),
str
(
x_1
),
str
(
y_1
),
str
(
w
),
str
(
h
)]))
open
(
txtfile
,
"w"
).
write
(
"
\n
"
.
join
(
res
))
demo1.py
浏览文件 @
6d0af1ed
from
ultralytics
import
RTDETR
from
ultralytics
import
RTDETR
from
ultralytics
import
YOLO
from
ultralytics
import
YOLO
# Load a model
# Load a model
model
=
RTDETR
(
"E:/fourworkplace/yolov8v4/ultralytics/cfg/models/v8/yolov8-swinV2-RTV
I
T.yaml"
)
# build a new model from scratch
model
=
RTDETR
(
"E:/fourworkplace/yolov8v4/ultralytics/cfg/models/v8/yolov8-swinV2-RTV
i
T.yaml"
)
# build a new model from scratch
model
.
info
()
model
.
info
()
model1
=
RTDETR
(
"E:/fourworkplace/yolov8v4/ultralytics/cfg/models/v8/yolov8-swinV2-RT.yaml"
)
model1
=
RTDETR
(
"E:/fourworkplace/yolov8v4/ultralytics/cfg/models/v8/yolov8-swinV2-RT.yaml"
)
...
@@ -12,7 +12,8 @@ model2.info()
...
@@ -12,7 +12,8 @@ model2.info()
model3
=
RTDETR
(
"E:/fourworkplace/yolov8v4/ultralytics/cfg/models/v3/yolov3-swinV2-RTViT.yaml"
)
model3
.
info
()
myfourtrain.py
浏览文件 @
6d0af1ed
...
@@ -35,5 +35,7 @@ model = YOLO("E:/fourworkplace/yolov8v4/ultralytics/cfg/models/v8/yolov8-swinV2-
...
@@ -35,5 +35,7 @@ model = YOLO("E:/fourworkplace/yolov8v4/ultralytics/cfg/models/v8/yolov8-swinV2-
model
.
train
(
data
=
"E:/fourworkplace/yolov8v4/ultralytics/cfg/datasets/yolov8_four.yaml"
,
model
.
train
(
data
=
"E:/fourworkplace/yolov8v4/ultralytics/cfg/datasets/yolov8_four.yaml"
,
pretrained
=
True
,
epochs
=
epoch_set
,
batch
=
64
,
patience
=
200
,
resume
=
True
,
workers
=
workers_set
)
pretrained
=
True
,
epochs
=
epoch_set
,
batch
=
64
,
patience
=
200
,
resume
=
True
,
workers
=
workers_set
)
#使用YOLOv3进行训练,并把我们的改进方法加到YOLOv3上面以此突出改进方案的优势。
#下面开始考虑对图像分割问题的处理方案
#下面开始考虑对图像分割问题的处理方案
ultralytics/cfg/datasets/yolov8_four.yaml
0 → 100644
浏览文件 @
6d0af1ed
path
:
../datasets/imagenet
# dataset root dir
train
:
train
# train images (relative to 'path') 1281167 images
val
:
val
# val images (relative to 'path') 50000 images
test
:
# test images (optional)
nc
:
13
# number of classes
names
:
[
'
short
sleeve
top'
,
'
long
sleeve
top'
,
'
short
sleeve
outwear'
,
'
long
sleeve
outwear'
,
'
vest'
,
'
sling'
,
'
shorts'
,
'
trousers'
,
'
skirt'
,
'
short
sleeve
dress'
,
'
long
sleeve
dress'
,
'
vest
dress'
,
'
sling
dress'
]
ultralytics/cfg/datasets/yolov8_seg_four.yaml
0 → 100644
浏览文件 @
6d0af1ed
path
:
../datasets/imagenet
# dataset root dir
train
:
train
# train images (relative to 'path') 1281167 images
val
:
val
# val images (relative to 'path') 50000 images
test
:
# test images (optional)
nc
:
13
# number of classes
names
:
[
'
short
sleeve
top'
,
'
long
sleeve
top'
,
'
short
sleeve
outwear'
,
'
long
sleeve
outwear'
,
'
vest'
,
'
sling'
,
'
shorts'
,
'
trousers'
,
'
skirt'
,
'
short
sleeve
dress'
,
'
long
sleeve
dress'
,
'
vest
dress'
,
'
sling
dress'
]
ultralytics/cfg/models/v3/yolov3-swinV2-RTViT.yaml
0 → 100644
浏览文件 @
6d0af1ed
# Ultralytics YOLO 🚀, AGPL-3.0 license
# YOLOv3 object detection model with P3-P5 outputs. For details see https://docs.ultralytics.com/models/yolov3
# Parameters
nc
:
13
# number of classes
depth_multiple
:
1.0
# model depth multiple
width_multiple
:
1.0
# layer channel multiple
# darknet53 backbone
backbone
:
# [from, number, module, args]
[[
-1
,
1
,
Conv
,
[
32
,
3
,
1
]],
# 0
[
-1
,
1
,
Conv
,
[
64
,
3
,
2
]],
# 1-P1/2
[
-1
,
1
,
SwinV2_CSPB
,
[
64
]],
[
-1
,
1
,
Conv
,
[
128
,
3
,
2
]],
# 3-P2/4
[
-1
,
2
,
SwinV2_CSPB
,
[
128
]],
[
-1
,
1
,
Conv
,
[
256
,
3
,
2
]],
# 5-P3/8
[
-1
,
8
,
SwinV2_CSPB
,
[
256
]],
[
-1
,
1
,
Conv
,
[
512
,
3
,
2
]],
# 7-P4/16
[
-1
,
8
,
SwinV2_CSPB
,
[
512
]],
[
-1
,
1
,
Conv
,
[
1024
,
3
,
2
]],
# 9-P5/32
[
-1
,
4
,
SwinV2_CSPB
,
[
1024
]],
# 10
]
# YOLOv3 head
head
:
[[
-1
,
1
,
SwinV2_CSPB
,
[
1024
,
False
]],
[
-1
,
1
,
Conv
,
[
512
,
1
,
1
]],
[
-1
,
1
,
Conv
,
[
1024
,
3
,
1
]],
[
-1
,
1
,
Conv
,
[
512
,
1
,
1
]],
[
-1
,
1
,
Conv
,
[
1024
,
3
,
1
]],
# 15 (P5/32-large)
[
-2
,
1
,
Conv
,
[
256
,
1
,
1
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
[[
-1
,
8
],
1
,
Concat
,
[
1
]],
# cat backbone P4
[
-1
,
1
,
SwinV2_CSPB
,
[
512
,
False
]],
[
-1
,
1
,
SwinV2_CSPB
,
[
512
,
False
]],
[
-1
,
1
,
Conv
,
[
256
,
1
,
1
]],
[
-1
,
1
,
Conv
,
[
512
,
3
,
1
]],
# 22 (P4/16-medium)
[
-2
,
1
,
Conv
,
[
128
,
1
,
1
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
[[
-1
,
6
],
1
,
Concat
,
[
1
]],
# cat backbone P3
[
-1
,
1
,
SwinV2_CSPB
,
[
256
,
False
]],
[
-1
,
2
,
SwinV2_CSPB
,
[
256
,
False
]],
# 27 (P3/8-small)
[[
27
,
22
,
15
],
1
,
RTDETRDecoderViT
,
[
nc
]],
# Detect(P3, P4, P5)
]
ultralytics/cfg/models/v8/yolov8-swinV2-RTV
I
T.yaml
→
ultralytics/cfg/models/v8/yolov8-swinV2-RTV
i
T.yaml
浏览文件 @
6d0af1ed
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录