Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- frames = []
- for i in range(0, duration): # duration is basically the number of frames I need per blob
- (grabbed, frame) = video_stream.read()
- if not grabbed:
- print("Finishing...")
- sys.exit(0)
- frame = imutils.resize(frame, width=400)
- frames.append(frame)
- frame_blob = cv2.dnn.blobFromImages(frames, 1.0,
- (frame_size, frame_size),
- (114.7748, 107.7354, 99.4750),
- swapRB=True, crop=True)
- frame_blob = np.transpose(frame_blob, (1, 0, 2, 3))
- frame_blob = np.expand_dims(frame_blob, axis=0)
- neural_network.setInput(frame_blob)
- outputs = neural_network.forward()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement