文章目录[隐藏]
SimHei.ttf文件,请自行下载?
1 代码
import numpy as np
from PIL import Image, ImageFont, ImageDraw
import colorsys
import matplotlib.pyplot as plt
def DisplayDetectResult(img_path, out_classes, out_box, out_confidence):
# Generate colors for drawing bounding boxes.
hsv_tuples = [(x / len(out_classes), 1., 1.)
for x in range(len(out_classes))]
colors = list(map(lambda x: colorsys.hsv_to_rgb(*x), hsv_tuples))
colors = list(map(lambda x: (int(x[0] * 255), int(x[1] * 255), int(x[2] * 255)), colors))
image = Image.open(img_path)
fontStyle =
版权声明:本文为CSDN博主「Jackilina_Stone」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wss794/article/details/122750991
暂无评论