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 video recognition #256

Merged
merged 32 commits into from
Jan 10, 2023
Merged

Conversation

haiasd
Copy link
Collaborator

@haiasd haiasd commented Dec 8, 2022

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.

Modification

Please briefly describe what modification is made in this PR.

Backward-Compatibility-Breaking (Optional)

Does the modification introduce changes that break the backward-compatibility? If so, please describe how it breaks the compatibility in 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.

Pull-Request Todo List

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. The documentation has been modified accordingly, like docstring or example tutorials.

@haiasd haiasd changed the title [WIP] add video recognition add video recognition Jan 4, 2023
@@ -0,0 +1,173 @@
_base_ = '../../base.py'
Copy link
Collaborator

Choose a reason for hiding this comment

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

clipbert.py的配置看起来也是multilabel? 两个配置文件的具体区别是?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

clipbert中的multi_class参数没有用到,默认是false,已改成fasle

@@ -0,0 +1,146 @@
_base_ = '../../base.py'
Copy link
Collaborator

Choose a reason for hiding this comment

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

这三个video_swin的配置,通用部分可以复用,基于其中一个配置改写,同下面的x3d配置

@@ -147,4 +147,97 @@ def _evaluate_impl(self, predictions, gt_labels):
return eval_res


@EVALUATORS.register_module
class MultiClsEvaluator(Evaluator):
Copy link
Collaborator

Choose a reason for hiding this comment

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

MultiCls 怎么理解?multi label?命名改下吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

target.shape, 'pred and target should be in the same shape.'
num_classes = pred.shape[1]
ap = np.zeros(num_classes)
f = open('res.txt', 'w')
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个文件是否有必要保存,应该保存在哪里?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已删除

for line in fin:
line_split = line.strip().split(self.split)
if self.multi_class:
assert self.num_classes is not None
Copy link
Collaborator

Choose a reason for hiding this comment

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

label支持下string类型,num_classes是否可以从ann_file中获取而不需要用户填写

return repr_str


def to_tensor(data):
Copy link
Collaborator

Choose a reason for hiding this comment

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

接口已存在:easycv/datasets/shared/pipelines/format.py

idx, traceback.format_exc()))
data_dict = None
if data_dict is None:
return self.__getitem__(np.random.randint(self.__len__()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

return self[np.random.randint(len(self))]

@@ -0,0 +1,582 @@
# flake8: noqa
Copy link
Collaborator

Choose a reason for hiding this comment

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

加一下引用的lincense

@@ -0,0 +1,732 @@
from functools import lru_cache, reduce
Copy link
Collaborator

Choose a reason for hiding this comment

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

加一下引用的license

@@ -0,0 +1,333 @@
import math
Copy link
Collaborator

Choose a reason for hiding this comment

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

添加引用license

@haiasd haiasd merged commit 8379127 into alibaba:master Jan 10, 2023
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.

2 participants