-
Notifications
You must be signed in to change notification settings - Fork 37
integrated camera_factory in video_input #232
Conversation
maxlou05
left a comment
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.
Reviewed
| from modules.video_input import video_input | ||
|
|
||
|
|
||
| CAMERA = 0 |
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.
Can you rename this to camera option? Also, isn't there an enum for what each number means? Please use the enum
|
|
||
|
|
||
| def video_input_worker( | ||
| camera_name: "int | str", |
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.
This should be the CameraOption enum class. Then, you will need to change the config.yaml to include this option. You will also need to change the config loading portion of the code (similar to DETECT_TARGET_OPTION_INT).
modules/video_input/video_input.py
Outdated
|
|
||
| def __init__(self, camera_name: "int | str", save_name: str = "") -> None: | ||
| self.device = camera_device.CameraDevice(camera_name, 1, save_name) | ||
| def __init__(self, camera_option: int, width: int, height: int) -> None: |
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.
Make camera_option the enum
c52de01 to
4533f3a
Compare
Xierumeng
left a comment
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.
Reviewed.
| camera_name: "int | str", | ||
| period: float, | ||
| save_name: str, | ||
| period: int, |
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.
Move period with the worker parameters. Also should be float.
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 currently is a worker parameter? I changed it to float
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 meant immediately above output_queue . Then the parameters for the class object and the worker are grouped separately.
Xierumeng
left a comment
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.
Reviewed.
27393c3 to
8ddc188
Compare
Xierumeng
left a comment
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.
Reviewed.
modules/video_input/video_input.py
Outdated
| width is the width of the images the camera takes in pixels. | ||
| height is the height of the images the camera takes in pixels. | ||
| camera_config specifies camera settings. | ||
| maybe_image_name is name of iamge log files. Set to None to not log any images. |
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.
Update this to align with logger.
Spelling.
Xierumeng
left a comment
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.
Reviewed.
| WIDTH = 1920 | ||
| HEIGHT = 1200 |
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.
Integration test is failing for me, I suggest a resolution of 640x480 .
| # Modify these settings as needed | ||
| VIDEO_INPUT_WORKER_PERIOD = 1.0 | ||
| CAMERA = 0 | ||
| CAMERA = camera_factory.CameraOption.OPENCV |
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.
Also failing here, but for some reason there is a conversion which results in this being float in the worker function.
Xierumeng
left a comment
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.
Approved, thanks!
* integrated camera_factory in video_input * added missing parameters * removed cluster estimation test file * accommodate video input for new camera factory and logger changes in common * refactor for moving camera config classes into each camera module * add comments and change empty to string to a valid iamge prefix * Fix comments * refactor video_input save_prefix to image_name, for proper use with logger.save_image * bug fix for video_input integration tests --------- Co-authored-by: Maxwell Lou <maxlou2005@gmail.com>
No description provided.