-
Notifications
You must be signed in to change notification settings - Fork 49
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 ActivityNetMeanAR #84
base: main
Are you sure you want to change the base?
Conversation
Is this PR ready for review, or still WIP? ^_^ |
@C1rN09 Hi, it is ready |
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.
There should be 2 additional modifications:
- Add unit tests for this metric. NOTE that 2 basic use cases should be covered: (1) stateless call, i.e. directly use metric's
__call__
method to obtain result. (2) statefull call, i.e. callmetric.add
multiple (>=2) times and thenmetric.compute
- Add api docs in
metrics.rst
@C1rN09 Not sure why the link failed, could you have a look? |
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.
LGTM. There should be a PR in mmaction2
to check the accuracy of this implementation.
logger = logging.getLogger(__name__) | ||
|
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.
Since PR #102, logger
has became an argument in BaseMetric
, so other metrics no longer need to define logger
themselves.
t_iou (np.ndarray): 1-dim array [n] / | ||
2-dim array [n x m] with IoU ratio. |
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.
t_iou (np.ndarray): 1-dim array [n] / | |
2-dim array [n x m] with IoU ratio. | |
t_iou (np.ndarray): 1-dim array [n] / | |
2-dim array [n x m] with IoU ratio. |
if target_segments.ndim != 2: | ||
raise ValueError('Dimension of target segments is incorrect') | ||
if candidate_segments_ndim not in [1, 2]: | ||
raise ValueError('Dimension of candidate segments is incorrect') |
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 target_segments.ndim != 2: | |
raise ValueError('Dimension of target segments is incorrect') | |
if candidate_segments_ndim not in [1, 2]: | |
raise ValueError('Dimension of candidate segments is incorrect') | |
if target_segments.ndim != 2: | |
raise ValueError(f'Dimension of target segments is incorrect. Expected 2, got {target_segments.ndim}') | |
if candidate_segments_ndim not in [1, 2]: | |
raise ValueError(f'Dimension of candidate segments is incorrect. Expected 1 or 2, got {target_segments.ndim}') |
if this_video_proposals.ndim != 2: | ||
this_video_proposals = np.expand_dims(this_video_proposals, axis=0) | ||
if this_video_ground_truth.ndim != 2: | ||
this_video_ground_truth = np.expand_dims( | ||
this_video_ground_truth, axis=0) |
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.
When will these 2 if-statements be True? There has been
this_video_proposals = proposals_video_id[:, :2]
and
this_video_ground_truth = ground_truth_video_id[:, :2].astype(np.float32)
before.
WIP