cls.py 1.0 KB

12345678910111213141516171819202122232425262728
  1. # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from paddlex.cv.transforms import cls_transforms
  15. message = 'Your running script needs PaddleX<2.0.0, please refer to {} to solve this issue.'.format(
  16. 'https://github.com/PaddlePaddle/PaddleX/tree/release/2.0-rc/tutorials/train#%E7%89%88%E6%9C%AC%E5%8D%87%E7%BA%A7'
  17. )
  18. def __getattr__(attr):
  19. if attr == 'transforms':
  20. print("\033[1;31;40m{}\033[0m".format(message).encode("utf-8")
  21. .decode("latin1"))
  22. transforms = cls_transforms