cherubicXN / afm_cvpr2019

Official implementation of paper "Learning Attraction Field Map for Robust Line Segment Detection" (CVPR 2019)
MIT License
297 stars 66 forks source link

error"python preparation_york.py" KeyError:'line' #26

Open shuttworth opened 3 years ago

shuttworth commented 3 years ago

here are some errors image how to solve it?

SueeH commented 3 years ago

I find the data struct is different from described on website. So you read like this: 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat'? Also key_word "lines" is in *LinesAndVP.mat.

shuttworth commented 3 years ago

I find the data struct is different from described on website. So you read like this: 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat'? Also key_word "lines" is in *LinesAndVP.mat.

yes,it is different from described on website. It's the same with 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat' The temporary solution is not to execute “python preparation_york.py”

Do you have some good ideas?

SueeH commented 3 years ago

I find the data struct is different from described on website. So you read like this: 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat'? Also key_word "lines" is in *LinesAndVP.mat.

yes,it is different from described on website. It's the same with 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat' The temporary solution is not to execute “python preparation_york.py”

Do you have some good ideas? I modified code in preparation_york.py like : $ test_lst = glob.glob(osp.join(data_root,'P*')) $ test_lst = [osp.basename(f) for f in test_lst] $def load_datum(filename): $ image = cv2.imread(osp.join(data_root,filename,filename)+'.jpg') $ lsgs = sio.loadmat(osp.join(data_root,filename,filename)+'LinesAndVP.mat')['lines'] mainly changed target pic path and mat path. Then run OK

shuttworth commented 3 years ago

I find the data struct is different from described on website. So you read like this: 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat'? Also key_word "lines" is in *LinesAndVP.mat.

yes,it is different from described on website. It's the same with 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat' The temporary solution is not to execute “python preparation_york.py” Do you have some good ideas? I modified code in preparation_york.py like : $ test_lst = glob.glob(osp.join(data_root,'P*')) $ test_lst = [osp.basename(f) for f in test_lst] $def load_datum(filename): $ image = cv2.imread(osp.join(data_root,filename,filename)+'.jpg') $ lsgs = sio.loadmat(osp.join(data_root,filename,filename)+'LinesAndVP.mat')['lines'] mainly changed target pic path and mat path. Then run OK

Thanks for your reply. I did it like what you had done. It's ok now.Thanks!! My requirement is to train the images in outside scenes. Have you train the "york" dataset? I read the "afm_atrous.yaml" and "readme.md",only "wireframe" can train,the "york" folder can only be tested. The "wireframe" folder have the "train.json" ,while the "york" folder didn't Do you have some ideas? thank you!

SueeH commented 3 years ago

I find the data struct is different from described on website. So you read like this: 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat'? Also key_word "lines" is in *LinesAndVP.mat.

yes,it is different from described on website. It's the same with 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat' The temporary solution is not to execute “python preparation_york.py” Do you have some good ideas? I modified code in preparation_york.py like : $ test_lst = glob.glob(osp.join(data_root,'P*')) $ test_lst = [osp.basename(f) for f in test_lst] $def load_datum(filename): $ image = cv2.imread(osp.join(data_root,filename,filename)+'.jpg') $ lsgs = sio.loadmat(osp.join(data_root,filename,filename)+'LinesAndVP.mat')['lines'] mainly changed target pic path and mat path. Then run OK

Thanks for your reply. I did it like what you had done. It's ok now.Thanks!! My requirement is to train the images in outside scenes. Have you train the "york" dataset? I read the "afm_atrous.yaml" and "readme.md",only "wireframe" can train,the "york" folder can only be tested. The "wireframe" folder have the "train.json" ,while the "york" folder didn't Do you have some ideas? thank you! On the way of training .

shuttworth commented 3 years ago

I find the data struct is different from described on website. So you read like this: 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat'? Also key_word "lines" is in *LinesAndVP.mat.

yes,it is different from described on website. It's the same with 'P1020171/P1020171.jpg' and 'P1020171/P1020171LinesAndVP.mat' The temporary solution is not to execute “python preparation_york.py” Do you have some good ideas? I modified code in preparation_york.py like : $ test_lst = glob.glob(osp.join(data_root,'P*')) $ test_lst = [osp.basename(f) for f in test_lst] $def load_datum(filename): $ image = cv2.imread(osp.join(data_root,filename,filename)+'.jpg') $ lsgs = sio.loadmat(osp.join(data_root,filename,filename)+'LinesAndVP.mat')['lines'] mainly changed target pic path and mat path. Then run OK

Thanks for your reply. I did it like what you had done. It's ok now.Thanks!! My requirement is to train the images in outside scenes. Have you train the "york" dataset? I read the "afm_atrous.yaml" and "readme.md",only "wireframe" can train,the "york" folder can only be tested. The "wireframe" folder have the "train.json" ,while the "york" folder didn't Do you have some ideas? thank you! On the way of training .

okay , I'm waiting for your reply~ If possible,My email is shuttworth@foxmail.com We can email each other~