I have tried several solutions but all tend to just pull either numbers or grey and black. This is one of the solutions I have tried. Here is the second set
# Test image Directory
image_dir = 'C:/Users/tbrau/Documents/SeniorProject/TensorFlow/workspace/training_demo-
/images/test/LeafType1Test'
elapsed = []
for i in range(5):
image_path = os.path.join(image_dir, 'out' + str(i + 1) + '.jpg')
image_np = load_image_into_numpy_array(image_path)
input_tensor = np.expand_dims(image_np, 0)
start_time = time.time()
detections = detect_fn(input_tensor)
end_time = time.time()
elapsed.append(end_time - start_time)
plt.rcParams['figure.figsize'] = [100, 100]
label_id_offset = 1
image_np_with_detections = image_np.copy()
viz_utils.visualize_boxes_and_labels_on_image_array(
image_np_with_detections,
detections['detection_boxes'][0].numpy(),
detections['detection_classes'][0].numpy().astype(np.int32),
detections['detection_scores'][0].numpy(),
category_index,
use_normalized_coordinates=True,
max_boxes_to_draw=200,
min_score_thresh=.40,
agnostic_mode=False)
plt.imsave(str(i) + '.jpg', image_np_with_detections)
plt.subplot(5, 1, i+1)
plt.imshow(image_np_with_detections)
plt.savefig('LeafType1.jpg')
mean_elapsed = sum(elapsed) / float(len(elapsed))
print('Elapsed time: ' + str(mean_elapsed) + ' second per image')