download_pretrain_weights.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # coding: utf8
  2. # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. import sys
  16. import os
  17. LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
  18. import paddlex as pdx
  19. import paddlehub as hub
  20. model_urls = {
  21. "PaddleX_HumanSeg_Server_Params":
  22. "https://bj.bcebos.com/paddlex/models/humanseg/humanseg_server_params.tar",
  23. "PaddleX_HumanSeg_Server_Inference":
  24. "https://bj.bcebos.com/paddlex/models/humanseg/humanseg_server_inference.tar",
  25. "PaddleX_HumanSeg_Mobile_Params":
  26. "https://bj.bcebos.com/paddlex/models/humanseg/humanseg_mobile_params.tar",
  27. "PaddleX_HumanSeg_Mobile_Inference":
  28. "https://bj.bcebos.com/paddlex/models/humanseg/humanseg_mobile_inference.tar",
  29. "PaddleX_HumanSeg_Mobile_Quant":
  30. "https://bj.bcebos.com/paddlex/models/humanseg/humanseg_mobile_quant.tar"
  31. }
  32. if __name__ == "__main__":
  33. for model_name, url in model_urls.items():
  34. pdx.utils.download_and_decompress(url=url, path=LOCAL_PATH)
  35. print("Pretrained Model download success!")