-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Label visualization #1050
Label visualization #1050
Conversation
since I'm trying pre-commit, please wait a while.. |
else: | ||
palette = np.random.randint( | ||
0, 255, size=(pred_labels.max() + 1, 3)) / 256 | ||
S = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S -> str_labels
S[i].append(pred_bboxes[j]) | ||
for i in S: | ||
vis.add_bboxes( | ||
bbox3d=np.array(S[i]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little bit confused with S. If it is from label, why it is passed to bbox3d?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S is a dictionary, which key is lable and value is list of bounding boxes corresponding to label.
Since I've revised a scripts, please check again.
mmdet3d/models/detectors/base.py
Outdated
@@ -60,7 +60,7 @@ def forward(self, return_loss=True, **kwargs): | |||
else: | |||
return self.forward_test(**kwargs) | |||
|
|||
def show_results(self, data, result, out_dir): | |||
def show_results(self, data, result, out_dir, show=False, score_thr=0.3): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update docstring for show
and score_thr
. Besides, please kindly explain why set the default value of score_thr
to 0.3. Or why not just set score_dir
to -1
or None
to show all results by default for bc-breaking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to avoid BC-breaking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value 0.3
of score_thr
is from mmdetection3d\mmdet3d\apis\test.py\single_gpu_test
's default parameter show_score_thr
. I've revised score_thr of detectors/base.py default value to None.
@@ -89,6 +90,7 @@ def show_result(points, | |||
filename (str): Filename of the current frame. | |||
show (bool): Visualize the results online. Defaults to False. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the docstring for show
, snapshot
, and pred_labels
with optional
sign after the variable type.
For example:
show (bool, optional): ... ...
.
@@ -178,7 +178,7 @@ def aug_test(self, imgs, img_metas, rescale=False): | |||
|
|||
return [bbox_list] | |||
|
|||
def show_results(self, data, result, out_dir): | |||
def show_results(self, data, result, out_dir, show=False, score_thr=None): | |||
"""Results visualization. | |||
|
|||
Args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the docstring here for show
and score_thr
.
ignore_index=None): | ||
ignore_index=None, | ||
show=False, | ||
score_thr=None): | ||
"""Results visualization. | ||
|
||
Args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the docstring here for show
and score_thr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated all docstring.
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Please describe the motivation of this PR and the goal you want to achieve through this PR.
At first, I wanted to visualize result of object detection for group free 3d(including colorization for label)
After I knew there's somewhat problem in overall mmdetection3d visualization process, I fixed some
Modification
Please briefly describe what modification is made in this PR.
Added
show
,score_thr
argument tommdet3d/apis/test.py/single_gpu_test
, and basic 3 model of mmdetection3dAdded colorization for lable on show_result function
Since I only know a little about detector model among basic 3 model, I simply added
show
andscore_thr
and didn't usedscore_thr
argument except detector base model(I've fully implementedshow
,score_thr
only on detector base model). I expect someone else implement feature about this.BC-breaking (Optional)
Does the modification introduce changes that break the back-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
You can see colorized(depend on label) when execute test.py with
--show
optionExample)
python tools/test.py configs/groupfree3d/groupfree3d_8x4_scannet-3d-18class-w2x-L12-O512.py \ checkpoints/groupfree3d_8x4_scannet-3d-18class-w2x-L12-O512_20210702_220204-187b71c7.pth \ --show --show-dir ./data/scannet/show_results
Also I removed bounding boxes with low confidence, using
score_thr
Checklist