Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
__zzh__
classification
提交
6d91c3aa
classification
项目概览
__zzh__
/
classification
与 Fork 源项目一致
Fork自
Eric.Lee2021 / classification
通知
12
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
classification
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6d91c3aa
编写于
3月 30, 2021
作者:
Eric.Lee2021
🚴🏻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
0cd88a57
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
6 deletion
+10
-6
data_iter/__pycache__/datasets.cpython-37.pyc
data_iter/__pycache__/datasets.cpython-37.pyc
+0
-0
data_iter/datasets.py
data_iter/datasets.py
+10
-6
未找到文件。
data_iter/__pycache__/datasets.cpython-37.pyc
0 → 100644
浏览文件 @
6d91c3aa
文件已添加
data_iter/datasets.py
浏览文件 @
6d91c3aa
...
...
@@ -72,7 +72,11 @@ def img_agu_crop(img_):
x2
=
min
(
img_
.
shape
[
1
]
-
1
,
img_
.
shape
[
1
]
-
random
.
randint
(
0
,
scale_
))
y2
=
min
(
img_
.
shape
[
0
]
-
1
,
img_
.
shape
[
1
]
-
random
.
randint
(
0
,
scale_
))
# print(img_.shape,'-crop- : ',x1,y1,x2,y2)
img_crop_
=
img_
[
y1
:
y2
,
x1
:
x2
,:]
try
:
img_crop_
=
img_
[
y1
:
y2
,
x1
:
x2
,:]
except
:
img_crop_
=
img_
print
(
"img_agu_crop error "
)
return
img_crop_
# 图像旋转
def
M_rotate_image
(
image
,
angle
,
cx
,
cy
):
...
...
@@ -126,8 +130,6 @@ class LoadImagesAndLabels(Dataset): # for training/testing
img_path
=
self
.
files
[
index
]
label_
=
self
.
labels
[
index
]
# print(img_path)
img
=
cv2
.
imread
(
img_path
)
# BGR
#--------------------------------------------
if
self
.
have_label_file
:
...
...
@@ -148,8 +150,6 @@ class LoadImagesAndLabels(Dataset): # for training/testing
img
=
img
[
y1
:
y2
,
x1
:
x2
,:]
break
#--------------------------------------------
if
self
.
flag_agu
==
True
and
random
.
random
()
>
0.5
:
...
...
@@ -167,7 +167,11 @@ class LoadImagesAndLabels(Dataset): # for training/testing
offset_x
=
random
.
randint
(
-
range_limit_x
,
range_limit_x
)
offset_y
=
random
.
randint
(
-
range_limit_y
,
range_limit_y
)
if
not
(
angle
==
0
and
offset_x
==
0
and
offset_y
==
0
):
img
,
_
=
M_rotate_image
(
img
,
angle
,
cx
+
offset_x
,
cy
+
offset_y
)
try
:
img
,
_
=
M_rotate_image
(
img
,
angle
,
cx
+
offset_x
,
cy
+
offset_y
)
except
:
print
(
"M_rotate_image error "
)
img
=
cv2
.
imread
(
img_path
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录