Spaces:
Sleeping
Sleeping
from fastrtc import Stream | |
import numpy as np | |
from twilio.rest import Client | |
import os | |
account_sid = os.environ.get("TWILIO_ACCOUNT_SID") | |
auth_token = os.environ.get("TWILIO_AUTH_TOKEN") | |
client = Client(account_sid, auth_token) | |
token = client.tokens.create() | |
rtc_configuration = { | |
"iceServers": token.ice_servers, | |
"iceTransportPolicy": "relay", | |
} | |
def flip_vertically(image): | |
return np.flip(image, axis=0) | |
stream = Stream( | |
handler=flip_vertically, | |
rtc_configuration=rtc_configuration, | |
modality="video", | |
mode="send-receive", | |
) | |
stream.ui.launch() | |