Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
c8e8bdbd
P
PaddleOCR
项目概览
weixin_41840029
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c8e8bdbd
编写于
12月 27, 2021
作者:
R
redearly123/PaddleOCR
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add feature lock/unlock selected shapes
上级
ee060d07
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
15 deletion
+12
-15
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+12
-15
未找到文件。
PPOCRLabel/PPOCRLabel.py
浏览文件 @
c8e8bdbd
...
...
@@ -1117,9 +1117,8 @@ class MainWindow(QMainWindow, WindowMixin):
difficult
=
s
.
difficult
)
# bool
shapes
=
[]
if
mode
==
'Auto'
else
\
[
format_shape
(
shape
)
for
shape
in
self
.
canvas
.
shapes
]
[
format_shape
(
shape
)
for
shape
in
self
.
canvas
.
shapes
if
shape
.
line_color
!=
DEFAULT_LOCK_COLOR
]
# Can add differrent annotation formats here
print
(
"in save labels self.result_dic"
,
self
.
result_dic
)
for
box
in
self
.
result_dic
:
trans_dic
=
{
"label"
:
box
[
1
][
0
],
"points"
:
box
[
0
],
'difficult'
:
False
}
if
trans_dic
[
"label"
]
==
""
and
mode
==
'Auto'
:
...
...
@@ -1131,7 +1130,6 @@ class MainWindow(QMainWindow, WindowMixin):
for
box
in
shapes
:
trans_dic
.
append
({
"transcription"
:
box
[
'label'
],
"points"
:
box
[
'points'
],
'difficult'
:
box
[
'difficult'
]})
self
.
PPlabel
[
annotationFilePath
]
=
trans_dic
if
mode
==
'Auto'
:
self
.
Cachelabel
[
annotationFilePath
]
=
trans_dic
...
...
@@ -1375,6 +1373,7 @@ class MainWindow(QMainWindow, WindowMixin):
self
.
actions
.
save
.
setEnabled
(
True
)
if
len
(
self
.
canvas
.
lockedShapes
)
!=
0
:
self
.
actions
.
save
.
setEnabled
(
True
)
self
.
setDirty
()
self
.
canvas
.
setEnabled
(
True
)
self
.
adjustScale
(
initial
=
True
)
self
.
paintCanvas
()
...
...
@@ -1688,16 +1687,15 @@ class MainWindow(QMainWindow, WindowMixin):
self
.
saveLockedShapes
()
if
mode
==
'Manual'
:
if
len
(
self
.
result_dic_locked
)
==
0
:
img
=
cv2
.
imread
(
self
.
filePath
)
width
,
height
=
self
.
image
.
width
(),
self
.
image
.
height
()
for
shape
in
self
.
canvas
.
lockedShapes
:
print
(
shape
)
box
=
[[
int
(
p
[
0
]
*
width
),
int
(
p
[
1
]
*
height
)]
for
p
in
shape
[
'ratio'
]]
assert
len
(
box
)
==
4
result
=
[(
shape
[
'transcription'
],
1
)]
result
.
insert
(
0
,
box
)
self
.
result_dic_locked
.
append
(
result
)
self
.
result_dic_locked
=
[]
img
=
cv2
.
imread
(
self
.
filePath
)
width
,
height
=
self
.
image
.
width
(),
self
.
image
.
height
()
for
shape
in
self
.
canvas
.
lockedShapes
:
box
=
[[
int
(
p
[
0
]
*
width
),
int
(
p
[
1
]
*
height
)]
for
p
in
shape
[
'ratio'
]]
assert
len
(
box
)
==
4
result
=
[(
shape
[
'transcription'
],
1
)]
result
.
insert
(
0
,
box
)
self
.
result_dic_locked
.
append
(
result
)
self
.
result_dic
+=
self
.
result_dic_locked
self
.
result_dic_locked
=
[]
if
annotationFilePath
and
self
.
saveLabels
(
annotationFilePath
,
mode
=
mode
):
...
...
@@ -1957,8 +1955,7 @@ class MainWindow(QMainWindow, WindowMixin):
else
:
rec_flag
+=
1
except
IndexError
as
e
:
print
(
'except:'
,
e
)
print
(
'Can not recognise the box'
)
if
(
len
(
self
.
result_dic
)
>
0
and
rec_flag
>
0
)
or
self
.
canvas
.
lockedShapes
:
self
.
canvas
.
isInTheSameImage
=
True
self
.
saveFile
(
mode
=
'Auto'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录