-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Improvement] Add font color to args in long_video_demo #947
[Improvement] Add font color to args in long_video_demo #947
Conversation
Codecov Report
@@ Coverage Diff @@
## master #947 +/- ##
==========================================
+ Coverage 83.69% 83.70% +0.01%
==========================================
Files 132 132
Lines 9983 9983
Branches 1722 1722
==========================================
+ Hits 8355 8356 +1
Misses 1211 1211
+ Partials 417 416 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
demo/long_video_demo.py
Outdated
return text_info | ||
|
||
|
||
def get_results_json(result_queue, text_info, thr, msg, ind, out_json): | ||
def get_results_json(result_queue, text_info, msg, thr, ind, out_json): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not good to change the argument position
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated accordingly. But why isn't this one good btw?
demo/long_video_demo.py
Outdated
THICKNESS, LINETYPE) | ||
elif len(text_info): | ||
for location, text in text_info.items(): | ||
cv2.putText(frame, text, location, FONTFACE, FONTSCALE, FONTCOLOR, | ||
cv2.putText(fr, text, location, FONTFACE, FONTSCALE, clr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not good to use abbreviation as variable name, which is hard to understand
demo/long_video_demo.py
Outdated
args = parser.parse_args() | ||
return args | ||
|
||
|
||
def show_results_video(result_queue, text_info, thr, msg, frame, video_writer): | ||
def show_results_video(result_queue, text_info, thr, msg, font_color, frame, | ||
video_writer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def show_results_video(result_queue, text_info, thr, msg, frame, video_writer, font_color=(255, 255, 255)):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah.. updated (default value is in parse_args
, however)
I'm okay with the change as long as it can run successfully 😃 |
Motivation
Make font color in
long_video_demo.py
controllable by fetching it as args to the script. Otherwise one has to modify the code.Modification
Small modifications at
long_video_demo.py
Use cases (Optional)
Updated docs accordingly