-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add an app message to the translator starter app #71
Conversation
image: bytes | ||
|
||
def __str__(self): | ||
return f"{self.__class__.__name__}, participantId: {self.participantId}, image size: {len(self.image)} B" |
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.
should this guard that self.image
is not None?
image: bytes | ||
|
||
def __str__(self): | ||
return f"{self.__class__.__name__}, prompt: {self.prompt}, image size: {len(self.image)} B" |
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.
same q as above
pass | ||
|
||
async def process_frame(self, frame: Frame) -> AsyncGenerator[Frame, None]: | ||
if isinstance(frame, VisionFrame): |
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 think this should pass-through non-VisionFrame frames.
def _handle_video_frame(self, participant_id, video_frame): | ||
# TODO-CB: What about multiple participants? | ||
if (not participant_id in self._participant_frame_times) or (time.time() > self._participant_frame_times[participant_id] + 1.0/self._receive_video_fps): | ||
print(f"### sending frame now") |
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.
could change this to logger.debug
if (not participant_id in self._participant_frame_times) or (time.time() > self._participant_frame_times[participant_id] + 1.0/self._receive_video_fps): | ||
print(f"### sending frame now") | ||
self._participant_frame_times[participant_id] = time.time() | ||
asyncio.run_coroutine_threadsafe( |
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.
might be worth assigning the result of this to a variable (eg future
), then calling future.result()
) | ||
) | ||
async for chunk in chunks: | ||
print(f"!!! chunk: {chunk}") |
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.
print -> logger.debug
This PR is obsolete, closing. |
No description provided.