Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. def get_frame(self):
  2. #try:
  3. ret, frame = self.cap.read()
  4.  
  5. initial_w = self.cap.get(3)
  6. initial_h = self.cap.get(4)
  7. res_inference=self.resultant_initialisation_object.process_frame(self.cur_request_id,self.next_request_id,frame,initial_h,initial_w,False)
  8. resultant_frame,count=self.resultant_initialisation_object.placeBoxes(res_inference,None,0.5,frame,initial_w,initial_h,False,self.cur_request_id)
  9. cv2.putText(resultant_frame, 'Number of vehicles detected: ' + ' ' + str(count), (20, 20), cv2.FONT_HERSHEY_COMPLEX, 0.6, (0,0,255), 1)
  10. #out.write(resultant_frame)
  11. #cv2.imshow('frame',resultant_frame)
  12. #key = cv2.waitKey(1)
  13. #print("Vehicles detected number: "+str(count))
  14. resized_frame= cv2.resize(frame,(1024,560))
  15. _, jpeg = cv2.imencode('.jpg', resized_frame)
  16. return jpeg.tobytes()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement