提交 25474fec 编写于 作者: C channingss

update export_model.py

上级 cbac164a
......@@ -11,22 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import paddlehub as hub
# Load mask detector module from PaddleHub
module = hub.Module(name="pyramidbox_lite_server_mask", version='1.1.0')
# Export inference model for deployment
module.processor.save_inference_model("./pyramidbox_lite_server_mask")
# rename of params
classify_param = "./pyramidbox_lite_server_mask/pyramidbox_lite/__param__"
detection_param = "./pyramidbox_lite_server_mask/mask_detector/__param__"
if os.path.isfile(detection_param):
os.system("mv " + detection_param +
" ./pyramidbox_lite_server_mask/mask_detector/__params__")
if os.path.isfile(classify_param):
os.system("mv " + classify_param +
" ./pyramidbox_lite_server_mask/pyramidbox_lite/__params__")
print("pyramidbox_lite_server_mask module export done!")
# Load mask detector (mobile version) module from PaddleHub
......@@ -34,13 +24,4 @@ module = hub.Module(name="pyramidbox_lite_mobile_mask", version="1.1.0")
# Export inference model for deployment
module.processor.save_inference_model("./pyramidbox_lite_mobile_mask")
# rename of params
classify_param = "./pyramidbox_lite_mobile_mask/pyramidbox_lite/__param__"
detection_param = "./pyramidbox_lite_mobile_mask/mask_detector/__param__"
if os.path.isfile(detection_param):
os.system("mv " + detection_param +
" ./pyramidbox_lite_mobile_mask/mask_detector/__params__")
if os.path.isfile(classify_param):
os.system("mv " + classify_param +
" ./pyramidbox_lite_mobile_mask/pyramidbox_lite/__params__")
print("pyramidbox_lite_mobile_mask module export done!")
......@@ -11,22 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import paddlehub as hub
# Load mask detector module from PaddleHub
module = hub.Module(name="pyramidbox_lite_server_mask", version='1.1.0')
# Export inference model for deployment
module.processor.save_inference_model("./pyramidbox_lite_server_mask")
# rename of params
classify_param = "./pyramidbox_lite_server_mask/pyramidbox_lite/__param__"
detection_param = "./pyramidbox_lite_server_mask/mask_detector/__param__"
if os.path.isfile(detection_param):
os.system("mv " + detection_param +
" ./pyramidbox_lite_server_mask/mask_detector/__params__")
if os.path.isfile(classify_param):
os.system("mv " + classify_param +
" ./pyramidbox_lite_server_mask/pyramidbox_lite/__params__")
print("pyramidbox_lite_server_mask module export done!")
# Load mask detector (mobile version) module from PaddleHub
......@@ -34,13 +24,4 @@ module = hub.Module(name="pyramidbox_lite_mobile_mask", version="1.1.0")
# Export inference model for deployment
module.processor.save_inference_model("./pyramidbox_lite_mobile_mask")
# rename of params
classify_param = "./pyramidbox_lite_mobile_mask/pyramidbox_lite/__param__"
detection_param = "./pyramidbox_lite_mobile_mask/mask_detector/__param__"
if os.path.isfile(detection_param):
os.system("mv " + detection_param +
" ./pyramidbox_lite_mobile_mask/mask_detector/__params__")
if os.path.isfile(classify_param):
os.system("mv " + classify_param +
" ./pyramidbox_lite_mobile_mask/pyramidbox_lite/__params__")
print("pyramidbox_lite_mobile_mask module export done!")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册