Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tune up time/timing/logs in reprostim-videocapture and QR parsing #102

Merged
merged 20 commits into from
Jul 18, 2024

Conversation

vmdocua
Copy link
Collaborator

@vmdocua vmdocua commented Jun 20, 2024

This is aggregated PR. Closes #99 . Closes #100 . Closes #98.

Comment on lines 50 to 52
return (f"QrRecord(frames=[{self.frame_start}, {self.frame_end}], "
f"pos=[{self.start_pos_sec}, {self.end_pos_sec} sec], "
f"start_time={self.start_time}, end_time={self.end_time}], "
Copy link
Member

Choose a reason for hiding this comment

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

Let's uniformize

Suggested change
return (f"QrRecord(frames=[{self.frame_start}, {self.frame_end}], "
f"pos=[{self.start_pos_sec}, {self.end_pos_sec} sec], "
f"start_time={self.start_time}, end_time={self.end_time}], "
return (f"QrRecord(frames=[{self.frame_start}, {self.frame_end}], "
f"times=[{self.start_pos_sec}, {self.end_pos_sec} sec], "
f"abs_times=[{self.start_time}, {self.end_time}], "

and make it a json single line record

logger.error(f"Path does not exist: {path}")
return 1

do_parse(path)
Copy link
Member

@yarikoptic yarikoptic Jul 10, 2024

Choose a reason for hiding this comment

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

direct logs to stderr.

could this function yield those records as soon as figures out, and here have a loop

Suggested change
do_parse(path)
for rec in do_parse(path):
print(rec.model_dump_json())

this way we could use do_parse programmatically later on if needed without going back and forth through json

end_time: Optional[str] = Field(None, description="Time where QR code ends")
start_pos_sec: Optional[float] = Field(None, description="Position in seconds "
"where QR code starts")
end_pos_sec: Optional[float] = Field(None, description="Position in seconds "
Copy link
Member

@yarikoptic yarikoptic Jul 10, 2024

Choose a reason for hiding this comment

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

let's uniformize into

❯ echo {frame,time,isotime}_{start,end}
frame_start frame_end time_start time_end isotime_start isotime_end

@vmdocua vmdocua marked this pull request as ready for review July 18, 2024 10:44
@vmdocua vmdocua merged commit ae440b8 into master Jul 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants