提交 abe1183d 编写于 作者: W wuzewu

Fix compatibility bug in ssd module demo

上级 e1873a73
...@@ -29,11 +29,12 @@ def draw_bounding_box_on_image(image_path, data_list, save_path): ...@@ -29,11 +29,12 @@ def draw_bounding_box_on_image(image_path, data_list, save_path):
if image.mode == 'RGB': if image.mode == 'RGB':
draw.text((left, top), data['label'], (255, 255, 0)) draw.text((left, top), data['label'], (255, 255, 0))
image_name = image_path.split('/')[-1] image_name = os.path.split(image_path)[-1]
if not os.path.exists(save_path): if not os.path.exists(save_path):
os.mkdir(save_path) os.mkdir(save_path)
save_path = os.path.join(save_path, image_name) save_path = os.path.join(save_path, image_name)
print("image with bbox drawed saved as {}".format(save_path)) print("image with bbox drawed saved as {}".format(
os.path.abspath(save_path)))
image.save(save_path) image.save(save_path)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册