Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions demo/demo_without_detection_timecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ def get_pose_estimation_prediction(pose_model, image, center, scale):
time_start = time.time()
##############################################################################
output = pose_model(model_input)
# ##############################################################################
##############################################################################
torch.cuda.current_stream().synchronize()
time_end = time.time()
time_processing = time_end - time_start
global time_processing_total
time_processing_total += time_processing
# ##############################################################################
##############################################################################

preds, _ = get_final_preds(
cfg,
Expand Down Expand Up @@ -231,23 +231,24 @@ def parse_args():
model_ = get_model(args)
print('Total ', sum(p.numel() for p in model_.parameters()), ' Parameters')


image_ = cv2.imread(args.image)

count_iter = 1000
count_iter = 100
print('Timecheck Start!')

# ##############################################################################
# torch.cuda.current_stream().synchronize()
# time_start = time.time()
# ##############################################################################
for i in range(count_iter):
image_ = np.clip((image_ + (i % 10) -5), 0, 255)
# ##############################################################################
# torch.cuda.current_stream().synchronize()
# time_start = time.time()
# ##############################################################################

keypoints = inference(model_, image_)
# ##############################################################################
# torch.cuda.current_stream().synchronize()
# time_end = time.time()
# time_processing = time_end - time_start
# time_processing_total += time_processing
# ##############################################################################
##############################################################################
# torch.cuda.current_stream().synchronize()
# time_end = time.time()
# time_processing = time_end - time_start
# time_processing_total += time_processing
##############################################################################
print(time_processing_total / count_iter)