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 83e07da

Browse files
Merge pull request #1 from AbhishekAshokDubey/camera_box_bug
updated L32 and L118
2 parents 22b757a + 4354375 commit 83e07da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎tflite_object_detection_with_webcam.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def draw_image(image, results, labels, size):
2929

3030
# Annotate image with label and confidence score
3131
display_str = labels[obj['class_id']] + ": " + str(round(obj['score']*100, 2)) + "%"
32-
draw.text((box[0], box[1]), display_str, font=ImageFont.truetype("/usr/share/fonts/truetype/piboto/Piboto-Regular.ttf", 20))
32+
draw.text((ymin,xmin), display_str, font=ImageFont.truetype("/usr/share/fonts/truetype/piboto/Piboto-Regular.ttf", 20))
3333

3434
displayImage = np.asarray( image )
3535
cv2.imshow('Coral Live Object Detection', displayImage)
@@ -115,7 +115,8 @@ def main():
115115
_, input_height, input_width, _ = interpreter.get_input_details()[0]['shape']
116116

117117
# Initialize video stream
118-
vs = VideoStream(usePiCamera=args.picamera, resolution=(640, 480)).start()
118+
vs = VideoStream(usePiCamera=args.picamera, resolution=(640, 480))
119+
vs.start() # this would close/ release the camera object properly. For vs = VideoStream().start(), vs.stop() would not work
119120
time.sleep(1)
120121

121122
fps = FPS().start()

0 commit comments

Comments
(0)

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