Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 368b32d

Browse files
replaced elif with else. added missing imports
1 parent b481adc commit 368b32d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎detect_from_image.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
import argparse
33
import os
44
import tensorflow as tf
5-
import matplotlib.pyplot as plt
5+
from PIL import Image
6+
from io import BytesIO
67
import pathlib
8+
import glob
9+
import matplotlib.pyplot as plt
710

811
from object_detection.utils import ops as utils_ops
912
from object_detection.utils import label_map_util
@@ -21,7 +24,6 @@ def load_model(model_path):
2124
return model
2225

2326

24-
2527
def load_image_into_numpy_array(path):
2628
"""Load an image from file into a numpy array.
2729
@@ -96,7 +98,7 @@ def run_inference(model, category_index, image_path):
9698
line_thickness=8)
9799
plt.imshow(image_np)
98100
plt.show()
99-
elif
101+
else:
100102
image_np = load_image_into_numpy_array(image_path)
101103
# Actual detection.
102104
output_dict = run_inference_for_single_image(model, image_np)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /