#def download(url) -> np.array:
def download(url):
while True:
res = requests.get(url).content
return cv2.imdecode(np.fromstring(res, np.uint8), cv2.IMREAD_COLOR).tolist() # bgr
def compute_distance(a, b):
return np.dot(a, b.T) / (np.linalg.norm(a) * np.linalg.norm(b))
标签:linalg,url,res,download,np,工具,def From: https://www.cnblogs.com/owlowl/p/17210776.html