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

Add an app message to the translator starter app #71

Closed
wants to merge 3 commits into from

Conversation

chadbailey59
Copy link
Contributor

No description provided.

@chadbailey59 chadbailey59 requested a review from Moishe March 19, 2024 15:47
image: bytes

def __str__(self):
return f"{self.__class__.__name__}, participantId: {self.participantId}, image size: {len(self.image)} B"
Copy link
Contributor

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"
Copy link
Contributor

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):
Copy link
Contributor

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")
Copy link
Contributor

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(
Copy link
Contributor

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}")
Copy link
Contributor

Choose a reason for hiding this comment

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

print -> logger.debug

@aconchillo
Copy link
Contributor

This PR is obsolete, closing.

@aconchillo aconchillo closed this Aug 28, 2024
@aconchillo aconchillo deleted the cb/translator-app-messages branch October 23, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants