Sunarker/Collaborative-Learning-for-Weakly-Supervised-Object-Detection

question about training on VOC07

Opened this issue · 11 comments

Hi, thanks for the sharing work.
I trained the model with
./experiments/scripts/train.sh 0 pascal_voc vgg16 wsddnpath
and I found in vgg16.yml it needs selective search. I tried to modified it into gt and I got

  File "./tools/trainval_net.py", line 114, in <module>
    imdb, roidb = combined_roidb(args.imdb_name)
  File "./tools/trainval_net.py", line 80, in combined_roidb
    roidbs = [get_roidb(s) for s in imdb_names.split('+')]
  File "./tools/trainval_net.py", line 77, in get_roidb
    roidb = get_training_roidb(imdb)
  File "/home/Collaborative-Learning-for-Weakly-Supervised-Object-Detection/tools/../lib/model/train_val.py", line 320, in get_training_roidb
    imdb.append_flipped_images()
  File "/home/Collaborative-Learning-for-Weakly-Supervised-Object-Detection/tools/../lib/datasets/imdb.py", line 126, in append_flipped_images
    boxes = self.roidb[i]['boxes'].copy()
KeyError: 'boxes'

the roidb object only has label key and no other key. I 'm confused about the data processing.
Can you give me some suggestions, thank you

@CCC-123 In fact, that's because you only changed PROPOSAL_METHOD but ignore codes here:

gt_roidb = [self._load_pascal_labels(index)
for index in self.image_index]

which only detect labels to begin a WSD rather than boxes for gt.

You must use SelectiveSearchCodeIJCV to generate boxes for weak-supervised detection and save as .mat files , you can find relative files in FAST-rcnn.

Have you solved this problem? Can you teach me?Thankyou!

i have this problem too,and can‘t solve it 。

Hi, thanks for the sharing work.
I trained the model with
./experiments/scripts/train.sh 0 pascal_voc vgg16 wsddnpath
and I found in vgg16.yml it needs selective search. I tried to modified it into gt and I got

  File "./tools/trainval_net.py", line 114, in <module>
    imdb, roidb = combined_roidb(args.imdb_name)
  File "./tools/trainval_net.py", line 80, in combined_roidb
    roidbs = [get_roidb(s) for s in imdb_names.split('+')]
  File "./tools/trainval_net.py", line 77, in get_roidb
    roidb = get_training_roidb(imdb)
  File "/home/Collaborative-Learning-for-Weakly-Supervised-Object-Detection/tools/../lib/model/train_val.py", line 320, in get_training_roidb
    imdb.append_flipped_images()
  File "/home/Collaborative-Learning-for-Weakly-Supervised-Object-Detection/tools/../lib/datasets/imdb.py", line 126, in append_flipped_images
    boxes = self.roidb[i]['boxes'].copy()
KeyError: 'boxes'

the roidb object only has label key and no other key. I 'm confused about the data processing.
Can you give me some suggestions, thank you

Have you solved this problem? Can you teach me?Thankyou!

@CCC-123 In fact, that's because you only changed PROPOSAL_METHOD but ignore codes here:

gt_roidb = [self._load_pascal_labels(index)
for index in self.image_index]

which only detect labels to begin a WSD rather than boxes for gt.

You must use SelectiveSearchCodeIJCV to generate boxes for weak-supervised detection and save as .mat files , you can find relative files in FAST-rcnn.

Could you teach me how to change it?

i have this problem too,and can‘t solve it 。

Have you solved this problem? Can you teach me?Thankyou!

i have this problem too,and can‘t solve it 。

Have you solved this problem? Can you teach me?Thankyou!

Sry for reply late! The MAIN REASON is the experiment need selectivesearch functions but there isn't code in it. Firstly, you can find the option in config.py,keep the PROPOSAL_METHOD "selectivesearch"

__C.TRAIN.PROPOSAL_METHOD = 'selective_search'

and keep the cfgs PROPOSAL_METHOD as well , for vgg16, it is

