-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
985a4f3
commit b291a1c
Showing
4 changed files
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
from torch import Tensor | ||
|
||
from mmdeploy.core import FUNCTION_REWRITER | ||
|
||
|
||
@FUNCTION_REWRITER.register_rewriter( | ||
'mmdet3d.models.detectors.single_stage_mono3d.' | ||
'SingleStageMono3DDetector.forward') | ||
def singlestagemono3ddetector__forward(self, inputs: list, **kwargs): | ||
"""Rewrite this func to r. | ||
def singlestagemono3ddetector__forward(self, inputs: Tensor, **kwargs): | ||
"""Rewrite to support feed inputs of Tensor type. | ||
Args: | ||
inputs (dict): Input dict comprises `imgs` | ||
inputs (Tensor): Input image | ||
Returns: | ||
list: two torch.Tensor | ||
""" | ||
x = self.extract_feat(inputs) | ||
|
||
x = self.extract_feat({'imgs': inputs}) | ||
results = self.bbox_head.forward(x) | ||
return results[0], results[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters