TFOD:基于TFOD API的官方模型案例对图片进行目标检测
目录
输出结果
设计思路
代码(部分)实例
#1、导入基本的包和环境,包括两个TFOD中的包
import numpy as np
import os
import six.moves.urllib as urllib
import sys
……
if StrictVersion(tf.__version__) < StrictVersion('1.9.0'):
raise ImportError('Please upgrade your TensorFlow installation to v1.9.* or later!')
for image_path in TEST_IMAGE_PATHS:
image = Image.open(image_path)
……
category_index,
instance_masks=output_dict.get('detection_masks'),
use_normalized_coordinates=True,
line_thickness=8)
plt.figure(figsize=IMAGE_SIZE)
plt.title('TFOD API Official Case Tutorial——Jason Niu')
plt.imshow(image_np)