Skip to content

Commit fd2e99a

Browse files
committed
blaze_detect_live.py: update implementation of profile/fps options (fps plot enabled with profile option).
1 parent 62e37ff commit fd2e99a

File tree

5 files changed

+15
-25
lines changed

5 files changed

+15
-25
lines changed

blaze_detect_live.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def ignore(x):
388388
print("[ERROR] cap.read() FAILEd !")
389389
break
390390

391-
if bProfile or bShowFPS:
391+
if bProfile:
392392
prof_title = ['']*nb_blaze_pipelines
393393
prof_resize = np.zeros(nb_blaze_pipelines)
394394
prof_detector_pre = np.zeros(nb_blaze_pipelines)
@@ -511,7 +511,7 @@ def ignore(x):
511511
cv2.imshow(app_main_title, output)
512512

513513
# Profiling
514-
if bProfile or bShowFPS:
514+
if bProfile:
515515
prof_title[pipeline_id] = blaze_title
516516
prof_resize[pipeline_id] = profile_resize
517517
prof_detector_pre[pipeline_id] = blaze_detector.profile_pre
@@ -617,7 +617,6 @@ def ignore(x):
617617
print("Capturing ",filename," ...")
618618
cv2.imwrite(os.path.join(output_dir,filename),profile_latency_img)
619619

620-
if bShowFPS:
621620
#
622621
# FPS
623622
#
@@ -699,8 +698,6 @@ def ignore(x):
699698

700699
if key == 102: # 'f'
701700
bShowFPS = not bShowFPS
702-
if not bShowFPS:
703-
cv2.destroyWindow(profile_fps_title)
704701

705702
if key == 118: # 'v'
706703
bVerbose = not bVerbose
@@ -718,6 +715,7 @@ def ignore(x):
718715
blaze_landmark.set_profile(profile=bProfile)
719716
if not bProfile:
720717
cv2.destroyWindow(profile_latency_title)
718+
cv2.destroyWindow(profile_fps_title)
721719

722720
if key == 27 or key == 113: # ESC or 'q':
723721
break

blaze_hailo/blaze_detect_live.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def ignore(x):
247247
print("[ERROR] cap.read() FAILEd !")
248248
break
249249

250-
if bProfile or bShowFPS:
250+
if bProfile:
251251
prof_title = ['']*nb_blaze_pipelines
252252
prof_resize = np.zeros(nb_blaze_pipelines)
253253
prof_detector_pre = np.zeros(nb_blaze_pipelines)
@@ -359,7 +359,7 @@ def ignore(x):
359359
cv2.imshow(app_main_title, output)
360360

361361
# Profiling
362-
if bProfile or bShowFPS:
362+
if bProfile:
363363
prof_title[pipeline_id] = blaze_title
364364
prof_resize[pipeline_id] = profile_resize
365365
prof_detector_pre[pipeline_id] = blaze_detector.profile_pre
@@ -465,7 +465,6 @@ def ignore(x):
465465
print("Capturing ",filename," ...")
466466
cv2.imwrite(os.path.join(output_dir,filename),profile_latency_img)
467467

468-
if bShowFPS:
469468
#
470469
# FPS
471470
#
@@ -543,8 +542,6 @@ def ignore(x):
543542

544543
if key == 102: # 'f'
545544
bShowFPS = not bShowFPS
546-
if not bShowFPS:
547-
cv2.destroyWindow(profile_fps_title)
548545

549546
if key == 118: # 'v'
550547
bVerbose = not bVerbose
@@ -557,6 +554,7 @@ def ignore(x):
557554
blaze_landmark.set_profile(profile=bProfile)
558555
if not bProfile:
559556
cv2.destroyWindow(profile_latency_title)
557+
cv2.destroyWindow(profile_fps_title)
560558

561559
if key == 27 or key == 113: # ESC or 'q':
562560
break

blaze_pytorch/blaze_detect_live.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def ignore(x):
243243
print("[ERROR] cap.read() FAILEd !")
244244
break
245245

246-
if bProfile or bShowFPS:
246+
if bProfile:
247247
prof_title = ['']*nb_blaze_pipelines
248248
prof_resize = np.zeros(nb_blaze_pipelines)
249249
prof_detector_pre = np.zeros(nb_blaze_pipelines)
@@ -355,7 +355,7 @@ def ignore(x):
355355
cv2.imshow(app_main_title, output)
356356