And, you need generate .mat files for the weak detection. You can download .mat files for voc dataset from fast-rcnn project. For your own data, you have to write some codes to use functions in SelectiveSearchCodeIJCV to generate new .mat files.
https://github.com/ZhangXinNan/SelectiveSearchCodeIJCV

You'd better read pascal_voc.py to know how two detections works. Such as

def _load_selective_search_roidb(self, gt_roidb):
filename = os.path.abspath(os.path.join(self.cache_path, '..',
'selective_search_data',
self.name + '.mat'))
assert os.path.exists(filename), \
'Selective search data not found at: {}'.format(filename)
data = sio.loadmat(filename)
raw_data = data['boxes'].ravel()
box_list = []
for i in range(raw_data.shape[0]):
box_list.append(raw_data[i][:, (1, 0, 3, 2)] - 1)
return self.create_roidb_from_box_list(box_list, gt_roidb)

Best wishes.

i have this problem too,and can‘t solve it 。

Have you solved this problem? Can you teach me?Thankyou!

Sry for reply late! The MAIN REASON is the experiment need selectivesearch functions but there isn't code in it. Firstly, you can find the option in config.py,keep the PROPOSAL_METHOD "selectivesearch"

__C.TRAIN.PROPOSAL_METHOD = 'selective_search'

and keep the cfgs PROPOSAL_METHOD as well , for vgg16, it is

And, you need generate .mat files for the weak detection. You can download .mat files for voc dataset from fast-rcnn project. For your own data, you have to write some codes to use functions in SelectiveSearchCodeIJCV to generate new .mat files.
https://github.com/ZhangXinNan/SelectiveSearchCodeIJCV

You'd better read pascal_voc.py to know how two detections works. Such as

def _load_selective_search_roidb(self, gt_roidb):
filename = os.path.abspath(os.path.join(self.cache_path, '..',
'selective_search_data',
self.name + '.mat'))
assert os.path.exists(filename), \
'Selective search data not found at: {}'.format(filename)
data = sio.loadmat(filename)
raw_data = data['boxes'].ravel()
box_list = []
for i in range(raw_data.shape[0]):
box_list.append(raw_data[i][:, (1, 0, 3, 2)] - 1)
return self.create_roidb_from_box_list(box_list, gt_roidb)

Best wishes.

Thank you very much! Because I am a novice, just touched this content. I still don't know how to change the code. When I use vgg16, there is no problem. But these problems have arisen recently when res101 is used. I would like to ask you to give me some guidance. In addition, I would like to ask you if you have any code to generate. mat files. I may not be able to write it myself.

i have this problem too,and can‘t solve it 。

Have you solved this problem? Can you teach me?Thankyou!

Sry for reply late! The MAIN REASON is the experiment need selectivesearch functions but there isn't code in it. Firstly, you can find the option in config.py,keep the PROPOSAL_METHOD "selectivesearch"

__C.TRAIN.PROPOSAL_METHOD = 'selective_search'

and keep the cfgs PROPOSAL_METHOD as well , for vgg16, it is

And, you need generate .mat files for the weak detection. You can download .mat files for voc dataset from fast-rcnn project. For your own data, you have to write some codes to use functions in SelectiveSearchCodeIJCV to generate new .mat files.
https://github.com/ZhangXinNan/SelectiveSearchCodeIJCV
You'd better read pascal_voc.py to know how two detections works. Such as

def _load_selective_search_roidb(self, gt_roidb):
filename = os.path.abspath(os.path.join(self.cache_path, '..',
'selective_search_data',
self.name + '.mat'))
assert os.path.exists(filename), \
'Selective search data not found at: {}'.format(filename)
data = sio.loadmat(filename)
raw_data = data['boxes'].ravel()
box_list = []
for i in range(raw_data.shape[0]):
box_list.append(raw_data[i][:, (1, 0, 3, 2)] - 1)
return self.create_roidb_from_box_list(box_list, gt_roidb)

Best wishes.

Thank you very much! Because I am a novice, just touched this content. I still don't know how to change the code. I would like to ask you to give me some guidance. In addition, I would like to ask you if you have any code to generate. mat files. I may not be able to write it myself.

