-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
make hmdb train/val list generation more robust #811
Conversation
Codecov Report
@@ Coverage Diff @@
## master #811 +/- ##
==========================================
+ Coverage 84.88% 84.90% +0.02%
==========================================
Files 131 131
Lines 9394 9394
Branches 1605 1605
==========================================
+ Hits 7974 7976 +2
+ Misses 1013 1012 -1
+ Partials 407 406 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Perhaps I didn't get it. Why the old codes are less robust and how this PR is related to Issue #808. Can you add some explanation to help me understand it? |
@kennymckormick If 'data/hmdb51/annotations/classInd.txt' is generated once and mmaction2/tools/data/parse_file_list.py Lines 472 to 473 in 8972e53
which may cause the failure of generating |
if not osp.exists(class_index_file): | ||
with open(class_index_file, 'w') as f: | ||
content = [] | ||
for class_id, class_name in enumerate(class_list): | ||
# like `ClassInd.txt` in UCF-101, | ||
# the class_id begins with 1 | ||
class_dict[class_name] = class_id + 1 | ||
cur_line = ' '.join([str(class_id + 1), class_name]) | ||
content.append(cur_line) | ||
content = '\n'.join(content) | ||
f.write(content) | ||
else: | ||
print(f'{class_index_file} has been generated before.') | ||
class_dict = { | ||
class_name: class_id + 1 | ||
for class_id, class_name in enumerate(class_list) | ||
} |
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 can define class_dict first and once
class_dict = {
class_name: class_id + 1
for class_id, class_name in enumerate(class_list)
}
if not osp.exists(class_index_file):
...
else:
...
Maybe it's caused by other problems. We can keep the original issue #808 first |
got it |
No description provided.