代码拉取完成,页面将自动刷新
#! /usr/bin/env python
# coding=utf-8
#================================================================
# Copyright (C) 2019 * Ltd. All rights reserved.
#
# Editor : VIM
# File name : show_image.py
# Author : YunYang1994
# Created date: 2019-07-13 09:12:53
# Description :
#
#================================================================
import cv2
import numpy as np
from PIL import Image
ID = 0
label_txt = "./yymnist/labels.txt"
image_info = open(label_txt).readlines()[ID].split()
image_path = image_info[0]
image = cv2.imread(image_path)
for bbox in image_info[1:]:
bbox = bbox.split(",")
image = cv2.rectangle(image,(int(float(bbox[0])),
int(float(bbox[1]))),
(int(float(bbox[2])),
int(float(bbox[3]))), (255,0,0), 2)
image = Image.fromarray(np.uint8(image))
image.show()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。