everything working on spaces

This commit is contained in:
freddyaboulton
2024-09-25 12:18:32 -04:00
parent 83be4aa3ea
commit 11c828edb5
17 changed files with 91 additions and 1157 deletions

View File

@@ -3,6 +3,19 @@ import cv2
import numpy as np
from gradio_webrtc import WebRTC
from pathlib import Path
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",
}
CLASSES = [
"background",
@@ -88,7 +101,7 @@ with gr.Blocks(css=css) as demo:
""")
with gr.Column(elem_classes=["my-column"]):
with gr.Group(elem_classes=["my-group"]):
image = WebRTC(label="Strean")
image = WebRTC(label="Strean", rtc_configuration=rtc_configuration)
conf_threshold = gr.Slider(
label="Confidence Threshold",
minimum=0.0,

View File

@@ -1,3 +1,5 @@
safetensors==0.4.3
opencv-python
https://gradio-builds.s3.amazonaws.com/5.0-dev/e85cc9248cc33e187528f24f3b4415ca7b9e7134/take2/gradio-5.0.0b1-py3-none-any.whl
twilio
https://huggingface.co/datasets/freddyaboulton/bucket/resolve/main/gradio-5.0.0b3-py3-none-any.whl
https://huggingface.co/datasets/freddyaboulton/bucket/resolve/main/gradio_webrtc-0.0.1-py3-none-any.whl

File diff suppressed because one or more lines are too long