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

One class testing #18

Open
Ostyk opened this issue Mar 23, 2021 · 0 comments
Open

One class testing #18

Ostyk opened this issue Mar 23, 2021 · 0 comments

Comments

@Ostyk
Copy link

Ostyk commented Mar 23, 2021

Hi,

I trained a model on a single class (human heads-for object detection), and now when running the testing script I'm having problems with filtering boxes.

The log attached below narrows down the problem to: this line where the region scores are gathered. However, I think it's because of the way sigmoid is used to obtain them in the first place, which works well for many classes but in my one-class detection, it fails .

Do you have any advice on this matter?

Log below:

Traceback (most recent call last):
File "test.py", line 105, in
test(testing_db, args.cfg_file, args.split, args.testiter, args.debug, args.no_flip, args.suffix)
File "test.py", line 67, in test
testing(db, cfg_file , nnet, result_dir, debug=debug, no_flip = no_flip)
File "/home/ubuntu/CPNDet/code/test/coco.py", line 342, in testing
return globals()[system_configs.sampling_function](db, cfg_file, nnet, result_dir, debug=debug, no_flip=no_flip)
File "/home/ubuntu/CPNDet/code/test/coco.py", line 238, in kp_detection
dets = decode_func(nnet, images, K, no_flip, ae_threshold=ae_threshold, kernel=nms_kernel, image_idx = image_idx)
File "/home/ubuntu/CPNDet/code/test/coco.py", line 62, in kp_decode
detections = nnet.test([images], ae_threshold=ae_threshold, K=K, no_flip = no_flip, kernel=kernel, image_idx = image_idx)
File "/home/ubuntu/CPNDet/code/nnet/py_factory.py", line 115, in test
return self.model(*xs, **kwargs)
File "/home/ubuntu/CPNDet/env/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/ubuntu/CPNDet/code/nnet/py_factory.py", line 33, in forward
return self.module(*xs, **kwargs)
File "/home/ubuntu/CPNDet/env/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/ubuntu/CPNDet/code/models/py_utils/HG52.py", line 452, in forward
return self._test(*xs, **kwargs)
File "/home/ubuntu/CPNDet/code/models/py_utils/HG52.py", line 433, in _test
_filter_bboxes(ht_boxes, tl_clses, region_scores, grouping_scores, self.gr_threshold)
File "/home/ubuntu/CPNDet/code/models/py_utils/kp_utils.py", line 159, in _filter_bboxes
specific_rscores = region_scores.gather(1, ppos_ht_score_cls[:,1].long()).squeeze()
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

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

1 participant