|
Safemotion Lib
|
Public Member Functions | |
| __init__ (self, cfg) | |
| __call__ (self, image) | |
Public Attributes | |
| cfg | |
| model | |
Create a simple end-to-end predictor with the given config.
The predictor takes an BGR image, resizes it to the specified resolution,
runs the model and produces a dict of predictions.
This predictor takes care of model loading and input preprocessing for you.
If you'd like to do anything more fancy, please refer to its source code
as examples to build and use the model manually.
Attributes:
Examples:
.. code-block:: python
pred = DefaultPredictor(cfg)
inputs = cv2.imread("input.jpg")
outputs = pred(inputs)
Definition at line 126 of file defaults.py.
| fastreid.engine.defaults.DefaultPredictor.__init__ | ( | self, | |
| cfg ) |
Definition at line 142 of file defaults.py.
| fastreid.engine.defaults.DefaultPredictor.__call__ | ( | self, | |
| image ) |
Args:
image (torch.tensor): an image tensor of shape (B, C, H, W).
Returns:
predictions (torch.tensor): the output features of the model
Definition at line 151 of file defaults.py.
| fastreid.engine.defaults.DefaultPredictor.cfg |
Definition at line 143 of file defaults.py.
| fastreid.engine.defaults.DefaultPredictor.model |
Definition at line 146 of file defaults.py.