apple music报错,apple music错误代码20
在执行YOLOv3_TensorFlow-master测试,出现如下告警,查出现此处错误的脚本的代码(plot_utils.py),如下:
cv2 .LINE_AA "模块"对象没有属性" LINE_AA "
发现的问题根源是:
cv2 .__版本_ _
发现是2.4的版本,只有3才有LINE_AA
解决方法1:
把LINE_AA替换为CV_AA
解决方法2:
更新opencv-python,linux平台上执行:sudo pip install -Uopencv-python
#编码:utf-8 from _ _ future _ _ import division,print _ function import cv2 import random def get _ color _ table(class _ num,seed=2):random。seed(种子)color _ table={ } for I in range(class _ num):color _ table[I]=[random。randint(0,255)for _ in range(3)]return color _ tabledef plot _ one _ box(img,coord,label=None,color=None,line _ thickness=None): coord:[x _ minimg:要绘制的img .标签:str .标签名称。颜色:int .颜色指数。线条粗细:整数。矩形线条粗细 tl=线条粗细或int(round(0.002 * max(img。shape[0:2])#线条粗细color=color或[random.randint(0,255) for _ in range(3)] c1,c2=(int(coord[0]),int(coord[1])),(int(coord[2])),int(coord[3]))cv2。矩形(img,c1,c2,color,thickness=tl)如果标签:tf=max(tlLINE_AA)