We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我这边测试了不同的图片,生成的特征码一样,导致搜索结果完成不对。。
The text was updated successfully, but these errors were encountered:
我知道了,问题出在这里,如果url后面的图片文件名相同,不管路径如何,都会认为是相同的
img_path = os.path.join(upload_path, os.path.basename(url))
def down_image(base64_image, url, upload_path): """ 将图片下载获取本地地址 :param base64_image: base64 image 不包含头信息 :param url: https: :param upload_path: 上传地址目录 :return: """ if base64_image is not None: if base64_image.startswith("data"): raise Exception('需要去掉头部如 data:image/jpg;base64,') img_path = os.path.join(upload_path, uuid.uuid4().__str__()) with open(img_path, "wb+") as f: f.write(urlsafe_b64decode(base64_image)) elif url is not None: img_path = os.path.join(upload_path, os.path.basename(url)) if not os.path.exists(img_path): img_path = os.path.join(upload_path, os.path.basename(url)) urlretrieve(url, img_path) else: raise Exception('Image and url are required') # 图片去除背景,将图片变成固定尺寸 image_url_r = img_path+"_r" resize_image(img_path,image_url_r,448,448) # os.remove(img_path) return image_url_r
Sorry, something went wrong.
No branches or pull requests
我这边测试了不同的图片,生成的特征码一样,导致搜索结果完成不对。。
The text was updated successfully, but these errors were encountered: