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

vbb2voc error #1

Open
w39865008 opened this issue Aug 10, 2017 · 13 comments
Open

vbb2voc error #1

w39865008 opened this issue Aug 10, 2017 · 13 comments

Comments

@w39865008
Copy link

w39865008 commented Aug 10, 2017

你好,请问vbb2voc中第154行 parse_anno_file取消注释运行,为什么输出的是空文件夹呢。

@CasiaFan
Copy link
Owner

CasiaFan commented Aug 11, 2017

@w39865008 前面150-153行的输入输出路径确认下,我这边的话seq路径下包括像这样:annotations set00 set01 set02 set03 set04 set05 set06 set07 set08 set09 set10 。你也可以在parse_anno_file函数里面打印一些日志出来看看。

@w39865008
Copy link
Author

@CasiaFan 你好,我seq路径下和你一样后出现以下错误,我annotations文件下也包含set00 set01 set02 set03 set04 set05 set06 set07 set08 set09 set10文件夹。
wyh@:~/datasets/Dataset_to_VOC_converter-master$ python vbb2voc.py
Parsing annotations of camera: set06
Traceback (most recent call last):
File "vbb2voc.py", line 161, in
main()
File "vbb2voc.py", line 154, in main
parse_anno_file(vbb_inputdir, seq_inputdir, vbb_outputdir, seq_outputdir)
File "vbb2voc.py", line 122, in parse_anno_file
img_size = seq2img(annos, seq_file, seq_outdir)
File "vbb2voc.py", line 55, in seq2img
img_size = (width, height)
UnboundLocalError: local variable 'width' referenced before assignment

我前面路径为:
seq_inputdir = "/home/wyh/datasets/caltech_dataset"
vbb_inputdir = "/home/wyh/datasets/caltech_dataset/annotations"
seq_outputdir = "/home/wyh/datasets/caltech_dataset"
vbb_outputdir = "/home/wyh/datasets/caltech_dataset"
如果改为
seq_inputdir = "/home/wyh/datasets/caltech_dataset"
vbb_inputdir = "/home/wyh/datasets/caltech_dataset/annotations/set00"
seq_outputdir = "/home/wyh/datasets/caltech_dataset"
vbb_outputdir = "/home/wyh/datasets/caltech_dataset"
就会出现空文件夹。

@CasiaFan
Copy link
Owner

@w39865008 因为脚本是先从vbb_inputdir下面获取各个set的子目录然后再读取里面的文件,所以你改为set00以后是无法读到里面的注释文件的。
而前面出现的错误UnboundLocalError: local variable 'width' referenced before assignment只可能是seq文件没有读到导致的。下面是我用的文件结构:

.
├── annotations 
│   ├── set00 
│   ├── set01
│   ├── set02
│   ├── set03
│   ├── set04
│   ├── set05
│   ├── set06
│   ├── set07
│   ├── set08
│   ├── set09
│   └── set10
├── set00
│   └── frame
├── set01
│   └── frame
├── set02
│   └── frame
├── set03
│   └── frame
├── set04
│   └── frame
├── set05
│   └── frame
├── set06
│   └── frame
├── set07
│   └── frame
├── set08
│   └── frame
├── set09
│   └── frame
├── set10
│   └── frame

最外层set文件夹中包含的是seq文件,annotations下面的set包含的是vbb文件,所以请再确认下你的输入路径

@w39865008
Copy link
Author

@CasiaFan 你好,我发现了问题,我的cv2.VideoCapture()不能读取seq文件,我opencv版本是3.1.0,系统是Ubuntu14.04,和这些人一样 mitmul/caltech-pedestrian-dataset-converter#1 请问我应该怎么做呢。

In [17]: seq_file='/home/datasets/caltech/set00/V000.seq'

In [18]: cap = cv2.VideoCapture(seq_file)

In [19]: print cap.isOpened()
False

@CasiaFan
Copy link
Owner

@w39865008 你的opencv是直接pip install的么,直接安装的opencv好像会有这个问题,可以自己下一个opencv编译安装,我的版本是3.2.0,安装方式是这个

@AllenDun
Copy link

AllenDun commented Sep 5, 2017

In my case, it is found that the xml file only contains one person even if there are several persons in the image. similar errors occur in your implementation?

@CasiaFan
Copy link
Owner

CasiaFan commented Sep 5, 2017

@gallonden Sorry, it's a bug and I have fixed it now. BTW, I didn't use this dataset in my project in the end, so maybe some other issues may still exist. Be careful when using this script and any questions are greatly welcome!

@w39865008
Copy link
Author

@CasiaFan 你好,现在是图像中有一个行人,xml中确有两个目标,比如set06_V010_1026。。。这该怎么改啊!

@CasiaFan
Copy link
Owner

@w39865008 你可以用vbb2voc的visualize_bbox打下框看看,这个图我看了下应该是有两个人没错的

@wyh005
Copy link

wyh005 commented Sep 24, 2017

@CasiaFan 你好,xml中数据和由vbb直接得到的txt格式的annotation有些不一样,如set00_V013_1511,txt中共有7个目标:
1511 400.822523 162.125203 0.836696 39.080048
1511 51.370645 164.734047 46.492069 74.825080
1511 256.112121 165.427354 13.653333 30.389010
1511 306.543298 162.987094 22.874311 45.775758
1511 154.412234 156.367939 36.771569 55.126353
1511 121.375574 151.834998 28.015600 69.261272
1511 193.408532 154.403275 39.450959 60.578611
xml中只有4个:
400.82252276698284 162.12520252025203
401.659218752758 201.20525052505252

51.3706454037973 164.7340472496361
97.86271405492727 239.55912762520194

306.54329768270946 162.98709447415334
329.41760904684975 208.7628520499109

121.375573825557 151.83499779703345
149.3911734469085 221.09626964311946

请问是我提取的数据有问题吗?

@CasiaFan
Copy link
Owner

CasiaFan commented Sep 25, 2017

label的标签里面有person和people两大类,一种是单人,一种是人群(具体你可以利用这行代码查看所有类型)。由于当时我只需要单人的,所以我只只提取了person标签的,剩下的应该是people类型的。如果你两种类型都需要的,注释掉这行代码即可。 @wyh005

@DanLiu0623
Copy link

DanLiu0623 commented Oct 20, 2017

@w39865008 我也是opencv无法读取seq文件,参考别的http://www.cnblogs.com/zcftech/p/3641429.html
可以先把seq文件转换为jpg,再使用这个py文件完成vbb文件的转换

@FayeThePaye
Copy link

had the same issue where opencv-python cant read the .seq files properly, causing empty folders.

i checked the .seq folders for the original dataset and found out there were extra layers of folders, and after removing those i successfully ran the script. if you're having similar problems check your original caltech folders' formatting.

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

6 participants