-
Notifications
You must be signed in to change notification settings - Fork 597
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
[Feature] Support loading data from Ceph in SOT dataset class #494
Conversation
I'll verify loading text-format information files from Ceph in training and test later. |
Codecov Report
@@ Coverage Diff @@
## master #494 +/- ##
==========================================
+ Coverage 73.15% 73.19% +0.03%
==========================================
Files 126 126
Lines 7306 7361 +55
Branches 1378 1379 +1
==========================================
+ Hits 5345 5388 +43
- Misses 1536 1545 +9
- Partials 425 428 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 make sure that we support both diskbackend
and petrelbackend
in SOT dataset
mmtrack/datasets/got10k_dataset.py
Outdated
data_infos_str = self.file_client.get_text( | ||
self.ann_file).strip().split('\n') |
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.
Can we use the self.loadtxt()
API?
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.
I don't use self.loadtxt()
API for the efficiency.
self.loadtxt()
is fit for the load of the whole txt files in the NumPy format.
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.
I have readjusted it.
I have verified loading from Ceph for all SOT datasets. It's OK. |
mmtrack/datasets/sot_coco_dataset.py
Outdated
if 'file_client_args' in kwargs and kwargs['file_client_args'][ | ||
'backend'] != 'disk': | ||
self.file_client = mmcv.FileClient(**kwargs['file_client_args']) | ||
with self.file_client.get_local_path(ann_file) as local_path: | ||
self.coco = COCO(local_path) | ||
else: | ||
self.coco = COCO(ann_file) | ||
super().__init__(*args, **kwargs) |
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.
Too ugly here, we may only keep line 28-30?
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.
If only keep line 28-30, it will create a temporary file and read it even reading local files.
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.
I think it is acceptable. And mmdet also use the same way
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.
OK, I modify it right now.
with self.file_client.get_local_path(ann_file) as local_path: | ||
self.coco = CocoVID(local_path) | ||
else: | ||
self.coco = CocoVID(ann_file) |
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.
same here
Modification
This PR mainly contains the following:
Use cases (Optional)
If you want to load data from Ceph in SOT, you should modify your configs like the following: