vbb2voc error
w39865008 opened this issue · 13 comments
你好,请问vbb2voc中第154行 parse_anno_file取消注释运行,为什么输出的是空文件夹呢。
@w39865008 前面150-153行的输入输出路径确认下,我这边的话seq路径下包括像这样:annotations set00 set01 set02 set03 set04 set05 set06 set07 set08 set09 set10
。你也可以在parse_anno_file函数里面打印一些日志出来看看。
@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"
就会出现空文件夹。
@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文件,所以请再确认下你的输入路径
@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
@w39865008 你的opencv是直接pip install的么,直接安装的opencv好像会有这个问题,可以自己下一个opencv编译安装,我的版本是3.2.0,安装方式是这个
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?
@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 你可以用vbb2voc的visualize_bbox打下框看看,这个图我看了下应该是有两个人没错的
@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
请问是我提取的数据有问题吗?
@w39865008 我也是opencv无法读取seq文件,参考别的http://www.cnblogs.com/zcftech/p/3641429.html
可以先把seq文件转换为jpg,再使用这个py文件完成vbb文件的转换
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.