mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
fix some errors (#1309)
This commit is contained in:
parent
d8e6229dc5
commit
940fffa075
@ -81,9 +81,7 @@ static PythonBindingRegisterer register_video_recognizer{[](py::module& m) {
|
|||||||
py::arg("model_path"), py::arg("device_name"), py::arg("device_id") = 0)
|
py::arg("model_path"), py::arg("device_name"), py::arg("device_id") = 0)
|
||||||
.def("__call__",
|
.def("__call__",
|
||||||
[](PyVideoRecognizer* self, const std::vector<PyImage>& imgs,
|
[](PyVideoRecognizer* self, const std::vector<PyImage>& imgs,
|
||||||
const std::pair<int, int>& info) {
|
const std::pair<int, int>& info) { return self->Apply({imgs}, {info})[0]; })
|
||||||
return self->Apply(std::vector{imgs}, std::vector{info})[0];
|
|
||||||
})
|
|
||||||
.def("batch", &PyVideoRecognizer::Apply);
|
.def("batch", &PyVideoRecognizer::Apply);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
@ -126,7 +126,6 @@ deploy_cfg = 'configs/mmaction/video-recognition/video-recognition_2d_onnxruntim
|
|||||||
model_cfg = 'tsn_r50_1x1x3_100e_kinetics400_rgb.py'
|
model_cfg = 'tsn_r50_1x1x3_100e_kinetics400_rgb.py'
|
||||||
device = 'cpu'
|
device = 'cpu'
|
||||||
backend_model = ['./mmdeploy_models/mmaction2/tsn/ort/end2end.onnx']
|
backend_model = ['./mmdeploy_models/mmaction2/tsn/ort/end2end.onnx']
|
||||||
backend_model = ['./work_dir/tsn/end2end.onnx']
|
|
||||||
image = 'tests/data/arm_wrestling.mp4'
|
image = 'tests/data/arm_wrestling.mp4'
|
||||||
|
|
||||||
# read deploy_cfg and model_cfg
|
# read deploy_cfg and model_cfg
|
||||||
|
@ -128,7 +128,6 @@ deploy_cfg = 'configs/mmaction/video-recognition/video-recognition_2d_onnxruntim
|
|||||||
model_cfg = 'tsn_r50_1x1x3_100e_kinetics400_rgb.py'
|
model_cfg = 'tsn_r50_1x1x3_100e_kinetics400_rgb.py'
|
||||||
device = 'cpu'
|
device = 'cpu'
|
||||||
backend_model = ['./mmdeploy_models/mmaction2/tsn/ort/end2end.onnx']
|
backend_model = ['./mmdeploy_models/mmaction2/tsn/ort/end2end.onnx']
|
||||||
backend_model = ['./work_dir/tsn/end2end.onnx']
|
|
||||||
image = 'tests/data/arm_wrestling.mp4'
|
image = 'tests/data/arm_wrestling.mp4'
|
||||||
|
|
||||||
# read deploy_cfg and model_cfg
|
# read deploy_cfg and model_cfg
|
||||||
|
@ -320,7 +320,7 @@ class VideoRecognition(BaseTask):
|
|||||||
if key in transforms2index:
|
if key in transforms2index:
|
||||||
index = transforms2index[key]
|
index = transforms2index[key]
|
||||||
if key == 'Normalize':
|
if key == 'Normalize':
|
||||||
pipeline[index]['to_bgr'] = True
|
pipeline[index]['to_rgb'] = True
|
||||||
if key == 'Resize' and 'scale' in pipeline[index]:
|
if key == 'Resize' and 'scale' in pipeline[index]:
|
||||||
value = pipeline[index].pop('scale')
|
value = pipeline[index].pop('scale')
|
||||||
if len(value) == 2 and value[0] == -1:
|
if len(value) == 2 and value[0] == -1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user