Sry, That's all I can help. I 'm working with another project so I don't have other guidance any more. The codes to generate .mat files are easy and can find on internet. Maybe you can read codes times to grow up quickly. Trust yourself.

i have this problem too,and can‘t solve it 。

Have you solved this problem? Can you teach me?Thankyou!

Sry for reply late! The MAIN REASON is the experiment need selectivesearch functions but there isn't code in it. Firstly, you can find the option in config.py,keep the PROPOSAL_METHOD "selectivesearch"

__C.TRAIN.PROPOSAL_METHOD = 'selective_search'

and keep the cfgs PROPOSAL_METHOD as well , for vgg16, it is

And, you need generate .mat files for the weak detection. You can download .mat files for voc dataset from fast-rcnn project. For your own data, you have to write some codes to use functions in SelectiveSearchCodeIJCV to generate new .mat files.
https://github.com/ZhangXinNan/SelectiveSearchCodeIJCV
You'd better read pascal_voc.py to know how two detections works. Such as

def _load_selective_search_roidb(self, gt_roidb):
filename = os.path.abspath(os.path.join(self.cache_path, '..',
'selective_search_data',
self.name + '.mat'))
assert os.path.exists(filename), \
'Selective search data not found at: {}'.format(filename)
data = sio.loadmat(filename)
raw_data = data['boxes'].ravel()
box_list = []
for i in range(raw_data.shape[0]):
box_list.append(raw_data[i][:, (1, 0, 3, 2)] - 1)
return self.create_roidb_from_box_list(box_list, gt_roidb)

Best wishes.

Thank you very much! Because I am a novice, just touched this content. I still don't know how to change the code. I would like to ask you to give me some guidance. In addition, I would like to ask you if you have any code to generate. mat files. I may not be able to write it myself.

Sry, That's all I can help. I 'm working with another project so I don't have other guidance any more. The codes to generate .mat files are easy and can find on internet. Maybe you can read codes times to grow up quickly. Trust yourself.

Thank you!Best wishes!

i have this problem too,and can‘t solve it 。

Have you solved this problem? Can you teach me?Thankyou!

Sry for reply late! The MAIN REASON is the experiment need selectivesearch functions but there isn't code in it. Firstly, you can find the option in config.py,keep the PROPOSAL_METHOD "selectivesearch"

__C.TRAIN.PROPOSAL_METHOD = 'selective_search'

and keep the cfgs PROPOSAL_METHOD as well , for vgg16, it is

And, you need generate .mat files for the weak detection. You can download .mat files for voc dataset from fast-rcnn project. For your own data, you have to write some codes to use functions in SelectiveSearchCodeIJCV to generate new .mat files.
https://github.com/ZhangXinNan/SelectiveSearchCodeIJCV
You'd better read pascal_voc.py to know how two detections works. Such as

def _load_selective_search_roidb(self, gt_roidb):
filename = os.path.abspath(os.path.join(self.cache_path, '..',
'selective_search_data',
self.name + '.mat'))
assert os.path.exists(filename), \
'Selective search data not found at: {}'.format(filename)
data = sio.loadmat(filename)
raw_data = data['boxes'].ravel()
box_list = []
for i in range(raw_data.shape[0]):
box_list.append(raw_data[i][:, (1, 0, 3, 2)] - 1)
return self.create_roidb_from_box_list(box_list, gt_roidb)

Best wishes.

Thank you very much! Because I am a novice, just touched this content. I still don't know how to change the code. I would like to ask you to give me some guidance. In addition, I would like to ask you if you have any code to generate. mat files. I may not be able to write it myself.

Sry, That's all I can help. I 'm working with another project so I don't have other guidance any more. The codes to generate .mat files are easy and can find on internet. Maybe you can read codes times to grow up quickly. Trust yourself.

Hello! I have two questions to ask you.

  1. If I want to train with my own data set, does WSDDN, a weak supervisory model, need to be retrained by myself? Because I need to make the mat file of edgeboxes by myself, I can't find the code. How do you do it?

  2. In addition, when making your own data set, do you need to do the mat file of selective search of the data set by yourself?