357357
# Profiling
358-
if bProfile or bShowFPS:
358+
if bProfile:
359359
prof_title[pipeline_id] = blaze_title
360360
prof_resize[pipeline_id] = profile_resize
361361
prof_detector_pre[pipeline_id] = blaze_detector.profile_pre
@@ -461,7 +461,6 @@ def ignore(x):
461461
print("Capturing ",filename," ...")
462462
cv2.imwrite(os.path.join(output_dir,filename),profile_latency_img)
463463

464-
if bShowFPS:
465464
#
466465
# FPS
467466
#
@@ -539,8 +538,6 @@ def ignore(x):
539538

540539
if key == 102: # 'f'
541540
bShowFPS = not bShowFPS
542-
if not bShowFPS:
543-
cv2.destroyWindow(profile_fps_title)
544541

545542
if key == 118: # 'v'
546543
bVerbose = not bVerbose
@@ -553,6 +550,7 @@ def ignore(x):
553550
blaze_landmark.set_profile(profile=bProfile)
554551
if not bProfile:
555552
cv2.destroyWindow(profile_latency_title)
553+
cv2.destroyWindow(profile_fps_title)
556554

557555
if key == 27 or key == 113: # ESC or 'q':
558556
break

blaze_tflite/blaze_detect_live.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def ignore(x):
245245
print("[ERROR] cap.read() FAILEd !")
246246
break
247247

248-
if bProfile or bShowFPS:
248+
if bProfile:
249249
prof_title = ['']*nb_blaze_pipelines
250250
prof_resize = np.zeros(nb_blaze_pipelines)
251251
prof_detector_pre = np.zeros(nb_blaze_pipelines)
@@ -357,7 +357,7 @@ def ignore(x):
357357
cv2.imshow(app_main_title, output)
358358

359359
# Profiling
360-
if bProfile or bShowFPS:
360+
if bProfile:
361361
prof_title[pipeline_id] = blaze_title
362362
prof_resize[pipeline_id] = profile_resize
363363
prof_detector_pre[pipeline_id] = blaze_detector.profile_pre
@@ -463,7 +463,6 @@ def ignore(x):
463463
print("Capturing ",filename," ...")
464464
cv2.imwrite(os.path.join(output_dir,filename),profile_latency_img)
465465

466-
if bShowFPS:
467466
#
468467
# FPS
469468
#
@@ -541,8 +540,6 @@ def ignore(x):
541540

542541
if key == 102: # 'f'
543542
bShowFPS = not bShowFPS
544-
if not bShowFPS:
545-
cv2.destroyWindow(profile_fps_title)
546543

547544
if key == 118: # 'v'
548545
bVerbose = not bVerbose
@@ -555,6 +552,7 @@ def ignore(x):
555552
blaze_landmark.set_profile(profile=bProfile)
556553
if not bProfile:
557554
cv2.destroyWindow(profile_latency_title)
555+
cv2.destroyWindow(profile_fps_title)
558556

559557
if key == 27 or key == 113: # ESC or 'q':
560558
break

blaze_vitisai/blaze_detect_live.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def ignore(x):
260260
print("[ERROR] cap.read() FAILEd !")
261261
break
262262

263-
if bProfile or bShowFPS:
263+
if bProfile:
264264
prof_title = ['']*nb_blaze_pipelines
265265
prof_resize = np.zeros(nb_blaze_pipelines)
266266
prof_detector_pre = np.zeros(nb_blaze_pipelines)
@@ -372,7 +372,7 @@ def ignore(x):
372372
cv2.imshow(app_main_title, output)
373373

374374
# Profiling
375-
if bProfile or bShowFPS:
375+
if bProfile:
376376
prof_title[pipeline_id] = blaze_title
377377
prof_resize[pipeline_id] = profile_resize
378378
prof_detector_pre[pipeline_id] = blaze_detector.profile_pre
@@ -478,7 +478,6 @@ def ignore(x):
478478
print("Capturing ",filename," ...")
479479
cv2.imwrite(os.path.join(output_dir,filename),profile_latency_img)
480480

481-
if bShowFPS:
482481
#
483482
# FPS
484483
#
@@ -556,8 +555,6 @@ def ignore(x):
556555

557556
if key == 102: # 'f'
558557
bShowFPS = not bShowFPS
559-
if not bShowFPS:
560-
cv2.destroyWindow(profile_fps_title)
561558

562559
if key == 118: # 'v'
563560
bVerbose = not bVerbose
@@ -570,6 +567,7 @@ def ignore(x):
570567
blaze_landmark.set_profile(profile=bProfile)
571568
if not bProfile:
572569
cv2.destroyWindow(profile_latency_title)
570+
cv2.destroyWindow(profile_fps_title)
573571

574572
if key == 27 or key == 113: # ESC or 'q':
575573
break

0 commit comments

Comments
 (0)