-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
42 lines (28 loc) · 871 Bytes
/
Copy pathapp.py
File metadata and controls
42 lines (28 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import streamlit as st
from streamlit_image_select import image_select
import requests
import json
import glob
Auth ='Basic dmlzaGFsYWJoYW5nNTVAeWFob28uY29t:gAW4HL5K7QXN1iZ7PBo3y'
def generateTalk():
url = "https://api.d-id.com/talks"
payload = json.dumps({
"source_url": "https://raw.githubusercontent.com/vishalabhang/doc.d/master/avatar1.jpg",
"script": {
"type": "text",
"input": "Hello world!"
}
})
headers = {
'Authorization': Auth,
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
def main():
st.header("Doc D integration Demo")
images=glob.glob("input_images/*")
select_image=image_select("Select Avatar",images)
if select_image :
print(select_image)
if __name__ == "__main__":
main()