|
@@ -62,6 +62,12 @@ public:
|
|
|
return instance_->forward(cvimg(image));
|
|
|
}
|
|
|
|
|
|
+ resnet::Attribute forward_path(const std::string& image_path)
|
|
|
+ {
|
|
|
+ cv::Mat image = cv::imread(image_path);
|
|
|
+ return instance_->forward(cvimg(image));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
bool valid(){
|
|
|
return instance_ != nullptr;
|
|
@@ -86,6 +92,7 @@ PYBIND11_MODULE(trtresnet, m){
|
|
|
py::class_<TrtResnetInfer>(m, "TrtResnetInfer")
|
|
|
.def(py::init<string>(), py::arg("model_path"))
|
|
|
.def_property_readonly("valid", &TrtResnetInfer::valid)
|
|
|
+ .def("forward_path", &TrtResnetInfer::forward_path, py::arg("image_path"))
|
|
|
.def("forward", &TrtResnetInfer::forward, py::arg("image"));
|
|
|
};
|
|
|
|