Skip to content

Commit 581dd95

Browse files
committed
updated metadata plotting when cropping
1 parent 82dbe96 commit 581dd95

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

DeepLabStream.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,13 @@ def get_analysed_frames(self) -> tuple:
426426
if self._dlc_running:
427427
analysed_frames = {}
428428
analysis_time = None
429-
frame_width, frame_height = RESOLUTION
429+
430+
if CROP:
431+
frame_height = CROP_Y[1] - CROP_Y[0]
432+
frame_width = CROP_X[1] - CROP_X[0]
433+
else:
434+
frame_width,frame_height = RESOLUTION
435+
430436
for camera in self._multiprocessing:
431437
if self._multiprocessing[camera]['output'].full():
432438
if self._start_time is None:

utils/plotter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import cv2
1010
import numpy as np
1111

12-
1312
def plot_dots(image, coordinates, color, cond=False):
1413
"""
1514
Takes the image and positional arguments from pose to plot corresponding dot
@@ -55,10 +54,11 @@ def plot_metadata_frame(image, frame_width, frame_height, current_fps, current_e
5554
"""
5655
res_image = image.copy()
5756
font = cv2.FONT_HERSHEY_PLAIN
57+
5858
cv2.putText(res_image, 'Time: ' + str(round(current_elapsed_time, 2)),
5959
(int(frame_width * 0.8), int(frame_height * 0.9)), font, 1, (255, 255, 0))
6060
cv2.putText(res_image, 'FPS: ' + str(round(current_fps, 1)),
61-
(int(frame_width * 0.8), int(frame_height * 0.95)), font, 1, (255, 255, 0))
61+
(int(frame_width * 0.8), int(frame_height * 0.94)), font, 1, (255, 255, 0))
6262
return res_image
6363

6464
def plot_dlc_bodyparts(image, bodyparts):

0 commit comments

Comments
 (0)