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

[Fix] Fix bugs in RandomConcatDataset, SeqCropLikeStark and TridentSampling #438

Merged
merged 5 commits into from
Feb 23, 2022

Conversation

JingweiZhang12
Copy link
Collaborator

No description provided.

Comment on lines 36 to 41
self.CLASSES = datasets[0].CLASSES
if hasattr(datasets[0], 'flag'):
flags = []
for i in range(0, len(datasets)):
flags.append(datasets[i].flag)
self.flag = np.concatenate(flags)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why add flag attribute?

Copy link
Collaborator Author

@JingweiZhang12 JingweiZhang12 Feb 23, 2022

Choose a reason for hiding this comment

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

the isinstance(dataset, BaseSOTDataset) in build_dataloader need it. The RandomSampleConcatDataset is not an instance of BaseSOTDataset. It will go into other case which needs flag.
I have tried an alternative.

extra_template_index = self.random_sample_inds(
video_visibility,
num_samples=1,
frame_range=[min_ind, max_ind],
allow_invisible=True)[0]
allow_invisible=False)[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why change like this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the bboxes of invisible object are invalid, and it will cause interruptions in the pipeline.

@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #438 (a698d58) into master (1074066) will increase coverage by 0.16%.
The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #438      +/-   ##
==========================================
+ Coverage   71.03%   71.20%   +0.16%     
==========================================
  Files         119      119              
  Lines        6747     6748       +1     
  Branches     1295     1294       -1     
==========================================
+ Hits         4793     4805      +12     
+ Misses       1558     1548      -10     
+ Partials      396      395       -1     
Flag Coverage Δ
unittests 71.11% <42.85%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmtrack/datasets/pipelines/processing.py 80.17% <ø> (+5.17%) ⬆️
mmtrack/datasets/builder.py 32.65% <20.00%> (+2.04%) ⬆️
mmtrack/datasets/dataset_wrappers.py 86.95% <100.00%> (+0.59%) ⬆️
mmtrack/datasets/pipelines/transforms.py 88.07% <100.00%> (-0.23%) ⬇️
mmtrack/datasets/sot_train_dataset.py 81.81% <0.00%> (-1.02%) ⬇️
mmtrack/models/sot/siamrpn.py 81.56% <0.00%> (+1.11%) ⬆️
mmtrack/models/trackers/base_tracker.py 86.25% <0.00%> (+1.52%) ⬆️
mmtrack/models/reid/base_reid.py 86.95% <0.00%> (+8.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1074066...a698d58. Read the comment docs.

@@ -56,10 +57,13 @@ def build_dataloader(dataset,
DataLoader: A PyTorch dataloader.
"""
rank, world_size = get_dist_info()
is_sotdataset = isinstance(dataset, BaseSOTDataset) or (
isinstance(dataset, ConcatDataset)
and isinstance(dataset.datasets[0], BaseSOTDataset))
Copy link
Collaborator

Choose a reason for hiding this comment

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

add comments for isinstance(dataset, ConcatDataset) and isinstance(dataset.datasets[0], BaseSOTDataset)

@@ -32,6 +32,8 @@ def __init__(self, dataset_cfgs, dataset_sampling_weights=None):
]

datasets = [build_dataset(cfg) for cfg in dataset_cfgs]
self.CLASSES = datasets[0].CLASSES
Copy link
Collaborator

Choose a reason for hiding this comment

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

add comments that why we need CLASSES

@GT9505 GT9505 merged commit 297c106 into open-mmlab:master Feb 23, 2022
@JingweiZhang12 JingweiZhang12 deleted the fix_randomcat branch October 13, 2022 11:49
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

2 participants