You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

local_adapter.py 1.0 kB

3 years ago
123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright 2021 Huawei Technologies Co., Ltd
  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. # ============================================================================
  15. """Local adapter"""
  16. import os
  17. def get_device_id():
  18. device_id = os.getenv('DEVICE_ID', '0')
  19. return int(device_id)
  20. def get_device_num():
  21. device_num = os.getenv('RANK_SIZE', '1')
  22. return int(device_num)
  23. def get_rank_id():
  24. global_rank_id = os.getenv('RANK_ID', '0')
  25. return int(global_rank_id)
  26. def get_job_id():
  27. return "Local Job"

随着人工智能和大数据的发展,任一方面对自动化工具有着一定的需求,在当下疫情防控期间,使用mindspore来实现yolo模型来进行目标检测及语义分割,对视频或图片都可以进行口罩佩戴检测和行人社交距离检测,来对公共场所的疫情防控来实行自动化管理。