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

[add] ConcatDataset.evaluate feature #1932

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

17862923747
Copy link

Motivation

多数据集场景,val时会报错,因为您的ConcatDataset.evaluate没有实现

Modification

我补充了缺少的这部分代码:ConcatDataset.evaluate

BC-breaking (Optional)

可兼容已有代码和config

Use cases (Optional)

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@CLAassistant
Copy link

CLAassistant commented Jan 13, 2023

CLA assistant check
All committers have signed the CLA.

@ly015 ly015 requested review from ly015 and jin-s13 January 16, 2023 02:07
@ly015
Copy link
Member

ly015 commented Jan 16, 2023

@17862923747 Hi, thank you very much for your help! Could you please sign the CLA so we can accept your contribution? This PR will be reviewed asap.

Comment on lines +106 to +108
elif len(set([type(ds) for ds in self.datasets])) != 1:
raise NotImplementedError(
'All the datasets should have same types')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to perform this check if separate_eval=False is not supported?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实不需要,我从mmdet那拷的代码没看仔细 😄

dataset if `self.separate_eval=True`.
"""

new_results, res_len = self.rebuild_results(results)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain the reason for concatenating all elements into new_results rather than simply utilizing results?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

results是多个val数据集混在一起的,然后每batch_size个输出组成results中一个dict,我需要根据cumulative_sizes记录的索引分割不同val数据集对应的results,分别计算各自的evaluate,我觉得先合并成一个results,然后分割比较方便,不知道我的理解对不对

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢,我疑惑的点是有没有可能直接在 clip_by_index 函数里面利用 start_idxend_idxresults 中提取每个数据集对应的 predictions, 然后再 concat?这样子可以省去 rebuild_results 这个步骤

clip_res['preds'] = results[0]['preds'][start_idx:end_idx, :, :]
clip_res['boxes'] = results[0]['boxes'][start_idx:end_idx, :]
clip_res['image_paths'] = results[0]['image_paths'][start_idx:end_idx]
clip_res['bbox_ids'] = results[0]['bbox_ids'][start_idx:end_idx]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bottom-up models may not generate predictions with key bbox_ids, so a key check may be needed here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get

@Ben-Louis
Copy link
Collaborator

@17862923747 您好,请问您还有更新这个 PR 的计划吗?如果有任何困难,我们也可以帮助您一起完善这个 PR 的内容

@OpenMMLab-Assistant001
Copy link

Hi @17862923747 !We are grateful for your efforts in helping improve this open-source project during your personal time.

Welcome to join OpenMMLab Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA
If you have a WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)

Thank you again for your contribution❤

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

Successfully merging this pull request may close these issues.

None yet

6 participants