Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于coords中pen-end不一致的问题 #107

Open
galactica147 opened this issue Nov 3, 2024 · 1 comment
Open

关于coords中pen-end不一致的问题 #107

galactica147 opened this issue Nov 3, 2024 · 1 comment

Comments

@galactica147
Copy link

你好,文章中明确说明了数据采用5-D表示,并且最后一维是pen-end,只有在字符结束的时候才标1. 但是data/CASIA_CHINESE/train/data.mdbdata/CASIA_CHINESE/test/data.mdb 都没有采用该标记,i.e., 每个sample最后一行的末尾维都是标0,这是什么原因?

coords[-1]
array([2.626e+03, 3.541e+03, 0.000e+00, 1.000e+00, 0.000e+00],

另外一个佐证是这个corrds2xys()实现. 假设数据准备也是调用这个的话,那么pen-end这一维确实只能是0:

SDT/utils/util.py

Lines 165 to 177 in 2d72dc2

def corrds2xys(coordinates):
new_strokes = []
for stroke in coordinates:
for (x, y) in np.array(stroke).reshape((-1, 2)):
p = np.array([x, y, 1, 0, 0], np.float32)
new_strokes.append(p)
try:
new_strokes[-1][2:] = [0, 1, 0] # set the end of a stroke
except IndexError:
print(stroke)
return None
new_strokes = np.stack(new_strokes, axis=0)
return new_strokes

@dailenson
Copy link
Owner

你好,pen-end的插入是在代码里面完成的,debug看一下就知道啦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants