You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code is used for detecting objects and drawing bounding boxes but for some reason the bounding box is drawn on the top-left corner of the output frame. The output image looks like this.
The intended output image looks like this:
I trained the model for small epochs so I reduced the threshold values(0.01-0.40) as well as the number of boxes(from 200 to 1) to draw but finally thought there may be an issue with resizing the bounding box on the original image size.
Any help would be appreciated thank you.
The text was updated successfully, but these errors were encountered:
cap = cv2.VideoCapture(output_video_path)
frame_width = int(cap.get(3))
frame_height = int(cap.get(4))
fps = FPS().start()
out = cv2.VideoWriter('./videos/output_video1.mp4', cv2.VideoWriter_fourcc('M','P','4','V'), 30, (frame_width,frame_height))
currentframe = 0
while (cap.isOpened() and currentframe<2000):
ret, image_np = cap.read()
if len((np.array(image_np)).shape) == 0:
break
fps.stop()
print("[INFO] elasped time: {:.2f}".format(fps.elapsed()))
print("[INFO] approx. FPS: {:.2f}".format(fps.fps()))
cap.release()
out.release()
The above code is used for detecting objects and drawing bounding boxes but for some reason the bounding box is drawn on the top-left corner of the output frame. The output image looks like this.
The intended output image looks like this:
I trained the model for small epochs so I reduced the threshold values(0.01-0.40) as well as the number of boxes(from 200 to 1) to draw but finally thought there may be an issue with resizing the bounding box on the original image size.
Any help would be appreciated thank you.
The text was updated successfully, but these errors were encountered: