download_pretrain_weights.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # coding: utf8
  2. # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
  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. TEST_PATH = os.path.join(LOCAL_PATH, "../../../", "test")
  19. sys.path.append(TEST_PATH)
  20. import paddlex as pdx
  21. model_urls = {
  22. "humanseg_server_ckpt":
  23. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_server_ckpt.zip",
  24. "humanseg_server_inference":
  25. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_server_inference.zip",
  26. "humanseg_mobile_ckpt":
  27. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_mobile_ckpt.zip",
  28. "humanseg_mobile_inference":
  29. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_mobile_inference.zip",
  30. "humanseg_mobile_quant":
  31. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_mobile_quant.zip",
  32. "humanseg_lite_ckpt":
  33. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_lite_ckpt.zip",
  34. "humanseg_lite_inference":
  35. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_lite_inference.zip",
  36. "humanseg_lite_quant":
  37. "https://paddleseg.bj.bcebos.com/humanseg/models/humanseg_lite_quant.zip",
  38. }
  39. if __name__ == "__main__":
  40. for model_name, url in model_urls.items():
  41. pdx.utils.download_and_decompress(url=url, path=LOCAL_PATH)
  42. print("Pretrained Model download success!")