Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

Conversation

@Aleksa-M
Copy link
Contributor

@Aleksa-M Aleksa-M commented Dec 3, 2024

No description provided.

Copy link
Member

@maxlou05 maxlou05 left a 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
Copy link
Member

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",
Copy link
Member

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).


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:
Copy link
Member

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

Copy link
Collaborator

@Xierumeng Xierumeng left a 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,
Copy link
Collaborator

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.

Copy link
Member

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

Copy link
Collaborator

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.

Copy link
Collaborator

@Xierumeng Xierumeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

Copy link
Collaborator

@Xierumeng Xierumeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

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.
Copy link
Collaborator

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.

Copy link
Collaborator

@Xierumeng Xierumeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

Comment on lines 15 to 16
WIDTH = 1920
HEIGHT = 1200
Copy link
Collaborator

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
Copy link
Collaborator

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.

Copy link
Collaborator

@Xierumeng Xierumeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thanks!

@maxlou05 maxlou05 merged commit a268391 into main Dec 22, 2024
1 check passed
@maxlou05 maxlou05 deleted the camera-refactor branch December 22, 2024 05:11
arpanroy18 pushed a commit that referenced this pull request Jan 10, 2025
* 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants