欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 财经 > 创投人物 > 连续预测、

连续预测、

2025/2/6 18:52:26 来源:https://blog.csdn.net/hi_88liuyu/article/details/145423123  浏览:    关键词:连续预测、

一、连续预测

调用模型遍历需要预测文件夹中的图片:

image_ids = open(‘VOCdevkit/VOC2007/ImageSets/Main/test.txt’).read().strip().split()

for image_id in tqdm(image_ids): # 遍历测试图像
image_path = “./VOCdevkit/VOC2007/JPEGImages/” + image_id + “.jpg” # 原图像的存储路径
try:
image = Image.open(image_path)
except:
print(‘Open Error! Try again!’)
continue
else:
r_image = ssd.detect_image(image) # 使用网络进行预测
image_results_path = “./image_results/” # 创建用于存放预测好的图像的文件夹
if not os.path.exists(image_results_path):
os.mkdir(image_results_path)
r_image.save(os.path.join(image_results_path, image_id+“.jpg”)) # 存储图像

使用项目:https://gitcode.com/LLL58/SSDPytorch

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com