目录
yolov8 转华为昇腾 om脚本 测试ok
import sys
import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
import torch
current_dir = os.path.dirname(os.path.abspath(__file__))
paths = [os.path.abspath(__file__).split('scripts')[0]]
print('current_dir',current_dir)
paths.append(os.path.abspath(os.path.join(current_dir, 'src')))
for path in paths:
sys.path.insert(0, path)
os.environ['PYTHONPATH'] = (os.environ.get('PYTHONPATH', '') + ':' + path).strip(':')
from ultralytics import YOLO
if __name__ == '__ma
标签:__,om,abspath,yolov8,current,华为,import,path,os
From: https://blog.csdn.net/jacke121/article/details/144360385