可视化标注数据
kaikaizhu opened this issue · 8 comments
@github-luffy
您好,请教一下关于人脸关键点的标注信息
我可视化了一下list.txt的关键点,发现部分点是乱的,请问标注的点是直接可视化么?
我是读取一行,然后line[1]~line[136] *112变成68个点画在图上的,另外标注信息最后的0 0 1 0 0 0 是什么?
/home/data/WFLW/train_data/imgs/WFLW_0_51_Dresses_wearingdress_51_377_0.png 0.0885083825019613 0.20997702626503661 0.1156312312042364 0.30337741484701886 0.09992738348669587 0.3996145336199006 0.10177439925062108 0.4969836119328583 0.13573235547692208 0.5884961243952668 0.17954538257550995 0.6759568218406773 0.22458856175634154 0.7627766501454629 0.26553019120603427 0.8514915051320606 0.34426656427742547 0.905014995750523 0.47679674475761635 0.887883525513206 0.6020233281985486 0.8372941914961428 0.720325805153308 0.7726321679278897 0.8104811153651281 0.6731986201457898 0.8613277419341658 0.5485699386277458 0.8872600220237317 0.41602928768142 0.9057656770969534 0.28222145495554396 0.9173093660107218 0.1476206759528635 0.0840376849952602 0.14829704252745815 0.10764852228523797 0.10126160178723195 0.1347259138418541 0.11636607916285303 0.16502725130344534 0.13154180678363625 0.1992426916146378 0.15204183027834076 0.33944351004756146 0.13965060820639383 0.4136192928298248 0.11499374581181354 0.4939853556485356 0.09573019498561715 0.5717427401363101 0.09954604144874477 0.6633368456214043 0.14362759769711037 0.2843995672888337 0.2612719675487055 0.27263165717344406 0.34170953598980125 0.2638164823524124 0.42215387192730125 0.24054912742710513 0.49059496763859833 0.2069163302497385 0.5214749260427562 0.24675530469567208 0.5337558889987578 0.288239802276739 0.5332414315834205 0.3367609000106237 0.5220229655628923 0.385994436351824 0.5147365426418672 0.11486612104471758 0.2780711920191553 0.1281346915656054 0.2543223871845581 0.18886026677726203 0.25213903961820083 0.23631720762372516 0.2737046245750523 0.18988560632681747 0.28335252067533995 0.12916003111516083 0.2855358682416972 0.40344557502778505 0.26955653234505755 0.43627706232430047 0.24696739547921026 0.5210153747303217 0.2383965528160957 0.5729221998398274 0.25241471933021703 0.5243087193955936 0.2688514358328975 0.43957040698957245 0.27742240618462344 0.21814118070083682 0.6402741116958682 0.22741335306207505 0.6058980391115324 0.2642363225067011 0.6044979334875131 0.2938455238501896 0.6062975767766082 0.3308172505270986 0.6009817721953452 0.4262184558054393 0.6068850720776674 0.5220561646018567 0.6084555143092966 0.4513672385754446 0.6566068896688677 0.3733126588446326 0.6908674040598849 0.2898784940711624 0.7071479573908211 0.2553494505303674 0.6986364899320083 0.23048732869295893 0.6738099932171809 0.22610039491533734 0.6411255393566946 0.26013675194903896 0.645261756545829 0.294367004139154 0.6469429048035434 0.3939403071064331 0.6364537961313416 0.4926116177227707 0.6193356055096103 0.393806936351824 0.6364710340938807 0.2940980919235421 0.6469460970188284 0.2600028704399843 0.6452489876846889 0 0 1 0 0 0
@github-luffy
您好,请教一下关于人脸关键点的标注信息
我可视化了一下list.txt的关键点,发现部分点是乱的,请问标注的点是直接可视化么?
我是读取一行,然后line[1]~line[136] *112变成68个点画在图上的,另外标注信息最后的0 0 1 0 0 0 是什么?/home/data/WFLW/train_data/imgs/WFLW_0_51_Dresses_wearingdress_51_377_0.png 0.0885083825019613 0.20997702626503661 0.1156312312042364 0.30337741484701886 0.09992738348669587 0.3996145336199006 0.10177439925062108 0.4969836119328583 0.13573235547692208 0.5884961243952668 0.17954538257550995 0.6759568218406773 0.22458856175634154 0.7627766501454629 0.26553019120603427 0.8514915051320606 0.34426656427742547 0.905014995750523 0.47679674475761635 0.887883525513206 0.6020233281985486 0.8372941914961428 0.720325805153308 0.7726321679278897 0.8104811153651281 0.6731986201457898 0.8613277419341658 0.5485699386277458 0.8872600220237317 0.41602928768142 0.9057656770969534 0.28222145495554396 0.9173093660107218 0.1476206759528635 0.0840376849952602 0.14829704252745815 0.10764852228523797 0.10126160178723195 0.1347259138418541 0.11636607916285303 0.16502725130344534 0.13154180678363625 0.1992426916146378 0.15204183027834076 0.33944351004756146 0.13965060820639383 0.4136192928298248 0.11499374581181354 0.4939853556485356 0.09573019498561715 0.5717427401363101 0.09954604144874477 0.6633368456214043 0.14362759769711037 0.2843995672888337 0.2612719675487055 0.27263165717344406 0.34170953598980125 0.2638164823524124 0.42215387192730125 0.24054912742710513 0.49059496763859833 0.2069163302497385 0.5214749260427562 0.24675530469567208 0.5337558889987578 0.288239802276739 0.5332414315834205 0.3367609000106237 0.5220229655628923 0.385994436351824 0.5147365426418672 0.11486612104471758 0.2780711920191553 0.1281346915656054 0.2543223871845581 0.18886026677726203 0.25213903961820083 0.23631720762372516 0.2737046245750523 0.18988560632681747 0.28335252067533995 0.12916003111516083 0.2855358682416972 0.40344557502778505 0.26955653234505755 0.43627706232430047 0.24696739547921026 0.5210153747303217 0.2383965528160957 0.5729221998398274 0.25241471933021703 0.5243087193955936 0.2688514358328975 0.43957040698957245 0.27742240618462344 0.21814118070083682 0.6402741116958682 0.22741335306207505 0.6058980391115324 0.2642363225067011 0.6044979334875131 0.2938455238501896 0.6062975767766082 0.3308172505270986 0.6009817721953452 0.4262184558054393 0.6068850720776674 0.5220561646018567 0.6084555143092966 0.4513672385754446 0.6566068896688677 0.3733126588446326 0.6908674040598849 0.2898784940711624 0.7071479573908211 0.2553494505303674 0.6986364899320083 0.23048732869295893 0.6738099932171809 0.22610039491533734 0.6411255393566946 0.26013675194903896 0.645261756545829 0.294367004139154 0.6469429048035434 0.3939403071064331 0.6364537961313416 0.4926116177227707 0.6193356055096103 0.393806936351824 0.6364710340938807 0.2940980919235421 0.6469460970188284 0.2600028704399843 0.6452489876846889 0 0 1 0 0 0
画在图上,是哪张图上,原图可能不对。0 0 1 0 0 0表示的是人脸属性值,如下:
姿态(pose) 0->正常姿态(normal pose) 1->大的姿态(large pose)
表情(expression) 0->正常表情(normal expression) 1->夸张的表情(exaggerate expression)
照度(illumination) 0->正常照明(normal illumination) 1->极端照明(extreme illumination)
化妆(make-up) 0->无化妆(no make-up) 1->化妆(make-up)
遮挡(occlusion) 0->无遮挡(no occlusion) 1->遮挡(occlusion)
模糊(blur) 0->清晰(clear) 1->模糊(blur)
@github-luffy
您好,请教一下关于人脸关键点的标注信息
我可视化了一下list.txt的关键点,发现部分点是乱的,请问标注的点是直接可视化么?
我是读取一行,然后line[1]~line[136] *112变成68个点画在图上的,另外标注信息最后的0 0 1 0 0 0 是什么?
/home/data/WFLW/train_data/imgs/WFLW_0_51_Dresses_wearingdress_51_377_0.png 0.0885083825019613 0.20997702626503661 0.1156312312042364 0.30337741484701886 0.09992738348669587 0.3996145336199006 0.10177439925062108 0.4969836119328583 0.13573235547692208 0.5884961243952668 0.17954538257550995 0.6759568218406773 0.22458856175634154 0.7627766501454629 0.26553019120603427 0.8514915051320606 0.34426656427742547 0.905014995750523 0.47679674475761635 0.887883525513206 0.6020233281985486 0.8372941914961428 0.720325805153308 0.7726321679278897 0.8104811153651281 0.6731986201457898 0.8613277419341658 0.5485699386277458 0.8872600220237317 0.41602928768142 0.9057656770969534 0.28222145495554396 0.9173093660107218 0.1476206759528635 0.0840376849952602 0.14829704252745815 0.10764852228523797 0.10126160178723195 0.1347259138418541 0.11636607916285303 0.16502725130344534 0.13154180678363625 0.1992426916146378 0.15204183027834076 0.33944351004756146 0.13965060820639383 0.4136192928298248 0.11499374581181354 0.4939853556485356 0.09573019498561715 0.5717427401363101 0.09954604144874477 0.6633368456214043 0.14362759769711037 0.2843995672888337 0.2612719675487055 0.27263165717344406 0.34170953598980125 0.2638164823524124 0.42215387192730125 0.24054912742710513 0.49059496763859833 0.2069163302497385 0.5214749260427562 0.24675530469567208 0.5337558889987578 0.288239802276739 0.5332414315834205 0.3367609000106237 0.5220229655628923 0.385994436351824 0.5147365426418672 0.11486612104471758 0.2780711920191553 0.1281346915656054 0.2543223871845581 0.18886026677726203 0.25213903961820083 0.23631720762372516 0.2737046245750523 0.18988560632681747 0.28335252067533995 0.12916003111516083 0.2855358682416972 0.40344557502778505 0.26955653234505755 0.43627706232430047 0.24696739547921026 0.5210153747303217 0.2383965528160957 0.5729221998398274 0.25241471933021703 0.5243087193955936 0.2688514358328975 0.43957040698957245 0.27742240618462344 0.21814118070083682 0.6402741116958682 0.22741335306207505 0.6058980391115324 0.2642363225067011 0.6044979334875131 0.2938455238501896 0.6062975767766082 0.3308172505270986 0.6009817721953452 0.4262184558054393 0.6068850720776674 0.5220561646018567 0.6084555143092966 0.4513672385754446 0.6566068896688677 0.3733126588446326 0.6908674040598849 0.2898784940711624 0.7071479573908211 0.2553494505303674 0.6986364899320083 0.23048732869295893 0.6738099932171809 0.22610039491533734 0.6411255393566946 0.26013675194903896 0.645261756545829 0.294367004139154 0.6469429048035434 0.3939403071064331 0.6364537961313416 0.4926116177227707 0.6193356055096103 0.393806936351824 0.6364710340938807 0.2940980919235421 0.6469460970188284 0.2600028704399843 0.6452489876846889 0 0 1 0 0 0画在图上,是哪张图上,原图可能不对。0 0 1 0 0 0表示的是人脸属性值,如下:
姿态(pose) 0->正常姿态(normal pose) 1->大的姿态(large pose)
表情(expression) 0->正常表情(normal expression) 1->夸张的表情(exaggerate expression)
照度(illumination) 0->正常照明(normal illumination) 1->极端照明(extreme illumination)
化妆(make-up) 0->无化妆(no make-up) 1->化妆(make-up)
遮挡(occlusion) 0->无遮挡(no occlusion) 1->遮挡(occlusion)
模糊(blur) 0->清晰(clear) 1->模糊(blur)
可视化的图片应该是112*112即训练的尺寸图片,原图上画是不对的
感谢你的回答!我是画在了112*112的训练图片上,发现部分点是乱的,尤其是眼睛部分
感谢你的回答!我是画在了112*112的训练图片上,发现部分点是乱的,尤其是眼睛部分
方便的话 可以给我看看你写的代码 还有可视化后的图片
import os
import sys
import pdb
import cv2
res_path = './draw_res/'
txt_file = './list.txt'
with open(txt_file) as f:
lines = f.readlines()
for line in lines:
line = line.strip().split(' ')
img = cv2.imread(line[0])
img_w = img.shape[0]
file_name = line[0].strip().split('/')[-1]
#pdb.set_trace()
for num in range((len(line)-7)//2):
p_x = int(float(line[num+1])*img_w)
p_y = int(float(line[num+2])*img_w)
point = (p_x, p_y)
cv2.circle(img, point, 1, (0, 0, 255), 1)
cv2.imwrite(res_path + file_name, img)
可视化的结果
链接:https://pan.baidu.com/s/1zZfwz0aRHaEQHJTKy89FjA
提取码:1234
import os
import sys
import pdb
import cv2res_path = './draw_res/'
txt_file = './list.txt'with open(txt_file) as f:
lines = f.readlines()
for line in lines:
line = line.strip().split(' ')
img = cv2.imread(line[0])
img_w = img.shape[0]
file_name = line[0].strip().split('/')[-1]
#pdb.set_trace()
for num in range((len(line)-7)//2):
p_x = int(float(line[num+1])*img_w)
p_y = int(float(line[num+2])*img_w)
point = (p_x, p_y)
cv2.circle(img, point, 1, (0, 0, 255), 1)
cv2.imwrite(res_path + file_name, img)
p_x = int(float(line[num+1])*img_w)
p_y = int(float(line[num+2])*img_w)这两行代码是不是有问题,应该是:
p_x = int(float(line[num*2+1])img_w)
p_y = int(float(line[num2+2])*img_w)
或者是for num in range((len(line)-7)//2)改成for num in range((len(line)-7))
哈哈哈,尴尬了,多谢